// Load AMS Library if ($continue) { try { require_once $AMS_LIB . '/libinclude.php'; } catch (Exception $e) { printalert("danger", "Failed to include AMS <em>libinclude.php</em>"); $continue = false; } } // Create AMS Admin user if ($continue) { $hashpass = crypt($_POST["amsAdminPassword"], Users::generateSALT()); $params = array('Login' => $_POST["amsAdminUsername"], 'Password' => $hashpass, 'Email' => "localhost@localhost"); try { $user_id = WebUsers::createWebuser($params['Login'], $params['Password'], $params['Email']); $result = Webusers::createUser($params, $user_id); Users::createPermissions(array($params['Login'])); $dbl = new DBLayer("lib"); $dbl->execute("UPDATE ticket_user SET Permission = 3 WHERE TUserId = :user_id", array('user_id' => $user_id)); printalert("success", "AMS Admin account <em>" . htmlentities($_POST["amsAdminUsername"]) . "</em> created"); } catch (PDOException $e) { printalert("danger", "Failed to create AMS Admin account"); $continue = false; } } } if ($roleDomain) { // TODO: Register the domain with the nel database etc } if ($continue && $roleService) { if (file_put_contents("role_service", "1")) {