summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/hosting/server/delete-auth
diff options
context:
space:
mode:
Diffstat (limited to 'sca-cpp/trunk/hosting/server/delete-auth')
-rwxr-xr-xsca-cpp/trunk/hosting/server/delete-auth51
1 files changed, 25 insertions, 26 deletions
diff --git a/sca-cpp/trunk/hosting/server/delete-auth b/sca-cpp/trunk/hosting/server/delete-auth
index 407d730c80..ffd7044e2d 100755
--- a/sca-cpp/trunk/hosting/server/delete-auth
+++ b/sca-cpp/trunk/hosting/server/delete-auth
@@ -18,43 +18,42 @@
# under the License.
here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here`
-mkdir -p $1
+mkdir -p $1/conf
root=`echo "import os; print os.path.realpath('$1')" | python`
admin=$2
apass=$3
-user=$4
+email=$4
+host=$5
httpd_prefix=`cat $here/../../modules/http/httpd.prefix`
-conf=`cat $root/conf/httpd.conf | grep "# Generated by: httpd-conf"`
-sslconf=`cat $root/conf/httpd.conf | grep "# Generated by: httpd-ssl-conf"`
-if [ "$sslconf" = "" ]; then
- scheme="http"
- addr=`echo $conf | awk '{ print $7 }'`
- host=`$here/../../modules/http/httpd-addr ip $addr`
- if [ "$host" = "" ]; then
- host="localhost"
+if [ "$host" = "" ]; then
+ conf=`cat $root/conf/httpd.conf | grep "# Generated by: httpd-conf"`
+ sslconf=`cat $root/conf/httpd.conf | grep "# Generated by: httpd-ssl-conf"`
+ if [ "$sslconf" = "" ]; then
+ scheme="http"
+ addr=`echo $conf | awk '{ print $7 }'`
+ host=`$here/../../modules/http/httpd-addr ip $addr`
+ if [ "$host" = "" ]; then
+ host="localhost"
+ fi
+ port=`$here/../../modules/http/httpd-addr port $addr`
+ else
+ scheme="https"
+ ssladdr=`echo $sslconf | awk '{ print $6 }'`
+ host=`$here/../../modules/http/httpd-addr ip $ssladdr`
+ if [ "$host" = "" ]; then
+ host="localhost"
+ fi
+ port=`$here/../../modules/http/httpd-addr port $ssladdr`
fi
- port=`$here/../../modules/http/httpd-addr port $addr`
else
scheme="https"
- ssladdr=`echo $sslconf | awk '{ print $6 }'`
- host=`$here/../../modules/http/httpd-addr ip $ssladdr`
- if [ "$host" = "" ]; then
- host="localhost"
- fi
- port=`$here/../../modules/http/httpd-addr port $ssladdr`
+ port="443"
fi
-# Compute user id
-slash=`echo $user | grep "/"`
-if [ "$slash" = "" ]; then
- id="\"$user\""
- upath=$user
-else
- id=`echo $user | awk -F "/" '{ printf "\"%s\" \"%s\"", $2, $3 }'`
- upath=`echo $user | awk -F "/" '{ printf "%s/%s", $2, $3 }'`
-fi
+# Compute user URI
+upath=$email
# Delete user auth
curl -k -L -u $admin:$apass -X DELETE -H "X-Forwarded-Server: $host" $scheme://$host:$port/c/Authenticator/$upath