/** * @return put return description here.. * @param param : parameter passed to function * @desc authenticate : put function description here ... */ function authenticate() { $thisUsersManager = new usersManager(); $searchItems[] = new searchItem(FIELD_USERS_LOGIN, $this->getLogin()); $searchItems[] = new searchItem(FIELD_USERS_PASSWORD, $this->getPassword()); $dbResultsInfo = $thisUsersManager->searchUsersByFieldValue($searchItems); $result = $dbResultsInfo->getResultsArray(); if ($result == "" || count($result) == 0) { $_SESSION['auth'] = false; $_SESSION['firstName'] = ""; $_SESSION['lastName'] = ""; $_SESSION['userId'] = ""; return false; } else { $thisUserInfo = $result[0]; $_SESSION['auth'] = true; $_SESSION['firstName'] = $thisUserInfo->getFirstName(); $_SESSION['lastName'] = $thisUserInfo->getLastName(); $_SESSION['userId'] = $thisUserInfo->getId(); return true; } }
<?php session_start(); if (isset($_SESSION['xo']) AND ($_SESSION['xo_idGroup'] == 1)) { // Admin Group include 'inc/config.php'; include 'class/db.php'; include 'class/groupsManager.php'; include 'class/usersManager.php'; $groups = new groupsManager(); $usersManager = new usersManager(); $info = $usersManager->userInfo($_GET['id']); ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title><?= $title ?></title> <link rel="stylesheet" type="text/css" href="css/style.css"> </head> <body> <div id="topBar"> </div> <div id="container"> <div id="left"> <img src="img/menu.png" />Menu<br> <?php include 'menu.php'; ?> </div> <form action="edit_user.php" method="POST"> <input type="hidden" value="<?php echo $_GET['id']; ?>" name="user[idUser]" /> <div id="right"> <div id="right_logo"><img src="img/logo.png" alt="logo" /></div> <div align="center">inventory of your xen machines in real time...</div> <div class="titleBarAdd"> user edit</div><br>
<?php session_start(); if (isset($_SESSION['xo']) AND ($_SESSION['xo_idGroup'] == 1)) { // Admin Group include 'inc/config.php'; include 'class/db.php'; include 'class/usersManager.php'; $userManager = new usersManager(); ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title><?=$title?></title> <link rel="stylesheet" type="text/css" href="css/style.css"> </head> <body> <div id="topBar"> </div> <div id="container"> <div id="left"> <img src="img/menu.png" />Menu<br> <?php include 'menu.php'; ?> </div> <div id="right"> <div id="right_logo"><img src="img/logo.png" alt="logo" /></div> <div align="center">inventory of your xen machines in real time...</div> <div class="titleBarUsers"> Manage users</div><br> <div align="left"><a href="addUser.php"><img src="img/adddom0.png" border="0" /> add user</a></div> <?php $userManager->listUsers(); ?> </div> </div> <div id="footer"><?php echo "$footer"; ?></div>
<?php session_start(); if (isset($_SESSION['xo']) and $_SESSION['xo_idGroup'] == 1) { // Admin Group include 'class/db.php'; include 'class/usersManager.php'; $userManager = new usersManager(); $userManager->removeUser($_GET["id"]); } else { echo "Restricted area."; }
<?php session_start(); if (isset($_SESSION['xo']) and $_SESSION['xo_idGroup'] == 1) { // Admin Group include 'class/db.php'; include 'class/users.php'; include 'class/usersManager.php'; $userObj = new Users($_POST["user"]); $userObj->setId($_POST["user"]["idUser"]); $userManager = new usersManager(); $userManager->editUser($userObj); } else { echo "Restricted area."; }
<?php session_start(); if (isset($_SESSION['xo']) and $_SESSION['xo_idGroup'] == 1) { // Admin Group include 'class/db.php'; include 'class/users.php'; include 'class/usersManager.php'; $userObj = new Users($_POST["user"]); $userManager = new usersManager(); $userManager->insertUser($userObj); } else { echo "Restricted area."; }