]> andersk Git - sql-web.git/blame - batch/signup-client.php
lighttpd remote signups
[sql-web.git] / batch / signup-client.php
CommitLineData
b6aa88d2
JP
1#!/usr/bin/php -q
2<?php
3
4require_once(dirname(__FILE__).'/../mitsql.cfg.php');
5require_once('mitsql.lib.php');
6
7require_once('batch.inc.php');
8
9if (!defined('SIGNUP_PW') || strlen(SIGNUP_PW)==0) exit;
10if (!isset($argv) || count($argv) < 4) exit;
11$myUsername = $argv[1];
12$myUID = $argv[3];
13if ($myUID<100) exit('bad UID');
14
15if (!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');
20curl_setopt($cx, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
21curl_setopt($cx, CURLOPT_RETURNTRANSFER, true);
22curl_setopt($cx, CURLOPT_SSL_VERIFYHOST, false);
23curl_setopt($cx, CURLOPT_SSL_VERIFYPEER, false);
24curl_setopt($cx, CURLOPT_POST, true);
25curl_setopt($cx, CURLOPT_POSTFIELDS, 'u='.$myUsername);
26curl_setopt($cx, CURLOPT_USERPWD, 'signup:'.SIGNUP_PW);
27echo curl_exec($cx);
28?>
This page took 0.07207 seconds and 5 git commands to generate.