From 035e78eba801be4d542d330b5562536282e353c2 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Tue, 21 May 2013 11:57:52 +0200 Subject: [PATCH] webbuild interface: small fixes for portability --- webbuild/html/scripts/socialbox.js | 2 +- webbuild/html/webbuild.html | 2 +- webbuild/webbuild-cgi | 12 +++++------- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/webbuild/html/scripts/socialbox.js b/webbuild/html/scripts/socialbox.js index 483e052..0b0cdc5 100644 --- a/webbuild/html/scripts/socialbox.js +++ b/webbuild/html/scripts/socialbox.js @@ -1,4 +1,4 @@ -var url = "/cgi-bin/webbuild.cgi" +var url = "/cgi-bin/webbuild" function socialbox_refresh_times() { var times = document.getElementsByName("socialtime"); diff --git a/webbuild/html/webbuild.html b/webbuild/html/webbuild.html index 8fd899a..80c5042 100644 --- a/webbuild/html/webbuild.html +++ b/webbuild/html/webbuild.html @@ -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 = ""; } diff --git a/webbuild/webbuild-cgi b/webbuild/webbuild-cgi index e10127a..df256d3 100755 --- a/webbuild/webbuild-cgi +++ b/webbuild/webbuild-cgi @@ -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 "" echo -n " " + echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED\");>" echo -n "]]>" echo -n " " echo -n " " @@ -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 " " echo -n " " echo -n " " @@ -101,7 +99,7 @@ if [ "$USER_ENABLED" != "1" ]; then echo -n " " echo -n " " echo -n " " - 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 "Your request has been submitted. Please wait for approval and retry later." @@ -119,8 +117,8 @@ if [ "$USER_ENABLED" != "1" ]; then # echo -n "Unauthorized!" fi echo -n " " -# echo -n "" -# exit + echo -n "" + exit fi if [ -e $WEBBUILD_STATEDIR/webbuild.state ]; then