]> andersk Git - sql-web.git/blob - batch/signup-client.php
lets have a SIGNUP_URL option
[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(SIGNUP_URL);
19 curl_setopt($cx, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
20 curl_setopt($cx, CURLOPT_RETURNTRANSFER, true);
21 curl_setopt($cx, CURLOPT_SSL_VERIFYHOST, false);
22 curl_setopt($cx, CURLOPT_SSL_VERIFYPEER, false);
23 curl_setopt($cx, CURLOPT_POST, true);
24 curl_setopt($cx, CURLOPT_POSTFIELDS, 'u='.$myUsername);
25 curl_setopt($cx, CURLOPT_USERPWD, 'signup:'.SIGNUP_PW);
26 echo curl_exec($cx);
27 ?>
This page took 0.02926 seconds and 5 git commands to generate.