$newRole = valString($_POST['Role'], true); $newPhone = valPhone($_POST['phone'], true); $newEmail = valEmail($_POST['email'], true); $newDepartment = valString($_POST['department'], true); $newUserName = valString($_POST['username'], true); $newPassword = valString($_POST['pass'], true); $newUser = new userClass($newfName, $newlName, $newRole, $newPhone, $newEmail, $newDepartment, $newUserName, $newPassword); $newUser->createUser(); header("Location: /JGWentworth/View/User.php"); } // end first if if (isset($_POST['EditUser'])) { $fName = valString($_POST['fName'], true); $lName = valString($_POST['lName'], true); $role = valString($_POST['Role'], true); $phone = valPhone($_POST['phone'], true); $email = valEmail($_POST['email'], true); $department = valString($_POST['department'], true); $userName = valString($_POST['username'], true); $password = valString($_POST['pass'], true); $userID = $_POST['editID']; $updateUser = new userClass($fName, $lName, $role, $phone, $email, $department, $userName, $password, $userID); $updateUser->updateUser(); header("Location: /JGWentworth/View/User.php"); } // end second if if (isset($_GET['delete'])) { $deleteID = urldecode(base64_decode($_GET['delete'])); userClass::deleteUser($deleteID); header("Location: /JGWentworth/View/User.php"); }
<?php include "./class/template.php"; include "./class/DB_Class.php"; include "./class/userClass.php"; $user = new userClass(); $user->sessionCheck(); $template = new template_class(); ?> <!DOCTYPE html> <html lang="lv"> <head> <?php $template->getHead(); ?> <title>Par autoru</title> </head> <body> <section class = "container-fluid"> <section class = "row main-menu"> <?php $template->getMenu(); ?> </section> <section class = "row main-content"> <aside class = "col-md-3"> <h1 class = "hide">Foto</h1> <a href="images/mypic2.jpg" rel="lightbox[myself]" title="Nakts pastaiga pa Vecrīgu"><img id="my-photo" class="img-responsive img-thumbnail" src="images/mypic2.jpg"></a>
<?php include 'userClass.php'; include 'databaseClass.php'; if (isset($_REQUEST["validar"]) && $_REQUEST["validar"] == true) { $user = new userClass(); $user->setName($_POST["name"]); $user->setAge($_POST["age"]); $user->setGender($_POST["gender"]); $user->setLogin($_POST["login"]); $user->setPass($_POST["pass"]); $database = new databaseClass(); $database->insert($user); } ?> <html> <head> <title></title> </head> <body> Seus dados foram salvos com sucesso! </form> </body>
$_SESSION = array('user' => array('id' => 1, 'name' => 'admin', 'level' => 1)); include MODULES_DIR . 'install.mod.php'; exit; } // global SQL instance to be used by modules $_sql = new sqlClass(); $_sql->connect($sqlInfo); // we need to be connected to a database if (TRUE != $_sql->connected) { die; } // initialize a session for modules $_session = new sessionsClass(); session_start(); // initialize a user instance for modules $_user = new userClass(); // populate session if necessary if (!isset($_SESSION['user']['id'])) { $_SESSION['user'] = $_user->get(); } // assign anonymous privileges if (defined('ALLOW_ANONYMOUS') && @ALLOW_ANONYMOUS == 1) { $USER_LEVELS_ARRAY[0]['name'] = "anonymous"; $USER_LEVELS_ARRAY[0]['privileges'] = defined('ANON_PRIVS') ? @ANON_PRIVS : 0; } /* this is basically where stuff starts happening. any content to be rendered by the site will be loaded from modules, which are all accessed through the engine. we want to make sure to prevent any kind of directory traversal attacks, buffer overflows, or what have you by limiting the characters allowed for module names. if the site is accessed without referencing a module, or a module name is determined to be illegal or nonexistent, the default module page will be loaded, as determined by $module */ $module = 'main';
<?php include "./class/template.php"; include "./class/DB_Class.php"; include "./class/userClass.php"; $user = new userClass(); $user->sessionCheck(); $template = new template_class(); ?> <!DOCTYPE html> <html lang="lv"> <head> <?php $template->getHead(); ?> <title>Saules sistēma</title> </head> <body> <section class = "container-fluid"> <section class = "row main-menu"> <?php $template->getMenu(); ?> </section> <section class = "row main-content"> <aside class = "col-md-3"> <?php if ($user->getSessionStatus() == true) {