From b6aa88d2cb0d13771a17b4a03ade767456ec1519 Mon Sep 17 00:00:00 2001 From: Joe Presbrey Date: Tue, 21 Aug 2007 23:05:07 +0000 Subject: [PATCH] lighttpd remote signups git-svn-id: svn://presbrey.mit.edu/sql/web/dev@141 a142d4bd-2cfb-0310-9673-cb33a7e74f58 --- batch/signup-client.php | 28 ++++++++++++++++++++++++++++ batch/signup.php | 13 ++++++++++--- contrib/deleteuser.sql | 2 +- 3 files changed, 39 insertions(+), 4 deletions(-) create mode 100755 batch/signup-client.php diff --git a/batch/signup-client.php b/batch/signup-client.php new file mode 100755 index 0000000..1898efd --- /dev/null +++ b/batch/signup-client.php @@ -0,0 +1,28 @@ +#!/usr/bin/php -q + diff --git a/batch/signup.php b/batch/signup.php index 9978522..20175b9 100755 --- a/batch/signup.php +++ b/batch/signup.php @@ -6,10 +6,17 @@ require_once('mitsql.lib.php'); require_once('batch.inc.php'); -$myUsername = $argv[1]; -$myUID = $argv[3]; -if ($myUID<100) exit('bad UID'); +if (isset($argv) && count($argv)>=4) { + $myUsername = $argv[1]; + $myUID = $argv[3]; + if ($myUID<100) exit('bad UID'); +} elseif (defined('SIGNUP_PW') && strlen(SIGNUP_PW) && (isset($_SERVER['HTTP_AUTHORIZATION']) || isset($_SERVER['PHP_AUTH_PW'])) && SIGNUP_PW == $_SERVER['PHP_AUTH_PW']) { + $myUsername = $i_u; +} else { + exit; +} +if (empty($myUsername)) exit('bad User'); $hescmd = "hesinfo $myUsername passwd"; $hesinfo = explode(':', trim(exec($hescmd))); if (count($hesinfo)>=4) { diff --git a/contrib/deleteuser.sql b/contrib/deleteuser.sql index 2447df9..c208ad8 100644 --- a/contrib/deleteuser.sql +++ b/contrib/deleteuser.sql @@ -1,5 +1,5 @@ -SET @NAME=185; +SET @NAME=1340; USE mitsql; DELETE FROM DBQuota WHERE DatabaseId IN (SELECT DatabaseId FROM DBOwner WHERE UserId = @NAME); -- 2.45.0