webbuild interface: small fixes for portability

This commit is contained in:
Silvan Calarco 2013-05-21 11:57:52 +02:00
parent f9a0a4f5bd
commit 035e78eba8
3 changed files with 7 additions and 9 deletions

View File

@ -1,4 +1,4 @@
var url = "/cgi-bin/webbuild.cgi"
var url = "/cgi-bin/webbuild"
function socialbox_refresh_times() {
var times = document.getElementsByName("socialtime");

View File

@ -98,6 +98,7 @@ function ajax_getvalues(request,confirm) {
if (!secret) {
secret=getCookie("webbuild-secret");
if (!secret) secret="";
}
if (confirm) {
document.getElementById("status").innerHTML =
@ -162,7 +163,6 @@ function ajax_getvalues(request,confirm) {
}
}
}
//alert("nodes done");
document.getElementById("webbuildform").disabled = false;
document.getElementById("status").innerHTML = "";
}

View File

@ -50,7 +50,6 @@ if [ "$USER" ]; then
echo "USER_SECRET='$SECRET'" >> $tmpfile
$SUDO_WRAPPER 0 local "$USER" "" "mv $tmpfile $WEBBUILD_STATEDIR/users/$USER.conf"
fi
SECRET="$USER_SECRET"
USER_ENABLED=1
else
USER_ENABLED=
@ -78,8 +77,7 @@ elif [ "$REQUEST" != "refresh" ]; then
echo -n "<output><![CDATA[Please enter your username: <input type=text id=username>"
echo -n " <input type=button value=\"Submit\" onClick="
echo -n "user=encodeURIComponent(getElementById('username').value);"
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
echo -n "USER=\"+encodeURIComponent(getElementById('username').value));>"
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED\");>"
echo -n "]]></output>"
echo -n "<environments> </environments>"
echo -n "<speccreate> </speccreate>"
@ -93,7 +91,7 @@ elif [ "$REQUEST" != "refresh" ]; then
exit
fi
if [ "$USER_ENABLED" != "1" ]; then
if [ "$USER_ENABLED" != "1" -a "$REQUEST" != "refresh" ]; then
echo -n "<environments> </environments>"
echo -n "<speccreate> </speccreate>"
echo -n "<specedit> </specedit>"
@ -101,7 +99,7 @@ if [ "$USER_ENABLED" != "1" ]; then
echo -n "<packages> </packages>"
echo -n "<editcontrols> </editcontrols>"
echo -n "<editor> </editor>"
if [ "$USER" -a "$SECRET" ]; then
if [ "$USER" ]; then
if [ "$REQUEST" = "enablerequest" ]; then
echo "REQUEST_DATE=\"`date`\" REQUEST_USER=$USER REQUEST_USER_EMAIL=$USER_EMAIL REQUEST_TYPE=$REQUEST REQUEST_SECRET='$SECRET'" >> $WEBBUILD_STATEDIR/requests
echo -n "<output>Your request has been submitted. Please wait for approval and retry later.</output>"
@ -119,8 +117,8 @@ if [ "$USER_ENABLED" != "1" ]; then
# echo -n "<output>Unauthorized!</output>"
fi
echo -n "<operationpanel> </operationpanel>"
# echo -n "</webbuild>"
# exit
echo -n "</webbuild>"
exit
fi
if [ -e $WEBBUILD_STATEDIR/webbuild.state ]; then