2010-09-03 18:26:59 +00:00
|
|
|
#!/usr/bin/env php
|
2008-03-22 14:13:16 +00:00
|
|
|
<?php
|
|
|
|
|
2010-02-27 14:44:38 +00:00
|
|
|
include("includes/defaults.inc.php");
|
2008-03-22 14:13:16 +00:00
|
|
|
include("config.php");
|
|
|
|
include("includes/functions.php");
|
|
|
|
|
2010-03-06 01:10:05 +00:00
|
|
|
if (file_exists('html/includes/authentication/' . $config['auth_mechanism'] . '.inc.php'))
|
|
|
|
{
|
|
|
|
include('html/includes/authentication/' . $config['auth_mechanism'] . '.inc.php');
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-11-22 22:06:37 +00:00
|
|
|
echo("ERROR: no valid auth_mechanism defined.\n");
|
2010-03-06 01:10:05 +00:00
|
|
|
exit();
|
2011-03-17 11:12:32 +00:00
|
|
|
}
|
|
|
|
|
2010-03-06 01:10:05 +00:00
|
|
|
if (auth_usermanagement())
|
|
|
|
{
|
2011-03-16 09:29:46 +00:00
|
|
|
if ($argv[1] && $argv[2] && $argv[3])
|
2010-03-06 01:10:05 +00:00
|
|
|
{
|
2011-03-14 18:53:48 +00:00
|
|
|
if (adduser($argv[1],$argv[2],$argv[3],$argv[4]))
|
2010-03-06 01:10:05 +00:00
|
|
|
{
|
|
|
|
echo("User ".$argv[1]." added successfully\n");
|
|
|
|
}
|
2011-03-16 09:29:46 +00:00
|
|
|
}
|
|
|
|
else
|
2010-03-06 01:10:05 +00:00
|
|
|
{
|
|
|
|
echo("Add User Tool\nUsage: ./adduser.php <username> <password> <level 1-10> [email]\n");
|
2011-03-16 09:29:46 +00:00
|
|
|
}
|
2010-03-06 01:10:05 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-11-20 14:04:07 +00:00
|
|
|
echo("Auth module does not allow adding users!\n");
|
2010-03-06 01:10:05 +00:00
|
|
|
}
|
2008-03-22 14:13:16 +00:00
|
|
|
|
2011-03-17 11:12:32 +00:00
|
|
|
?>
|