Example #1
0
 /**
  * @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;
     }
 }
Example #2
0
<?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">&nbsp;</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">&nbsp;&nbsp;&nbsp;&nbsp; user edit</div><br>
Example #3
0
<?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">&nbsp;</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">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Manage users</div><br>
                <div align="left"><a href="addUser.php"><img src="img/adddom0.png" border="0" />&nbsp;add user</a></div>
                <?php $userManager->listUsers(); ?>
            </div>
        </div>
        <div id="footer"><?php echo "$footer"; ?></div>
Example #4
0
<?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.";
}
Example #5
0
<?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.";
}
Example #6
0
<?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.";
}