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