]> andersk Git - sql-web.git/blob - batch/signup-client.php
lighttpd remote signups
[sql-web.git] / batch / signup-client.php
1 #!/usr/bin/php -q
2 <?php
3
4 require_once(dirname(__FILE__).'/../mitsql.cfg.php');
5 require_once('mitsql.lib.php');
6
7 require_once('batch.inc.php');
8
9 if (!defined('SIGNUP_PW') || strlen(SIGNUP_PW)==0) exit;
10 if (!isset($argv) || count($argv) < 4) exit;
11 $myUsername = $argv[1];
12 $myUID = $argv[3];
13 if ($myUID<100) exit('bad UID');
14
15 if (!extension_loaded('curl'))
16     @dl('curl.so');
17
18 //$cx = curl_init(BASE_HTTPS.BASE_URL.'do/batch/signup');
19 $cx = curl_init('https://scripts2.mit.edu/dev/do/batch/signup');
20 curl_setopt($cx, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
21 curl_setopt($cx, CURLOPT_RETURNTRANSFER, true);
22 curl_setopt($cx, CURLOPT_SSL_VERIFYHOST, false);
23 curl_setopt($cx, CURLOPT_SSL_VERIFYPEER, false);
24 curl_setopt($cx, CURLOPT_POST, true);
25 curl_setopt($cx, CURLOPT_POSTFIELDS, 'u='.$myUsername);
26 curl_setopt($cx, CURLOPT_USERPWD, 'signup:'.SIGNUP_PW);
27 echo curl_exec($cx);
28 ?>
This page took 0.037358 seconds and 5 git commands to generate.