Exemple #1
0
<?php

session_start();
include_once $_SERVER['DOCUMENT_ROOT'] . "/d2dconfig.php";
include_once CLASSFOLDER . "/user.php";
include_once CLASSFOLDER . "/common.php";
$user = new userclass();
$loginname = htmlspecialchars($_POST['username'], ENT_QUOTES);
$password = $_POST['password'];
$passwordencoded = md5($password);
$adminuser_id = '';
$result = $user->GetLoginDetails($loginname, $passwordencoded);
$adminuser_id = $result['id'];
$adminusername = $result['name'];
//if username exists
if (!empty($adminuser_id)) {
    //now set the session from here if needed
    $_SESSION['ADMINUSERID'] = $adminuser_id;
    $_SESSION['ADMINUSERNAME'] = $adminusername;
    $_SESSION['start'] = time();
    // taking now logged in time
    $_SESSION['expire'] = $_SESSION['start'] + 18 * 60;
    $user->createlog("User {$adminusername} Logged In");
    updateloginlog($adminuser_id, $user, commonclass::GetIP());
    echo 'yes';
} else {
    $_SESSION['ADMINUSERID'] = '';
    $_SESSION['ADMINUSERNAME'] = '';
    echo "<span class=\"label label-important\">Username / Password incorrect !</span>";
}
function updateloginlog($adminuser_id, $user, $ip)
  <?php 
if (!isset($_SESSION)) {
    session_start();
}
if (isset($_POST['postvalue'])) {
    $userid = $_POST['postvalue'];
}
include_once $_SERVER['DOCUMENT_ROOT'] . "/eventconfig.php";
include_once CLASSFOLDER . "/dbconnection.php";
include_once CLASSFOLDER . "/enums/userenums.php";
$typeofuser = new TypeOfUser();
$userstatus = new UserStatus();
include_once CLASSFOLDER . "/user.php";
$user = new userclass($dbconnection->dbconnector);
$userdata = !empty($userid) ? $user->getuserbyid($userid) : array();
$attachment = !empty($userid) ? $user->getUserAttachments($userid) : array();
$rolesResult = $user->internalDB->query("select  name,id from roles ");
?>
</style>
<div>
  
    <div class="li-view" style="display:<?php 
echo empty($userdata) ? 'none' : '';
?>
">
      <div class="box box-primary">
        <div class="box-header">
          <h3 class="box-title"><?php 
echo !empty($userdata['name']) ? $userdata['name'] : '';
?>
 Details</h3>
  <?php 
if (!isset($_SESSION)) {
    session_start();
}
if (isset($_POST['postvalue'])) {
    $userid = $_POST['postvalue'];
}
include_once $_SERVER['DOCUMENT_ROOT'] . "/d2dconfig.php";
include_once CLASSFOLDER . "/enums.php";
$typeofuser = new TypeOfUser();
$userstatus = new UserStatus();
include_once CLASSFOLDER . "/user.php";
$user = new userclass();
if (!empty($userid)) {
    $userdata = $user->getuserbyid($userid);
} else {
    $userid = 0;
    $userdata = array('login_name' => "", 'name' => "", 'email' => "", 'phone' => "", 'usertype' => "", 'status' => "", 'employeeid' => "", 'password' => "");
}
$assignedRoles = array();
?>
<style type="text/css">
  #update-userform .form-group label.error {
    color: #FB3A3A;
    display: inline-block;   
    text-align: left;    
}
</style>
  <form  id="update-userform" name="update-userform" action="" method="post" novalidate="novalidate">
  <input type="hidden" id="user_id" name="user_id" value="<?php 
echo !empty($userid) ? $userid : 0;
Exemple #4
0
<?php

if (!isset($_SESSION)) {
    session_start();
}
if (!isset($_SESSION['ADMINUSERID'])) {
    include_once "index.php";
    exit;
}
$userid = $_SESSION['ADMINUSERID'];
include_once $_SERVER['DOCUMENT_ROOT'] . "/eventconfig.php";
include_once CLASSFOLDER . "/dbconnection.php";
include_once CLASSFOLDER . "/user.php";
include_once CLASSFOLDER . "/common.php";
$user = new userclass($dbconnection->dbconnector);
$userdata = $user->getadminuserbyid($userid);
$userdata['profile_path'] = $user->getUserProfilePath($userid);
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>Express Affair</title>
        <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
        <link rel="stylesheet" href="../dist/css/jquery-ui.css" type="text/css" />
        <!-- Bootstrap 3.3.2 -->
        <link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <!-- Font Awesome Icons -->
        <link href="../font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
        <!-- Ionicons -->
        <link href="../ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet" type="text/css" />
<?php

include_once $_SERVER['DOCUMENT_ROOT'] . "/eventconfig.php";
include_once CLASSFOLDER . "/dbconnection.php";
include_once CLASSFOLDER . "/common.php";
include_once CLASSFOLDER . "/user.php";
$user = new userclass($dbconnection->dbconnector);
//ob_start("ob_gzhandler");
switch ($_POST['action']) {
    /*--------------------------------------------------------------*/
    case "saveuser":
        if (!empty($_POST['userdetails'])) {
            $params = array();
            parse_str($_POST['userdetails'], $params);
            $response = $user->saveuser($params);
            if (empty($response["Exception"])) {
                $response['Message'] = "User deatils updated successfully";
            }
            echo json_encode($response);
        } else {
            $response['Exception'] = "Please specify valid user details";
            echo json_encode($response);
        }
        break;
}
<?php

