123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- <?php
- //namespace app\models;
- require_once "doctrine/bootstrap.php";
- include 'CheckPoint.php';
- include 'CheckPointType.php';
- use CheckPoints\CheckPoint;
- use CheckPointTypes\CheckPointType;
- header("Expires: 0");
- header("Content-Type: text/html; charset=utf-8");
- session_start();
-
- if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > 6000)) {
- // last request was more than 30 minutes ago
- session_unset(); // unset $_SESSION variable for the run-time
- session_destroy(); // destroy session data in storage
- }
- $_SESSION['LAST_ACTIVITY'] = time(); // update last activity time stamp
- $add = 'Login Area';
- foreach (array_keys($_REQUEST) as $var) {
- ${$var} = $_REQUEST[$var];
- }
- if ($act == "exit")
- {
- session_unset();
- session_destroy();
- session_start();
- }
- if ($_SESSION['cmdlevel'])
- $cmdlevel = $_SESSION['cmdlevel'];
- if ($_SESSION['hostid'])
- $agent_id = $_SESSION['hostid'];
- if ($_SESSION['add'])
- $add = $_SESSION['add'];
- if ($_SESSION['id'])
- $id = $_SESSION['id'];
- if ($_SESSION['login'])
- $login = $_SESSION['login'];
- if ($_SESSION['name'])
- $name = $_SESSION['name'];
- foreach (array_keys($_SESSION) as $var) {
- ${$var} = $_SESSION[$var];
- }
- include 'functions.php';
- include 'auth.php';
- $logged_me_in_successfully234 = 0;
- $incl = '';
- if (!$_SESSION['pass'] && !$_SESSION['login'])
- {
- $table = 'accounts';
- $result=mysqli_query($link, "SELECT id, login, name, cmdlevel FROM $table WHERE login='".$login."' AND password='".md5($pass)."'");
- $res1 = mysqli_fetch_array($result);
- $cmdlevel = $res1['cmdlevel'];
- $name = $res1['name'];
- $id = $res1['id'];
- if ($cmdlevel == '10')
- {
- $add = "Head Administrator";
- }
- else if ($cmdlevel == '1')
- {
- $add = "Company Administrator";
- }
- else if ($cmdlevel == '2')
- {
- $add = "Company Operator";
- }
- if (mysqli_num_rows($result))
- {
- $_SESSION['pass']=$pass;
- $_SESSION['login']=$login;
- $_SESSION['name']=$name;
- $_SESSION['add']=$add;
- $_SESSION['cmdlevel']=$cmdlevel;
- $_SESSION['id']=$id;
- $logged_me_in_successfully234 = 1;
- }
- }
- else
- $logged_me_in_successfully234 = 1;
- $query = mysqli_query($link, "update accounts set last_seen_web =NOW() where id=".$id);
- $getincl = GetInclude($act, intval($cmdlevel));
- $incl = $getincl[0];
- $accnum = $getincl[1];
- ?>
- <!--<div style="min-width: 960px; height: 100%;">-->
- <?php
- $mycompany = getCompanyByAccount($id);
- if (!isset($companyID))
- {
- // echo "ses com ".$_SESSION['company'];
- if ($_SESSION['company'])
- $companyID = $_SESSION['company'];
- else
- {
- $companyID = $mycompany[0];
- $_SESSION['company'] = $companyID;
- }
- }
- else
- {
- $_SESSION['company'] = $companyID;
- }
- $companyname = getCompanyByID($companyID)[1];
- $logged_me_in_successfully234 = 1;
- if ((int)$_GET['appMykey'] == 123465) {$logged_me_in_successfully234 = 1;}
- $companyID = 3;
- $action_num = $_POST['action'];
- $activeid = $_POST['activeid'];
- if(StartProject($action_num, $activeid)) {
- TasksAssign('', true, $assign_id);
- }
-
- ?>
|