]> andersk Git - sql-web.git/blobdiff - batch/signup-client.php
lighttpd remote signups
[sql-web.git] / batch / signup-client.php
diff --git a/batch/signup-client.php b/batch/signup-client.php
new file mode 100755 (executable)
index 0000000..1898efd
--- /dev/null
@@ -0,0 +1,28 @@
+#!/usr/bin/php -q
+<?php
+
+require_once(dirname(__FILE__).'/../mitsql.cfg.php');
+require_once('mitsql.lib.php');
+
+require_once('batch.inc.php');
+
+if (!defined('SIGNUP_PW') || strlen(SIGNUP_PW)==0) exit;
+if (!isset($argv) || count($argv) < 4) exit;
+$myUsername = $argv[1];
+$myUID = $argv[3];
+if ($myUID<100) exit('bad UID');
+
+if (!extension_loaded('curl'))
+    @dl('curl.so');
+
+//$cx = curl_init(BASE_HTTPS.BASE_URL.'do/batch/signup');
+$cx = curl_init('https://scripts2.mit.edu/dev/do/batch/signup');
+curl_setopt($cx, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
+curl_setopt($cx, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($cx, CURLOPT_SSL_VERIFYHOST, false);
+curl_setopt($cx, CURLOPT_SSL_VERIFYPEER, false);
+curl_setopt($cx, CURLOPT_POST, true);
+curl_setopt($cx, CURLOPT_POSTFIELDS, 'u='.$myUsername);
+curl_setopt($cx, CURLOPT_USERPWD, 'signup:'.SIGNUP_PW);
+echo curl_exec($cx);
+?>
This page took 0.025094 seconds and 4 git commands to generate.