if (session_status() != PHP_SESSION_ACTIVE) {
    session_start();
}
include_once $_SERVER['DOCUMENT_ROOT'] . "/eventconfig.php";
include_once CLASSFOLDER . "/dbconnection.php";
include_once CLASSFOLDER . "/common.php";
include_once CLASSFOLDER . "/user.php";
$user = new userclass($dbconnection->dbconnector);
switch ($_POST['action']) {
    case "getintoaccount":
        if (!empty($_POST['logindetails'])) {
            $params = [];
            parse_str($_POST['logindetails'], $params);
            if (empty($params['loginid']) || empty($params['password'])) {
                echo 0;
                return;
            }
            $passwordencoded = md5($params['password']);
            $response = $user->GetCoordinatorLoginDetails($params['loginid'], $passwordencoded);
            if (!empty($response)) {
                $_SESSION['COORDINATORID'] = $response['id'];
                $_SESSION['start'] = time();
                // taking now logged in time
                $_SESSION['expire'] = $_SESSION['start'] + 1 * 60;
                echo $response['id'];
                break;
            }
            echo 0;
        } else {
Exemple #7
0
<?php

session_start();
include_once $_SERVER['DOCUMENT_ROOT'] . "/eventconfig.php";
include_once CLASSFOLDER . "/dbconnection.php";
include_once CLASSFOLDER . "/user.php";
include_once CLASSFOLDER . "/common.php";
$user = new userclass($dbconnection->dbconnector);
$loginname = htmlspecialchars($_POST['username'], ENT_QUOTES);
$password = $_POST['password'];
$passwordencoded = md5($password);
$adminuser_id = '';
$result = $user->GetLoginDetails($loginname, $passwordencoded);
$adminuser_id = $result['id'];
$adminusername = $result['name'];
//if username exists
if (!empty($adminuser_id)) {
    //now set the session from here if needed
    $_SESSION['ADMINUSERID'] = $adminuser_id;
    $_SESSION['start'] = time();
    // taking now logged in time
    $_SESSION['expire'] = $_SESSION['start'] + 18 * 60;
    $dbconnection->createlog("User " . $result['name'] . " Logged In");
    updateloginlog($adminuser_id, $user, commonclass::GetIP());
    echo 'yes';
} else {
    $_SESSION['ADMINUSERID'] = '';
    echo "<span class=\"label label-important\">Username / Password incorrect !</span>";
}
function updateloginlog($adminuser_id, $user, $ip)
{
<?php

if (session_status() != PHP_SESSION_ACTIVE) {
    session_start();
}
include_once $_SERVER['DOCUMENT_ROOT'] . "/eventconfig.php";
include_once CLASSFOLDER . "/dbconnection.php";
include_once CLASSFOLDER . "/common.php";
include_once CLASSFOLDER . "/user.php";
$user = new userclass($dbconnection->dbconnector);
$customer = new customerclass($dbconnection->dbconnector);
switch ($_POST['action']) {
    case "getintoaccount":
        if (!empty($_POST['logindetails'])) {
            $params = [];
            parse_str($_POST['logindetails'], $params);
            if (empty($params['email']) || empty($params['password'])) {
                echo 0;
                return;
            }
            $passwordencoded = md5($params['password']);
            $response = $user->GetCoordinatorLoginDetails($loginname, $passwordencoded);
            if (!empty($response)) {
                $_SESSION['COORDINATORID'] = $response['id'];
                $_SESSION['start'] = time();
                // taking now logged in time
                $_SESSION['expire'] = $_SESSION['start'] + 1 * 60;
                echo $response;
                break;
            }
            echo 0;
<?php

/*if(!isset($_SESSION['hpadminloginstatus']) || $_SESSION['hpadminloginstatus']!="HPAdminLoggedIn")
{
	include_once("login_again.php");
	exit();
}
$navactive="createuser";*/
//$access=$_SESSION['action_list'];
include_once $_SERVER['DOCUMENT_ROOT'] . "/eventconfig.php";
include_once CLASSFOLDER . "/dbconnection.php";
include_once CLASSFOLDER . "/user.php";
$user = new userclass($dbconnection->dbconnector);
$searchObject = isset($_POST['postvalue']) ? $_POST['postvalue'] : null;
if (!empty($searchObject)) {
    $rows = $searchObject['rows'];
    $page = $searchObject['page'];
} else {
    $rows = 20;
    $page = 1;
}
?>

<div id="gridcontent" class ="content">
	<div class="row">
		<div class="col-xs-12">
			<div class="box">
				<div class="box-header">
					<h3 class="box-title">User List</h3>
					<a title="Create User" class="btn btn-default pull-right btn-sm " href="javascript:void(0)" 
	onclick="getcontents('pages/configs/users/updateuser.php','content');" > <i class="glyphicon  glyphicon-plus-sign"></i>New User</a>