-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadduser.php
41 lines (35 loc) · 1016 Bytes
/
adduser.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
// debug
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 'On');
// this needs to happen before any includes
define('_APP', true);
// class includes
require 'inc/Config.class.php';
require 'inc/Logger.class.php';
require 'inc/RequestRouter.class.php';
// source the configuration
require 'conf.php';
// set up the logger
$logger = new Logger($config->logger_level, $config->logger_location);
$logger->emit($logger::LOGGER_INFO, __CLASS__, __FUNCTION__, 'Configuration read');
// open the database connection
require 'inc/DatabaseHandler.class.php';
$db = new DatabaseHandler(
$config->database_user,
$config->database_password,
$config->database_name,
$config->database_host,
$config->database_engine
);
$db->connect();
// add an admin user
require 'inc/AAC.class.php';
$aac = new AAC();
$res = $aac->create_user('admin', 'admin1234', '[email protected]', $aac::ACCESS_LEVEL_SYSOP);
if(!$res) {
echo $aac->get_error();
} else {
print_r($aac);
}
?>