* Time: 11:40 AM */ $minUserLevel = 1; $cfgProgDir = '../security/'; include $cfgProgDir . "secure.php"; include 'ManageDatabase.php'; require 'EntryCheck.php'; $TITLE = 'New Email Account'; include_once INC_PATH . 'header.php'; if (isset($_SERVER['REQUEST_METHOD'])) { if ($_SERVER['REQUEST_METHOD'] == 'POST') { $email = $_POST['email']; $password = $_POST['password']; $re_password = $_POST['re_password']; $checks = new EntryCheck(); if (!$checks->CheckEmail($email) || !$checks->CheckForSamePassword($password, $re_password)) { ?> <script>ShowAlert('#FormAlert');</script> <?php } else { if ($conn = new ManageDatabase()) { if ($conn->InsertToDatabase($email, $password)) { ?> <script>ShowAlert('#FormInfo');</script> <?php } else { ?> <script>ShowAlert('#DatabaseError');</script> <?php } $conn->Close();
*/ $minUserLevel = 3; $cfgProgDir = '../security/'; include $cfgProgDir . "secure.php"; include 'ManageUserDatabase.php'; require 'EntryCheck.php'; $TITLE = 'Edit User'; include_once INC_PATH . 'header.php'; if (isset($_SERVER['REQUEST_METHOD'])) { if ($_SERVER['REQUEST_METHOD'] == 'POST') { $email = $_POST['email']; $password = $_POST['password']; $re_password = $_POST['re_password']; $level = $_POST['level']; $checks = new EntryCheck(); if (!$checks->CheckEmail($email) || !$checks->CheckForSamePassword($password, $re_password) || !$checks->CheckUserAccessLevel($level)) { ?> <script>ShowAlert('#FormAlert');</script> <?php } else { if ($conn = new ManageUserDatabase()) { $record_id = $conn->CheckForExistingUser($email); if ($record_id > 0) { if ($conn->UpdateUser($record_id, $password, $level)) { ?> <script>ShowAlert('#FormInfo');</script> <?php } else { ?> <script>ShowAlert('#UnSuccess');</script> <?php