]>
Commit | Line | Data |
---|---|---|
b6aa88d2 JP |
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 | ||
877fbd1d | 18 | $cx = curl_init(SIGNUP_URL); |
b6aa88d2 JP |
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 | ?> |