This commit is contained in:
@@ -1,28 +1,52 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2018 josh.north
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
//ini_set('session.gc_maxlifetime', 24*60*60); // MIN SESSION
|
||||||
|
//ini_set('session.gc_probability', 1); // GC RATES
|
||||||
|
//ini_set('session.gc_divisor', 100); // TIMES
|
||||||
|
//session_save_path('.tmp'); // TEMP
|
||||||
|
//session_start(); // START
|
||||||
require_once __DIR__ . '/../autoload.php'; // AUTOLOAD
|
require_once __DIR__ . '/../autoload.php'; // AUTOLOAD
|
||||||
$StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // CLASSES
|
$StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // DEFAULT CLASSES
|
||||||
$SiteInfo = new \App\LobbySIO\Database\SiteInfo();
|
$SiteInfo = new \App\LobbySIO\Database\SiteInfo();
|
||||||
$Users = new \App\LobbySIO\Database\Users();
|
$Users = new \App\LobbySIO\Database\Users();
|
||||||
$Translate = new \App\LobbySIO\Language\Translate($app_disp_lang);
|
if (isset($_SESSION['user_id'])) { // LOGGED IN? GET USER OBJECT
|
||||||
$transLang = $Translate->userLanguage(); // SETUP TRANSLATOR
|
$session_user = $Users->getUserInfo($_SESSION['user_id'], "1", "0"); }
|
||||||
|
if (isset($session_user)) { // GET UID OR SET TO KIOSK
|
||||||
|
$uid = $session_user["0"]["users_id"];} else { $uid = "2"; }
|
||||||
|
$app_disp_lang = filter_input(INPUT_COOKIE, 'app_disp_lang'); // SETUP LANGUAGE
|
||||||
|
if(!isset($app_disp_lang)) {
|
||||||
|
$app_disp_lang=$StaticFunctions->getDefaultLanguage(); }
|
||||||
|
$siteidcookie = filter_input(INPUT_COOKIE, 'app_site'); // SETUP SITE
|
||||||
|
foreach($SiteInfo->getSite("0", $uid, "0", "0") as $arr) {
|
||||||
|
$lookup_array[$arr['sites_id']]=1; }
|
||||||
|
if(isset($lookup_array[$siteidcookie])) {
|
||||||
|
$siteid = $siteidcookie; } else { $siteid = "1"; }
|
||||||
|
if(!isset($siteid)) { $siteid="1"; }
|
||||||
|
$Translate = new \App\LobbySIO\Language\Translate($app_disp_lang); // SETUP TRANSLATOR
|
||||||
|
$transLang = $Translate->userLanguage();
|
||||||
ob_start(); // OUTPUT BUFFER
|
ob_start(); // OUTPUT BUFFER
|
||||||
if (isset($_SESSION['user_id'])): $session_user = $Users->getUserInfo($_SESSION['user_id'], "1", "0"); endif; // SEE IF WE ARE LOGGED IN AND PULL NAME IF SO
|
|
||||||
$session_status = $StaticFunctions->getSessionStatus(); // SET A STATUS
|
$session_status = $StaticFunctions->getSessionStatus(); // SET A STATUS
|
||||||
$defaulttimezone = $StaticFunctions->getDefaultTZ();
|
$defaulttimezone = $StaticFunctions->getDefaultTZ();
|
||||||
date_default_timezone_set('UTC'); // DEFAULT TO UTC
|
date_default_timezone_set('UTC'); // DEFAULT TO UTC
|
||||||
date_default_timezone_set($defaulttimezone); // UPDATE TO DEFAULT APP SETTING
|
date_default_timezone_set($defaulttimezone); // UPDATE TO DEFAULT APP SETTING
|
||||||
if(!isset($_COOKIE['app_disp_lang'])) { // IF NO LANGUAGE COOKIE, SET LANG TO APP DEFAULT, OTHERWISE USE COOKIE LANGUAGE
|
$timezone = $SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_timezone"]; // GET TIMEZONE FROM SITE ID
|
||||||
$app_disp_lang=$StaticFunctions->getDefaultLanguage();
|
|
||||||
} else {
|
|
||||||
$app_disp_lang=$_COOKIE['app_disp_lang'];
|
|
||||||
};
|
|
||||||
if(!isset($_COOKIE['app_site'])) { // LIKE LANGUAGE, DEFAULT IF NO COOKIE
|
|
||||||
$siteid="NOT SET"; // AND TIMEZONE AGAIN
|
|
||||||
$timezone = "UTC"; // BUT THE MODAL SHOULD POP AND BLOCK ANYWAY
|
|
||||||
} else {
|
|
||||||
$siteid=$_COOKIE['app_site'];
|
|
||||||
$timezone = $SiteInfo->getSiteInfo($siteid)[0]["sites_timezone"];
|
|
||||||
};
|
|
||||||
$timeplus = new DateTime($StaticFunctions->getUTC(), new DateTimeZone('UTC')); // DUMB WAY TO CALCULATE SOME TIMES
|
$timeplus = new DateTime($StaticFunctions->getUTC(), new DateTimeZone('UTC')); // DUMB WAY TO CALCULATE SOME TIMES
|
||||||
$timeplus->setTimezone(new DateTimeZone("$timezone"));
|
$timeplus->setTimezone(new DateTimeZone("$timezone"));
|
||||||
$timenow = $timeplus->format('Y-m-d H:i:s');
|
$timenow = $timeplus->format('Y-m-d H:i:s');
|
||||||
@@ -97,19 +121,18 @@
|
|||||||
<li class="nav-item<?php if ($app_current_pagename==$transLang['SIGNOUT']): echo " active"; endif; ?>"><a class="nav-link" href="signout.php"><i class="fas fa-sign-out-alt"></i> <?php echo $transLang['SIGNOUT']; ?></a></li>
|
<li class="nav-item<?php if ($app_current_pagename==$transLang['SIGNOUT']): echo " active"; endif; ?>"><a class="nav-link" href="signout.php"><i class="fas fa-sign-out-alt"></i> <?php echo $transLang['SIGNOUT']; ?></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="navbar-nav mr-sm-2">
|
<ul class="navbar-nav mr-sm-2">
|
||||||
<li class="nav-item<?php if ($app_current_pagename==$transLang['LOGIN']): echo " active"; endif; ?>"><a class="nav-link" href="login.php"><i class="fas fa-cogs"></i> <?php echo $transLang['LOGIN']; ?></a></li>
|
<li class="nav-item<?php if ($app_current_pagename==$transLang['LOGIN']): echo " active"; endif; ?>"><a class="nav-link btn btn-sm btn-outline-success" href="login.php"><i class="fas fa-cogs"></i> </a></li>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ($session_status == true): ?>
|
<?php if ($session_status == true): ?>
|
||||||
<!-- MENU FOR ALL LOGGED IN - BOTTOM END -->
|
<!-- MENU FOR ALL LOGGED IN - BOTTOM END -->
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="navbar-nav mr-sm-2">
|
<ul class="navbar-nav mr-sm-2">
|
||||||
<li class="nav-item<?php if ($app_current_pagename==$transLang['LOGOUT']): echo " active"; endif; ?>"><a class="nav-link" href="logout.php"><i class="fas fa-ban"></i> <?php echo $transLang['LOGOUT']; ?></a></li>
|
<li class="nav-item"><a class="nav-link<?php $sname=$SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_name"]; if($sname=="NOSITE") { echo " btn btn-sm btn-outline-warning"; } else { echo " btn btn-sm btn-outline-secondary"; }; ?>" href="#" data-toggle="modal" data-target="#sitetimeModal"><i class="fas fa-map-marker-alt"></i> <?php if ($sname=="NOSITE") {echo $transLang['NOSITE'];} else { echo $sname; } ?></a></li>
|
||||||
|
<li class="nav-item<?php if ($app_current_pagename==$transLang['LOGOUT']): echo " active"; endif; ?>"><a class="nav-link btn btn-sm btn-outline-danger" href="logout.php"><i class="fas fa-ban"></i> <?php echo $transLang['LOGOUT']; ?></a></li>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</ul>
|
|
||||||
<ul class="form-control-sm">
|
|
||||||
<form action="changelang.php" method="post" name="changelang" class="changelang">
|
<form action="changelang.php" method="post" name="changelang" class="changelang">
|
||||||
<div class="input-group mb-3">
|
<div class="input-group mb-3">
|
||||||
<select class="custom-select" id="app_disp_lang" aria-label="Language" name="app_disp_lang">
|
<select class="form-control custom-select btn btn-outline-secondary" id="app_disp_lang" aria-label="Language" name="app_disp_lang">
|
||||||
<?php foreach(glob('src/Language/*.ini') as $file){
|
<?php foreach(glob('src/Language/*.ini') as $file){
|
||||||
if(!is_dir($file)) { $filename=basename(preg_replace('/\.[^.]+$/','',preg_replace('/\.[^.]+$/','',$file))); }; ?>
|
if(!is_dir($file)) { $filename=basename(preg_replace('/\.[^.]+$/','',preg_replace('/\.[^.]+$/','',$file))); }; ?>
|
||||||
<option value="<?php echo $filename; ?>"<?php if ($filename==$app_disp_lang) { echo " selected"; }; ?>><?php echo strtoupper($filename); ?></option>
|
<option value="<?php echo $filename; ?>"<?php if ($filename==$app_disp_lang) { echo " selected"; }; ?>><?php echo strtoupper($filename); ?></option>
|
||||||
@@ -127,7 +150,7 @@
|
|||||||
<div class="modal-dialog" role="document">
|
<div class="modal-dialog" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title" id="Site"><?php echo $transLang['CHOOSE']; ?> <?php echo $transLang['SITE']; ?></h5>
|
<h5 class="modal-title" id="Site"><i class="fas fa-map-marker-alt"></i> <?php echo $transLang['SITE']; ?></h5>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -136,12 +159,12 @@
|
|||||||
<form class="form-inline my-2 my-lg-0" action="changesite.php" method="post">
|
<form class="form-inline my-2 my-lg-0" action="changesite.php" method="post">
|
||||||
<div class="input-group mb-3">
|
<div class="input-group mb-3">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<button class="btn btn-outline-secondary" type="button"><?php echo $transLang['SITE']; ?></button>
|
<button class="btn btn-outline-secondary" type="button"><?php echo $transLang['CHOOSE']; ?></button>
|
||||||
</div>
|
</div>
|
||||||
<select class="custom-select" id="site" aria-label="Site" name="site">
|
<select class="custom-select" id="site" aria-label="Site" name="site" required>
|
||||||
<option selected><?php echo $transLang['CHOOSE']; ?></option>
|
<option value="<?php if (isset($siteid)) { echo $SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_name"]; } else { echo ""; } ?>" selected><?php if (isset($siteid)) { if ($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_name"]=="NOSITE") {echo $transLang['NOSITE'];} else { echo $SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_name"]; } } else { echo "- - -"; } ?></option>
|
||||||
<?php foreach($SiteInfo->getSiteInfo("%") as $row): ?>
|
<?php foreach($SiteInfo->getSite("0", $uid, "0", "0") as $row): ?>
|
||||||
<option value="<?php echo $row['sites_id']; ?>"><?php echo $row['sites_name']; ?></option>
|
<option value="<?php echo $row['sites_id']; ?>"><?php if ($row['sites_name']=="NOSITE") {echo $transLang['NOSITE'];} else { echo $row['sites_name']; } ?></option>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
<input class="btn" type="submit" value="<?php echo $transLang['SAVE']; ?>" />
|
<input class="btn" type="submit" value="<?php echo $transLang['SAVE']; ?>" />
|
||||||
|
|||||||
39
index.php
39
index.php
@@ -23,19 +23,31 @@
|
|||||||
session_save_path('.tmp'); // TEMP
|
session_save_path('.tmp'); // TEMP
|
||||||
session_start(); // START
|
session_start(); // START
|
||||||
require_once __DIR__ . '/autoload.php'; // AUTOLOAD
|
require_once __DIR__ . '/autoload.php'; // AUTOLOAD
|
||||||
$StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // CLASSES
|
$StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // DEFAULT CLASSES
|
||||||
$Users = new \App\LobbySIO\Database\Users();
|
|
||||||
$SiteInfo = new \App\LobbySIO\Database\SiteInfo();
|
$SiteInfo = new \App\LobbySIO\Database\SiteInfo();
|
||||||
$VisitTypeInfo = new \App\LobbySIO\Database\VisitTypeInfo();
|
$Users = new \App\LobbySIO\Database\Users();
|
||||||
|
if (isset($_SESSION['user_id'])) { // LOGGED IN? GET USER OBJECT
|
||||||
|
$session_user = $Users->getUserInfo($_SESSION['user_id'], "1", "0"); }
|
||||||
|
if (isset($session_user)) { // GET UID OR SET TO KIOSK
|
||||||
|
$uid = $session_user["0"]["users_id"];} else { $uid = "2"; }
|
||||||
|
$app_disp_lang = filter_input(INPUT_COOKIE, 'app_disp_lang'); // SETUP LANGUAGE
|
||||||
|
if(!isset($app_disp_lang)) {
|
||||||
|
$app_disp_lang=$StaticFunctions->getDefaultLanguage(); }
|
||||||
|
$siteidcookie = filter_input(INPUT_COOKIE, 'app_site'); // SETUP SITE
|
||||||
|
foreach($SiteInfo->getSite("0", $uid, "0", "0") as $arr) {
|
||||||
|
$lookup_array[$arr['sites_id']]=1; }
|
||||||
|
if(isset($lookup_array[$siteidcookie])) {
|
||||||
|
$siteid = $siteidcookie; } else { $siteid = "1"; }
|
||||||
|
if(!isset($siteid)) { $siteid="1"; }
|
||||||
|
$Translate = new \App\LobbySIO\Language\Translate($app_disp_lang); // SETUP TRANSLATOR
|
||||||
|
$transLang = $Translate->userLanguage();
|
||||||
|
$VisitTypeInfo = new \App\LobbySIO\Database\VisitTypeInfo(); // ADDITIONAL CLASSES
|
||||||
$IDTypeInfo = new \App\LobbySIO\Database\IDTypeInfo();
|
$IDTypeInfo = new \App\LobbySIO\Database\IDTypeInfo();
|
||||||
$VisitInfo = new \App\LobbySIO\Database\VisitInfo();
|
$VisitInfo = new \App\LobbySIO\Database\VisitInfo();
|
||||||
$VisitActions = new \App\LobbySIO\Database\VisitActions();
|
$VisitActions = new \App\LobbySIO\Database\VisitActions();
|
||||||
if(!isset($_COOKIE['app_disp_lang'])) { $app_disp_lang = $StaticFunctions->getDefaultLanguage(); } else { $app_disp_lang = $_COOKIE['app_disp_lang']; };
|
$app_current_pagename = $transLang['HOME']; // PAGE SETUP
|
||||||
$Translate = new \App\LobbySIO\Language\Translate($app_disp_lang);
|
$app_current_pageicon = '<i class="fas fa-home"></i> ';
|
||||||
$transLang = $Translate->userLanguage(); // SETUP TRANSLATOR
|
require_once("inc/header.inc.php");
|
||||||
$app_current_pagename = $transLang['HOME']; // PAGE FUNCTION
|
|
||||||
$app_current_pageicon = '<i class="fas fa-home"></i> '; // PAGE ICON
|
|
||||||
require_once("inc/header.inc.php"); // SHOW HEADER
|
|
||||||
if ($StaticFunctions->getSessionStatus() == false) { // CHECK STATUS
|
if ($StaticFunctions->getSessionStatus() == false) { // CHECK STATUS
|
||||||
?>
|
?>
|
||||||
<!-- GUEST CONTENT START -->
|
<!-- GUEST CONTENT START -->
|
||||||
@@ -129,7 +141,6 @@
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
@@ -171,12 +182,14 @@
|
|||||||
<input class="form-check-input" type="checkbox" value="1" id="id_checked" name="id_checked" disabled>
|
<input class="form-check-input" type="checkbox" value="1" id="id_checked" name="id_checked" disabled>
|
||||||
<?php }; ?>
|
<?php }; ?>
|
||||||
<label class="form-check-label" for="id_checked"><?php echo $transLang['ID_CHECKED']; ?></label><br>
|
<label class="form-check-label" for="id_checked"><?php echo $transLang['ID_CHECKED']; ?></label><br>
|
||||||
<?php if($row['visits_citizen']==1) { ?>
|
<?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "US") { if($row['visits_citizen']==1) { ?>
|
||||||
<input class="form-check-input" type="checkbox" value="1" id="citizen" name="citizen" checked disabled>
|
<input class="form-check-input" type="checkbox" value="1" id="citizen" name="citizen" checked disabled>
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<input class="form-check-input" type="checkbox" value="1" id="citizen" name="citizen" disabled>
|
<input class="form-check-input" type="checkbox" value="1" id="citizen" name="citizen" disabled>
|
||||||
<?php }; ?>
|
<?php }; ?>
|
||||||
<label class="form-check-label" for="citizen"><?php echo $transLang['CITIZEN']; ?></label></td>
|
<label class="form-check-label" for="citizen"><?php echo $transLang['CITIZEN']; ?></label>
|
||||||
|
<?php }; ?>
|
||||||
|
</td>
|
||||||
<td><input type="text" id="badge" name="badge" class="form-control" autofocus disabled value="<?php echo $row['visits_badge']; ?>"> <input type="text" id="initials" name="initials" class="form-control" autofocus disabled value="<?php echo $row['visits_initials']; ?>"></td>
|
<td><input type="text" id="badge" name="badge" class="form-control" autofocus disabled value="<?php echo $row['visits_badge']; ?>"> <input type="text" id="initials" name="initials" class="form-control" autofocus disabled value="<?php echo $row['visits_initials']; ?>"></td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td><button type="submit" name="endvisit" value="<?php echo $row['visits_id']; ?>" class="btn btn-warning btn-block"><i class="fas fa-sign-out-alt"></i> <?php echo $transLang['SIGNOUT']; ?></button><br>
|
<td><button type="submit" name="endvisit" value="<?php echo $row['visits_id']; ?>" class="btn btn-warning btn-block"><i class="fas fa-sign-out-alt"></i> <?php echo $transLang['SIGNOUT']; ?></button><br>
|
||||||
@@ -201,8 +214,10 @@
|
|||||||
<div class="invalid-feedback"><?php echo $transLang['REQUIRED']; ?></div>
|
<div class="invalid-feedback"><?php echo $transLang['REQUIRED']; ?></div>
|
||||||
<input class="form-check-input" type="checkbox" value="1" id="id_checked" name="id_checked">
|
<input class="form-check-input" type="checkbox" value="1" id="id_checked" name="id_checked">
|
||||||
<label class="form-check-label" for="id_checked"><?php echo $transLang['ID_CHECKED']; ?></label><br>
|
<label class="form-check-label" for="id_checked"><?php echo $transLang['ID_CHECKED']; ?></label><br>
|
||||||
|
<?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "US") { ?>
|
||||||
<input class="form-check-input" type="checkbox" value="1" id="citizen" name="citizen">
|
<input class="form-check-input" type="checkbox" value="1" id="citizen" name="citizen">
|
||||||
<label class="form-check-label" for="citizen"><?php echo $transLang['CITIZEN']; ?></label>
|
<label class="form-check-label" for="citizen"><?php echo $transLang['CITIZEN']; ?></label>
|
||||||
|
<?php }; ?>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" id="badge" name="badge" class="form-control<?php if( isset($badge_error) && $badge_error == "1" && $_POST['approvevisit'] == $visitid ) { echo " is-invalid"; } ?>" placeholder="<?php echo $transLang['BADGE']; ?>" autofocus maxlength="15">
|
<input type="text" id="badge" name="badge" class="form-control<?php if( isset($badge_error) && $badge_error == "1" && $_POST['approvevisit'] == $visitid ) { echo " is-invalid"; } ?>" placeholder="<?php echo $transLang['BADGE']; ?>" autofocus maxlength="15">
|
||||||
<div class="invalid-feedback"><?php echo $transLang['REQUIRED']; ?></div>
|
<div class="invalid-feedback"><?php echo $transLang['REQUIRED']; ?></div>
|
||||||
|
|||||||
32
login.php
32
login.php
@@ -23,15 +23,27 @@
|
|||||||
session_save_path('.tmp'); // TEMP
|
session_save_path('.tmp'); // TEMP
|
||||||
session_start(); // START
|
session_start(); // START
|
||||||
require_once __DIR__ . '/autoload.php'; // AUTOLOAD
|
require_once __DIR__ . '/autoload.php'; // AUTOLOAD
|
||||||
$StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // CLASSES
|
$StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // DEFAULT CLASSES
|
||||||
$SiteInfo = new \App\LobbySIO\Database\SiteInfo();
|
$SiteInfo = new \App\LobbySIO\Database\SiteInfo();
|
||||||
$Users = new \App\LobbySIO\Database\Users();
|
$Users = new \App\LobbySIO\Database\Users();
|
||||||
if(!isset($_COOKIE['app_disp_lang'])) { $app_disp_lang = $StaticFunctions->getDefaultLanguage(); } else { $app_disp_lang = $_COOKIE['app_disp_lang']; };
|
if (isset($_SESSION['user_id'])) { // LOGGED IN? GET USER OBJECT
|
||||||
$Translate = new \App\LobbySIO\Language\Translate($app_disp_lang);
|
$session_user = $Users->getUserInfo($_SESSION['user_id'], "1", "0"); }
|
||||||
$transLang = $Translate->userLanguage(); // SETUP TRANSLATOR
|
if (isset($session_user)) { // GET UID OR SET TO KIOSK
|
||||||
$app_current_pagename = $transLang['LOGIN']; // PAGE FUNCTION
|
$uid = $session_user["0"]["users_id"];} else { $uid = "2"; }
|
||||||
$app_current_pageicon = '<i class="fas fa-sign-in-alt"></i> ';// PAGE ICON
|
$app_disp_lang = filter_input(INPUT_COOKIE, 'app_disp_lang'); // SETUP LANGUAGE
|
||||||
require_once("inc/header.inc.php"); // SHOW HEADER
|
if(!isset($app_disp_lang)) {
|
||||||
|
$app_disp_lang=$StaticFunctions->getDefaultLanguage(); }
|
||||||
|
$siteidcookie = filter_input(INPUT_COOKIE, 'app_site'); // SETUP SITE
|
||||||
|
foreach($SiteInfo->getSite("0", $uid, "0", "0") as $arr) {
|
||||||
|
$lookup_array[$arr['sites_id']]=1; }
|
||||||
|
if(isset($lookup_array[$siteidcookie])) {
|
||||||
|
$siteid = $siteidcookie; } else { $siteid = "1"; }
|
||||||
|
if(!isset($siteid)) { $siteid="1"; }
|
||||||
|
$Translate = new \App\LobbySIO\Language\Translate($app_disp_lang); // SETUP TRANSLATOR
|
||||||
|
$transLang = $Translate->userLanguage();
|
||||||
|
$app_current_pagename = $transLang['LOGIN']; // PAGE SETUP
|
||||||
|
$app_current_pageicon = '<i class="fas fa-sign-in-alt"></i> ';
|
||||||
|
require_once("inc/header.inc.php");
|
||||||
if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS
|
if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS
|
||||||
header('Location: index.php'); // ELSE HOME
|
header('Location: index.php'); // ELSE HOME
|
||||||
} else { ?>
|
} else { ?>
|
||||||
@@ -60,9 +72,9 @@ endif;
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
<?php if(isset($_COOKIE['app_site'])) { $timezone = $SiteInfo->getSiteInfo($siteid)[0]["sites_timezone"]; } else {$timezone = "UTC";}; ?>
|
<p><b><?php echo $transLang['SITE']; ?>:</b> <?php echo $SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_name"]; ?>
|
||||||
<p><b><?php echo $transLang['SITE']; ?>:</b> <?php echo $SiteInfo->getSiteInfo($siteid)[0]["sites_name"]; ?>
|
<br><b><?php echo $transLang['TIMEZONE']; ?>:</b> <?php echo $SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_timezone"]; ?>
|
||||||
<br><b><?php echo $transLang['TIMEZONE']; ?>:</b> <?php echo $SiteInfo->getSiteInfo($siteid)[0]["sites_timezone"]; ?></p>
|
<br><b><?php echo $transLang['REGION']; ?>:</b> <?php echo $SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"]; ?></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
<button type="button" class="btn btn-block btn-lg btn-success" data-toggle="modal" data-target="#sitetimeModal"><?php echo $transLang['CHANGE']; ?></button>
|
<button type="button" class="btn btn-block btn-lg btn-success" data-toggle="modal" data-target="#sitetimeModal"><?php echo $transLang['CHANGE']; ?></button>
|
||||||
|
|||||||
28
logout.php
28
logout.php
@@ -23,13 +23,27 @@
|
|||||||
session_save_path('.tmp'); // TEMP
|
session_save_path('.tmp'); // TEMP
|
||||||
session_start(); // START
|
session_start(); // START
|
||||||
require_once __DIR__ . '/autoload.php'; // AUTOLOAD
|
require_once __DIR__ . '/autoload.php'; // AUTOLOAD
|
||||||
$StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // CLASSES
|
$StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // DEFAULT CLASSES
|
||||||
if(!isset($_COOKIE['app_disp_lang'])) { $app_disp_lang = $StaticFunctions->getDefaultLanguage(); } else { $app_disp_lang = $_COOKIE['app_disp_lang']; };
|
$SiteInfo = new \App\LobbySIO\Database\SiteInfo();
|
||||||
$Translate = new \App\LobbySIO\Language\Translate($app_disp_lang);
|
$Users = new \App\LobbySIO\Database\Users();
|
||||||
$transLang = $Translate->userLanguage(); // SETUP TRANSLATOR
|
if (isset($_SESSION['user_id'])) { // LOGGED IN? GET USER OBJECT
|
||||||
$app_current_pagename = $transLang['LOGOUT']; // PAGE FUNCTION
|
$session_user = $Users->getUserInfo($_SESSION['user_id'], "1", "0"); }
|
||||||
$app_current_pageicon = '<i class="fas fa-sign-out"></i> '; // PAGE ICON
|
if (isset($session_user)) { // GET UID OR SET TO KIOSK
|
||||||
require_once("inc/header.inc.php"); // SHOW HEADER
|
$uid = $session_user["0"]["users_id"];} else { $uid = "2"; }
|
||||||
|
$app_disp_lang = filter_input(INPUT_COOKIE, 'app_disp_lang'); // SETUP LANGUAGE
|
||||||
|
if(!isset($app_disp_lang)) {
|
||||||
|
$app_disp_lang=$StaticFunctions->getDefaultLanguage(); }
|
||||||
|
$siteidcookie = filter_input(INPUT_COOKIE, 'app_site'); // SETUP SITE
|
||||||
|
foreach($SiteInfo->getSite("0", $uid, "0", "0") as $arr) {
|
||||||
|
$lookup_array[$arr['sites_id']]=1; }
|
||||||
|
if(isset($lookup_array[$siteidcookie])) {
|
||||||
|
$siteid = $siteidcookie; } else { $siteid = "1"; }
|
||||||
|
if(!isset($siteid)) { $siteid="1"; }
|
||||||
|
$Translate = new \App\LobbySIO\Language\Translate($app_disp_lang); // SETUP TRANSLATOR
|
||||||
|
$transLang = $Translate->userLanguage();
|
||||||
|
$app_current_pagename = $transLang['LOGOUT']; // PAGE SETUP
|
||||||
|
$app_current_pageicon = '<i class="fas fa-sign-out"></i> ';
|
||||||
|
require_once("inc/header.inc.php");
|
||||||
if ($StaticFunctions->getSessionStatus() == false) { // CHECK STATUS
|
if ($StaticFunctions->getSessionStatus() == false) { // CHECK STATUS
|
||||||
echo $StaticFunctions->killSession(); // ELSE DIE
|
echo $StaticFunctions->killSession(); // ELSE DIE
|
||||||
} else { ?>
|
} else { ?>
|
||||||
|
|||||||
27
profile.php
27
profile.php
@@ -23,14 +23,27 @@
|
|||||||
session_save_path('.tmp'); // TEMP
|
session_save_path('.tmp'); // TEMP
|
||||||
session_start(); // START
|
session_start(); // START
|
||||||
require_once __DIR__ . '/autoload.php'; // AUTOLOAD
|
require_once __DIR__ . '/autoload.php'; // AUTOLOAD
|
||||||
$StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // CLASSES
|
$StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // DEFAULT CLASSES
|
||||||
|
$SiteInfo = new \App\LobbySIO\Database\SiteInfo();
|
||||||
$Users = new \App\LobbySIO\Database\Users();
|
$Users = new \App\LobbySIO\Database\Users();
|
||||||
if(!isset($_COOKIE['app_disp_lang'])) { $app_disp_lang = $StaticFunctions->getDefaultLanguage(); } else { $app_disp_lang = $_COOKIE['app_disp_lang']; };
|
if (isset($_SESSION['user_id'])) { // LOGGED IN? GET USER OBJECT
|
||||||
$Translate = new \App\LobbySIO\Language\Translate($app_disp_lang);
|
$session_user = $Users->getUserInfo($_SESSION['user_id'], "1", "0"); }
|
||||||
$transLang = $Translate->userLanguage(); // SETUP TRANSLATOR
|
if (isset($session_user)) { // GET UID OR SET TO KIOSK
|
||||||
$app_current_pagename = $transLang['ACCOUNT']; // PAGE FUNCTION
|
$uid = $session_user["0"]["users_id"];} else { $uid = "2"; }
|
||||||
$app_current_pageicon = '<i class="fas fa-user-circle"></i> ';// PAGE ICON
|
$app_disp_lang = filter_input(INPUT_COOKIE, 'app_disp_lang'); // SETUP LANGUAGE
|
||||||
require_once("inc/header.inc.php"); // SHOW HEADER
|
if(!isset($app_disp_lang)) {
|
||||||
|
$app_disp_lang=$StaticFunctions->getDefaultLanguage(); }
|
||||||
|
$siteidcookie = filter_input(INPUT_COOKIE, 'app_site'); // SETUP SITE
|
||||||
|
foreach($SiteInfo->getSite("0", $uid, "0", "0") as $arr) {
|
||||||
|
$lookup_array[$arr['sites_id']]=1; }
|
||||||
|
if(isset($lookup_array[$siteidcookie])) {
|
||||||
|
$siteid = $siteidcookie; } else { $siteid = "1"; }
|
||||||
|
if(!isset($siteid)) { $siteid="1"; }
|
||||||
|
$Translate = new \App\LobbySIO\Language\Translate($app_disp_lang); // SETUP TRANSLATOR
|
||||||
|
$transLang = $Translate->userLanguage();
|
||||||
|
$app_current_pagename = $transLang['ACCOUNT']; // PAGE SETUP
|
||||||
|
$app_current_pageicon = '<i class="fas fa-user-circle"></i> ';
|
||||||
|
require_once("inc/header.inc.php");
|
||||||
if ($StaticFunctions->getSessionStatus() == false) { // CHECK STATUS
|
if ($StaticFunctions->getSessionStatus() == false) { // CHECK STATUS
|
||||||
echo $StaticFunctions->killSession(); // ELSE DIE
|
echo $StaticFunctions->killSession(); // ELSE DIE
|
||||||
} else { ?>
|
} else { ?>
|
||||||
|
|||||||
37
reports.php
37
reports.php
@@ -23,17 +23,30 @@
|
|||||||
session_save_path('.tmp'); // TEMP
|
session_save_path('.tmp'); // TEMP
|
||||||
session_start(); // START
|
session_start(); // START
|
||||||
require_once __DIR__ . '/autoload.php'; // AUTOLOAD
|
require_once __DIR__ . '/autoload.php'; // AUTOLOAD
|
||||||
$StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // CLASSES
|
$StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // DEFAULT CLASSES
|
||||||
$SiteInfo = new \App\LobbySIO\Database\SiteInfo();
|
$SiteInfo = new \App\LobbySIO\Database\SiteInfo();
|
||||||
|
$Users = new \App\LobbySIO\Database\Users();
|
||||||
|
if (isset($_SESSION['user_id'])) { // LOGGED IN? GET USER OBJECT
|
||||||
|
$session_user = $Users->getUserInfo($_SESSION['user_id'], "1", "0"); }
|
||||||
|
if (isset($session_user)) { // GET UID OR SET TO KIOSK
|
||||||
|
$uid = $session_user["0"]["users_id"];} else { $uid = "2"; }
|
||||||
|
$app_disp_lang = filter_input(INPUT_COOKIE, 'app_disp_lang'); // SETUP LANGUAGE
|
||||||
|
if(!isset($app_disp_lang)) {
|
||||||
|
$app_disp_lang=$StaticFunctions->getDefaultLanguage(); }
|
||||||
|
$siteidcookie = filter_input(INPUT_COOKIE, 'app_site'); // SETUP SITE
|
||||||
|
foreach($SiteInfo->getSite("0", $uid, "0", "0") as $arr) {
|
||||||
|
$lookup_array[$arr['sites_id']]=1; }
|
||||||
|
if(isset($lookup_array[$siteidcookie])) {
|
||||||
|
$siteid = $siteidcookie; } else { $siteid = "1"; }
|
||||||
|
if(!isset($siteid)) { $siteid="1"; }
|
||||||
|
$Translate = new \App\LobbySIO\Language\Translate($app_disp_lang); // SETUP TRANSLATOR
|
||||||
|
$transLang = $Translate->userLanguage();
|
||||||
$VisitTypeInfo = new \App\LobbySIO\Database\VisitTypeInfo();
|
$VisitTypeInfo = new \App\LobbySIO\Database\VisitTypeInfo();
|
||||||
$IDTypeInfo = new \App\LobbySIO\Database\IDTypeInfo();
|
$IDTypeInfo = new \App\LobbySIO\Database\IDTypeInfo();
|
||||||
$VisitInfo = new \App\LobbySIO\Database\VisitInfo();
|
$VisitInfo = new \App\LobbySIO\Database\VisitInfo();
|
||||||
if(!isset($_COOKIE['app_disp_lang'])) { $app_disp_lang = $StaticFunctions->getDefaultLanguage(); } else { $app_disp_lang = $_COOKIE['app_disp_lang']; };
|
$app_current_pagename = $transLang['REPORTS']; // PAGE SETUP
|
||||||
$Translate = new \App\LobbySIO\Language\Translate($app_disp_lang);
|
$app_current_pageicon = '<i class="fas fa-chart-pie"></i> ';
|
||||||
$transLang = $Translate->userLanguage(); // SETUP TRANSLATOR
|
require_once("inc/header.inc.php");
|
||||||
$app_current_pagename = $transLang['REPORTS']; // PAGE FUNCTION
|
|
||||||
$app_current_pageicon = '<i class="fas fa-chart-pie"></i> '; // PAGE ICON
|
|
||||||
require_once("inc/header.inc.php"); // SHOW HEADER
|
|
||||||
if ($StaticFunctions->getSessionStatus() == false) { // CHECK STATUS
|
if ($StaticFunctions->getSessionStatus() == false) { // CHECK STATUS
|
||||||
echo $StaticFunctions->killSession(); // ELSE DIE
|
echo $StaticFunctions->killSession(); // ELSE DIE
|
||||||
} else { ?>
|
} else { ?>
|
||||||
@@ -70,8 +83,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<?php if (isset($_POST['repsite'])) { $currentrepsite = $_POST['repsite']; } else { $currentrepsite = "0"; }; ?>
|
<?php if (isset($_POST['repsite'])) { $currentrepsite = $_POST['repsite']; } else { $currentrepsite = "0"; }; ?>
|
||||||
<select name="repsite" class="form-control">
|
<select name="repsite" class="form-control">
|
||||||
|
<?php if($session_user["0"]["users_usertype"] == "ADMIN") { ?>
|
||||||
<option value="all"<?php if ($currentrepsite == "all") {echo " selected";}; ?>><?php echo $transLang['ALL']; ?></option>
|
<option value="all"<?php if ($currentrepsite == "all") {echo " selected";}; ?>><?php echo $transLang['ALL']; ?></option>
|
||||||
<?php foreach($SiteInfo->getSiteInfo("%") as $row): ?>
|
<?php } ?>
|
||||||
|
<?php foreach($SiteInfo->getSite("0", $uid, "0", "0") as $row): ?>
|
||||||
<option value="<?php echo $row['sites_id']; ?>"<?php if ($currentrepsite == $row['sites_id']) {echo " selected";}; ?>><?php echo $row['sites_name']; ?></option>
|
<option value="<?php echo $row['sites_id']; ?>"<?php if ($currentrepsite == $row['sites_id']) {echo " selected";}; ?>><?php echo $row['sites_name']; ?></option>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
@@ -118,7 +133,7 @@
|
|||||||
<?php if ($_POST['reporttype'] == "Default"): ?>
|
<?php if ($_POST['reporttype'] == "Default"): ?>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<table id="report" class="table table-striped table-bordered">
|
<table id="report" class="table table-striped table-bordered">
|
||||||
<thead><tr><th><?php echo $transLang['IN']; ?></th><th><?php echo $transLang['OUT']; ?></th><th><?php echo $transLang['SITE']; ?></th><th><?php echo $transLang['COMPANY']; ?></th><th><?php echo $transLang['REASON']; ?></th><th><?php echo $transLang['NAME']; ?></th><th><?php echo $transLang['ESCORT']; ?></th><th><?php echo $transLang['BADGE']; ?></th><th><?php echo $transLang['INITIALS']; ?></th><th><?php echo $transLang['CITIZEN']; ?></th><th><?php echo $transLang['ID_TYPE']; ?></th><th><?php echo $transLang['ID_CHECKED']; ?></th></tr></thead>
|
<thead><tr><th><?php echo $transLang['IN']; ?></th><th><?php echo $transLang['OUT']; ?></th><th><?php echo $transLang['SITE']; ?></th><th><?php echo $transLang['COMPANY']; ?></th><th><?php echo $transLang['REASON']; ?></th><th><?php echo $transLang['NAME']; ?></th><th><?php echo $transLang['ESCORT']; ?></th><th><?php echo $transLang['BADGE']; ?></th><th><?php echo $transLang['INITIALS']; ?></th><?php if($SiteInfo->getSite($_POST['repsite'], $uid, "0", "0")[0]["sites_region"] == "US") { ?><th><?php echo $transLang['CITIZEN']; ?></th><?php }; ?><th><?php echo $transLang['ID_TYPE']; ?></th><th><?php echo $transLang['ID_CHECKED']; ?></th></tr></thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
$approval = "2";
|
$approval = "2";
|
||||||
@@ -134,14 +149,14 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td><?php echo $timein_disp; ?></td>
|
<td><?php echo $timein_disp; ?></td>
|
||||||
<td><?php if (!empty($row['visits_outtime'])) {echo $timeout_disp; } else {echo $transLang['IN'];}; ?></td>
|
<td><?php if (!empty($row['visits_outtime'])) {echo $timeout_disp; } else {echo $transLang['IN'];}; ?></td>
|
||||||
<td><?php echo $SiteInfo->getSiteInfo($row['visits_site_id'])[0]["sites_name"]; ?></td>
|
<td><?php echo $SiteInfo->getSite($row['visits_site_id'], $uid, "0", "0")[0]["sites_name"]; ?></td>
|
||||||
<td><?php echo $row['visits_company']; ?></td>
|
<td><?php echo $row['visits_company']; ?></td>
|
||||||
<td><?php echo $transLang[$VisitTypeInfo->getVisitTypeInfo($row['visits_reason'])[0]['visittypes_name']]; ?></td>
|
<td><?php echo $transLang[$VisitTypeInfo->getVisitTypeInfo($row['visits_reason'])[0]['visittypes_name']]; ?></td>
|
||||||
<td><?php echo $row['visits_lastname'] . ", " . $row['visits_firstname']; ?><br /><img src="<?php echo $row['visits_signature']; ?>" width="200" height="50" alt="Signature" /></td>
|
<td><?php echo $row['visits_lastname'] . ", " . $row['visits_firstname']; ?><br /><img src="<?php echo $row['visits_signature']; ?>" width="200" height="50" alt="Signature" /></td>
|
||||||
<td><?php if (!empty($row['visits_escort'])) {echo $row['visits_escort'] . '<br /><img src="' . $row['visits_escort_signature'] . '" width="200" height="50" alt="Escort Signature" />'; } ?></td>
|
<td><?php if (!empty($row['visits_escort'])) {echo $row['visits_escort'] . '<br /><img src="' . $row['visits_escort_signature'] . '" width="200" height="50" alt="Escort Signature" />'; } ?></td>
|
||||||
<td><?php echo $row['visits_badge']; ?></td>
|
<td><?php echo $row['visits_badge']; ?></td>
|
||||||
<td><?php echo $row['visits_initials']; ?></td>
|
<td><?php echo $row['visits_initials']; ?></td>
|
||||||
<td><?php if($row['visits_citizen']==1) { echo $transLang['YESYES']; } else { echo $transLang['NONO']; }; ?></td>
|
<?php if($SiteInfo->getSite($_POST['repsite'], $uid, "0", "0")[0]["sites_region"] == "US") { ?> <td><?php if($row['visits_citizen']==1) { echo $transLang['YESYES']; } else { echo $transLang['NONO']; }; ?></td> <?php }; ?>
|
||||||
<td><?php echo $transLang[$IDTypeInfo->getIDTypeInfo($row['visits_id_type'])[0]['idtypes_name']]; ?></td>
|
<td><?php echo $transLang[$IDTypeInfo->getIDTypeInfo($row['visits_id_type'])[0]['idtypes_name']]; ?></td>
|
||||||
<td><?php if($row['visits_id_checked']==1) { echo $transLang['YESYES']; } else { echo $transLang['NONO']; }; ?></td>
|
<td><?php if($row['visits_id_checked']==1) { echo $transLang['YESYES']; } else { echo $transLang['NONO']; }; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
29
signin.php
29
signin.php
@@ -23,15 +23,28 @@
|
|||||||
session_save_path('.tmp'); // TEMP
|
session_save_path('.tmp'); // TEMP
|
||||||
session_start(); // START
|
session_start(); // START
|
||||||
require_once __DIR__ . '/autoload.php'; // AUTOLOAD
|
require_once __DIR__ . '/autoload.php'; // AUTOLOAD
|
||||||
$StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // CLASSES
|
$StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // DEFAULT CLASSES
|
||||||
$SiteInfo = new \App\LobbySIO\Database\SiteInfo();
|
$SiteInfo = new \App\LobbySIO\Database\SiteInfo();
|
||||||
|
$Users = new \App\LobbySIO\Database\Users();
|
||||||
|
if (isset($_SESSION['user_id'])) { // LOGGED IN? GET USER OBJECT
|
||||||
|
$session_user = $Users->getUserInfo($_SESSION['user_id'], "1", "0"); }
|
||||||
|
if (isset($session_user)) { // GET UID OR SET TO KIOSK
|
||||||
|
$uid = $session_user["0"]["users_id"];} else { $uid = "2"; }
|
||||||
|
$app_disp_lang = filter_input(INPUT_COOKIE, 'app_disp_lang'); // SETUP LANGUAGE
|
||||||
|
if(!isset($app_disp_lang)) {
|
||||||
|
$app_disp_lang=$StaticFunctions->getDefaultLanguage(); }
|
||||||
|
$siteidcookie = filter_input(INPUT_COOKIE, 'app_site'); // SETUP SITE
|
||||||
|
foreach($SiteInfo->getSite("0", $uid, "0", "0") as $arr) {
|
||||||
|
$lookup_array[$arr['sites_id']]=1; }
|
||||||
|
if(isset($lookup_array[$siteidcookie])) {
|
||||||
|
$siteid = $siteidcookie; } else { $siteid = "1"; }
|
||||||
|
if(!isset($siteid)) { $siteid="1"; }
|
||||||
|
$Translate = new \App\LobbySIO\Language\Translate($app_disp_lang); // SETUP TRANSLATOR
|
||||||
|
$transLang = $Translate->userLanguage();
|
||||||
$VisitTypeInfo = new \App\LobbySIO\Database\VisitTypeInfo();
|
$VisitTypeInfo = new \App\LobbySIO\Database\VisitTypeInfo();
|
||||||
if(!isset($_COOKIE['app_disp_lang'])) { $app_disp_lang = $StaticFunctions->getDefaultLanguage(); } else { $app_disp_lang = $_COOKIE['app_disp_lang']; };
|
$app_current_pagename = $transLang['SIGNIN']; // PAGE SETUP
|
||||||
$Translate = new \App\LobbySIO\Language\Translate($app_disp_lang);
|
$app_current_pageicon = '<i class="fas fa-sign-in-alt"></i> ';
|
||||||
$transLang = $Translate->userLanguage(); // SETUP TRANSLATOR
|
require_once("inc/header.inc.php");
|
||||||
$app_current_pagename = $transLang['SIGNIN']; // PAGE FUNCTION
|
|
||||||
$app_current_pageicon = '<i class="fas fa-sign-in-alt"></i> ';// PAGE ICON
|
|
||||||
require_once("inc/header.inc.php"); // SHOW HEADER
|
|
||||||
if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS
|
if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS
|
||||||
header('Location: index.php'); // ELSE HOME
|
header('Location: index.php'); // ELSE HOME
|
||||||
} else { ?>
|
} else { ?>
|
||||||
@@ -108,7 +121,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<input type="hidden" name="v_signature" id="v_signature" required />
|
<input type="hidden" name="v_signature" id="v_signature" required />
|
||||||
<input type="hidden" name="siteid" id="siteid" value="<?php echo $siteid; ?>" />
|
<input type="hidden" name="siteid" id="siteid" value="<?php echo $siteid; ?>" />
|
||||||
<p><?php echo $transLang['ACKNOWLEDGEMENT']; ?><p>
|
<?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "US") { echo "<p>" . $transLang['ACKNOWLEDGEMENT'] . "</p>"; } ?>
|
||||||
<p><?php echo $transLang['GDPR_TEXT']; ?><p>
|
<p><?php echo $transLang['GDPR_TEXT']; ?><p>
|
||||||
<p><a class="btn btn-outline-secondary btn-block" data-toggle="modal" data-target="#termsModalLong" href="<?php echo $StaticFunctions->getRules(); ?>"><?php echo $transLang['REFERENCE']; ?>: (<?php echo $transLang['ACKNOWLEDGEMENT_DOC_NAME']; ?>)</a></p>
|
<p><a class="btn btn-outline-secondary btn-block" data-toggle="modal" data-target="#termsModalLong" href="<?php echo $StaticFunctions->getRules(); ?>"><?php echo $transLang['REFERENCE']; ?>: (<?php echo $transLang['ACKNOWLEDGEMENT_DOC_NAME']; ?>)</a></p>
|
||||||
<button type="submit" id="saveBtn" class="btn btn-lg btn-success btn-block" name="signin"><?php echo $transLang['SIGNIN']; ?></button>
|
<button type="submit" id="saveBtn" class="btn btn-lg btn-success btn-block" name="signin"><?php echo $transLang['SIGNIN']; ?></button>
|
||||||
|
|||||||
@@ -23,16 +23,29 @@
|
|||||||
session_save_path('.tmp'); // TEMP
|
session_save_path('.tmp'); // TEMP
|
||||||
session_start(); // START
|
session_start(); // START
|
||||||
require_once __DIR__ . '/autoload.php'; // AUTOLOAD
|
require_once __DIR__ . '/autoload.php'; // AUTOLOAD
|
||||||
$StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // CLASSES
|
$StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // DEFAULT CLASSES
|
||||||
$SiteInfo = new \App\LobbySIO\Database\SiteInfo();
|
$SiteInfo = new \App\LobbySIO\Database\SiteInfo();
|
||||||
|
$Users = new \App\LobbySIO\Database\Users();
|
||||||
|
if (isset($_SESSION['user_id'])) { // LOGGED IN? GET USER OBJECT
|
||||||
|
$session_user = $Users->getUserInfo($_SESSION['user_id'], "1", "0"); }
|
||||||
|
if (isset($session_user)) { // GET UID OR SET TO KIOSK
|
||||||
|
$uid = $session_user["0"]["users_id"];} else { $uid = "2"; }
|
||||||
|
$app_disp_lang = filter_input(INPUT_COOKIE, 'app_disp_lang'); // SETUP LANGUAGE
|
||||||
|
if(!isset($app_disp_lang)) {
|
||||||
|
$app_disp_lang=$StaticFunctions->getDefaultLanguage(); }
|
||||||
|
$siteidcookie = filter_input(INPUT_COOKIE, 'app_site'); // SETUP SITE
|
||||||
|
foreach($SiteInfo->getSite("0", $uid, "0", "0") as $arr) {
|
||||||
|
$lookup_array[$arr['sites_id']]=1; }
|
||||||
|
if(isset($lookup_array[$siteidcookie])) {
|
||||||
|
$siteid = $siteidcookie; } else { $siteid = "1"; }
|
||||||
|
if(!isset($siteid)) { $siteid="1"; }
|
||||||
|
$Translate = new \App\LobbySIO\Language\Translate($app_disp_lang); // SETUP TRANSLATOR
|
||||||
|
$transLang = $Translate->userLanguage();
|
||||||
$VisitTypeInfo = new \App\LobbySIO\Database\VisitTypeInfo();
|
$VisitTypeInfo = new \App\LobbySIO\Database\VisitTypeInfo();
|
||||||
$VisitActions = new \App\LobbySIO\Database\VisitActions();
|
$VisitActions = new \App\LobbySIO\Database\VisitActions();
|
||||||
if(!isset($_COOKIE['app_disp_lang'])) { $app_disp_lang = $StaticFunctions->getDefaultLanguage(); } else { $app_disp_lang = $_COOKIE['app_disp_lang']; };
|
$app_current_pagename = $transLang['SIGNIN']; // PAGE SETUP
|
||||||
$Translate = new \App\LobbySIO\Language\Translate($app_disp_lang);
|
$app_current_pageicon = '<i class="fas fa-file-signature"></i> ';
|
||||||
$transLang = $Translate->userLanguage(); // SETUP TRANSLATOR
|
require_once("inc/header.inc.php");
|
||||||
$app_current_pagename = $transLang['SIGNIN']; // PAGE FUNCTION
|
|
||||||
$app_current_pageicon = '<i class="fas fa-file-signature"></i> ';// PAGE ICON
|
|
||||||
require_once("inc/header.inc.php"); // SHOW HEADER
|
|
||||||
if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS
|
if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS
|
||||||
header('Location: index.php'); // ELSE HOME
|
header('Location: index.php'); // ELSE HOME
|
||||||
} else { ?>
|
} else { ?>
|
||||||
@@ -62,8 +75,8 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<h4><?php echo $transLang['ACKNOWLEDGEMENT']; ?></h4>
|
<?php if($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "US") { echo "<p>" . $transLang['ACKNOWLEDGEMENT'] . "</p>"; } ?>
|
||||||
<h5><?php echo $transLang['ACKNOWLEDGEMENT_DOC_NAME']; ?></h5>
|
<p><?php echo $transLang['GDPR_TEXT']; ?><p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php } else { // EXIT IF NO POST
|
<?php } else { // EXIT IF NO POST
|
||||||
|
|||||||
28
signout.php
28
signout.php
@@ -23,15 +23,29 @@
|
|||||||
session_save_path('.tmp'); // TEMP
|
session_save_path('.tmp'); // TEMP
|
||||||
session_start(); // START
|
session_start(); // START
|
||||||
require_once __DIR__ . '/autoload.php'; // AUTOLOAD
|
require_once __DIR__ . '/autoload.php'; // AUTOLOAD
|
||||||
$StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // CLASSES
|
$StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // DEFAULT CLASSES
|
||||||
|
$SiteInfo = new \App\LobbySIO\Database\SiteInfo();
|
||||||
|
$Users = new \App\LobbySIO\Database\Users();
|
||||||
|
if (isset($_SESSION['user_id'])) { // LOGGED IN? GET USER OBJECT
|
||||||
|
$session_user = $Users->getUserInfo($_SESSION['user_id'], "1", "0"); }
|
||||||
|
if (isset($session_user)) { // GET UID OR SET TO KIOSK
|
||||||
|
$uid = $session_user["0"]["users_id"];} else { $uid = "2"; }
|
||||||
|
$app_disp_lang = filter_input(INPUT_COOKIE, 'app_disp_lang'); // SETUP LANGUAGE
|
||||||
|
if(!isset($app_disp_lang)) {
|
||||||
|
$app_disp_lang=$StaticFunctions->getDefaultLanguage(); }
|
||||||
|
$siteidcookie = filter_input(INPUT_COOKIE, 'app_site'); // SETUP SITE
|
||||||
|
foreach($SiteInfo->getSite("0", $uid, "0", "0") as $arr) {
|
||||||
|
$lookup_array[$arr['sites_id']]=1; }
|
||||||
|
if(isset($lookup_array[$siteidcookie])) {
|
||||||
|
$siteid = $siteidcookie; } else { $siteid = "1"; }
|
||||||
|
if(!isset($siteid)) { $siteid="1"; }
|
||||||
|
$Translate = new \App\LobbySIO\Language\Translate($app_disp_lang); // SETUP TRANSLATOR
|
||||||
|
$transLang = $Translate->userLanguage();
|
||||||
$VisitInfo = new \App\LobbySIO\Database\VisitInfo();
|
$VisitInfo = new \App\LobbySIO\Database\VisitInfo();
|
||||||
$VisitActions = new \App\LobbySIO\Database\VisitActions();
|
$VisitActions = new \App\LobbySIO\Database\VisitActions();
|
||||||
if(!isset($_COOKIE['app_disp_lang'])) { $app_disp_lang = $StaticFunctions->getDefaultLanguage(); } else { $app_disp_lang = $_COOKIE['app_disp_lang']; };
|
$app_current_pagename = $transLang['SIGNOUT']; // PAGE SETUP
|
||||||
$Translate = new \App\LobbySIO\Language\Translate($app_disp_lang);
|
$app_current_pageicon = '<i class="fas fa-sign-out-alt"></i> ';
|
||||||
$transLang = $Translate->userLanguage(); // SETUP TRANSLATOR
|
require_once("inc/header.inc.php");
|
||||||
$app_current_pagename = $transLang['SIGNOUT']; // PAGE FUNCTION
|
|
||||||
$app_current_pageicon = '<i class="fas fa-sign-out-alt"></i> ';// PAGE ICON
|
|
||||||
require_once("inc/header.inc.php"); // SHOW HEADER
|
|
||||||
if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS
|
if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS
|
||||||
header('Location: index.php'); // ELSE HOME
|
header('Location: index.php'); // ELSE HOME
|
||||||
} else { ?>
|
} else { ?>
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class Registry { const
|
|||||||
DB_PRFX = 'lsio_', // DB table prefix
|
DB_PRFX = 'lsio_', // DB table prefix
|
||||||
ORGANIZATION = 'Widgets, Inc', // Organization name
|
ORGANIZATION = 'Widgets, Inc', // Organization name
|
||||||
DEFAULTLANGUAGE = 'en', // Default language - make sure a translation file exists
|
DEFAULTLANGUAGE = 'en', // Default language - make sure a translation file exists
|
||||||
ROWSPERPAGE = '5', // Rows per page on tables (does not include reports)
|
ROWSPERPAGE = '10', // Rows per page on tables (does not include reports)
|
||||||
MINPASS = '8', // Minimum password length
|
MINPASS = '8', // Minimum password length
|
||||||
DEFAULTTZ = 'America/New_York' // DEFAULT TIME ZONE
|
DEFAULTTZ = 'America/New_York' // DEFAULT TIME ZONE
|
||||||
;}
|
;}
|
||||||
|
|||||||
51
src/Database/SiteInfo.php
Executable file → Normal file
51
src/Database/SiteInfo.php
Executable file → Normal file
@@ -27,29 +27,60 @@ use App\LobbySIO\Config\Registry;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
class SiteInfo {
|
class SiteInfo {
|
||||||
public function getSiteInfo ($siteid){
|
|
||||||
|
// Return Site Information array. 0 eliminates argument
|
||||||
|
public function getSite ($sites_id, $users_id, $rowsperpage, $offset) {
|
||||||
|
if ($sites_id == "0") { $c_sites_id = NULL; }
|
||||||
|
else { $c_sites_id = Registry::DB_PRFX . "sites.id LIKE \"$sites_id\""; }
|
||||||
|
if ($users_id == "0") { $c_users_id = NULL; }
|
||||||
|
else { $c_users_id = Registry::DB_PRFX . "users_sites.users_id LIKE \"$users_id\""; }
|
||||||
|
|
||||||
|
if ($c_sites_id === NULL AND $c_users_id === NULL) {
|
||||||
|
$c_where = NULL;
|
||||||
|
} elseif ($c_sites_id !== NULL AND $c_users_id !== NULL) {
|
||||||
|
$c_where = "WHERE " . $c_sites_id . " AND " . $c_users_id;
|
||||||
|
} elseif ($c_sites_id === NULL AND $c_users_id !== NULL) {
|
||||||
|
$c_where = "WHERE " . $c_users_id;
|
||||||
|
} elseif ($c_sites_id !== NULL AND $c_users_id === NULL) {
|
||||||
|
$c_where = "WHERE " . $c_sites_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($rowsperpage == "0") { $c_rowsperpage = NULL; }
|
||||||
|
else { $c_rowsperpage = " LIMIT " . Registry::ROWSPERPAGE; }
|
||||||
|
if ($offset == "0") { $c_offset = NULL; }
|
||||||
|
else { $c_offset = " OFFSET " . $offset; }
|
||||||
$query = "
|
$query = "
|
||||||
SELECT
|
SELECT
|
||||||
" . Registry::DB_PRFX . "sites.id as sites_id,
|
" . Registry::DB_PRFX . "sites.id as sites_id,
|
||||||
" . Registry::DB_PRFX . "sites.name as sites_name,
|
" . Registry::DB_PRFX . "sites.name as sites_name,
|
||||||
|
" . Registry::DB_PRFX . "sites.region as sites_region,
|
||||||
" . Registry::DB_PRFX . "sites.timezone as sites_timezone
|
" . Registry::DB_PRFX . "sites.timezone as sites_timezone
|
||||||
FROM " . Registry::DB_PRFX . "sites
|
FROM " . Registry::DB_PRFX . "sites
|
||||||
WHERE " . Registry::DB_PRFX . "sites.id LIKE \"$siteid\"";
|
JOIN " . Registry::DB_PRFX . "users_sites ON " . Registry::DB_PRFX . "sites.id=" . Registry::DB_PRFX . "users_sites.sites_id
|
||||||
|
" . $c_where . "
|
||||||
|
ORDER BY " . Registry::DB_PRFX . "sites.name ASC" . $c_rowsperpage . $c_offset;
|
||||||
$database = new \App\LobbySIO\Database\Connect();
|
$database = new \App\LobbySIO\Database\Connect();
|
||||||
$rows = $database->getQuery($query);
|
$rows = $database->getQuery($query);
|
||||||
return $rows;
|
return $rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSiteName ($siteid) {
|
public function deleteSite ($siteid) {
|
||||||
$query = "
|
$query = "
|
||||||
SELECT
|
DELETE FROM " . Registry::DB_PRFX . "sites WHERE " . Registry::DB_PRFX . "sites.id=\"$siteid\"
|
||||||
" . Registry::DB_PRFX . "sites.id as sites_id,
|
";
|
||||||
" . Registry::DB_PRFX . "sites.name as sites_name
|
|
||||||
FROM " . Registry::DB_PRFX . "sites
|
|
||||||
WHERE " . Registry::DB_PRFX . "sites.id LIKE $siteid";
|
|
||||||
$database = new \App\LobbySIO\Database\Connect();
|
$database = new \App\LobbySIO\Database\Connect();
|
||||||
$rows = $database->getQuery($query);
|
$count = $database->runQuery($query);
|
||||||
return $rows[0]["sites_name"];
|
return $count;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addSite ($sitename, $timezone, $region) {
|
||||||
|
$query = "
|
||||||
|
INSERT INTO " . Registry::DB_PRFX . "sites (" . Registry::DB_PRFX . "sites.name, " . Registry::DB_PRFX . "sites.timezone, " . Registry::DB_PRFX . "sites.region)
|
||||||
|
VALUES (\"$sitename\", \"$timezone\", \"$region\")
|
||||||
|
";
|
||||||
|
$database = new \App\LobbySIO\Database\Connect();
|
||||||
|
$count = $database->runQuery($query);
|
||||||
|
return $count;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
5
src/Database/Users.php
Executable file → Normal file
5
src/Database/Users.php
Executable file → Normal file
@@ -26,7 +26,7 @@ use App\LobbySIO\Config\Registry;
|
|||||||
* @author josh.north
|
* @author josh.north
|
||||||
*/
|
*/
|
||||||
class Users {
|
class Users {
|
||||||
// Get site info as array by site id. Pass % for all.
|
// Get user info as array by user id. Pass % for all.
|
||||||
public function getUserInfo($userid, $rowsperpage, $offset) {
|
public function getUserInfo($userid, $rowsperpage, $offset) {
|
||||||
if ($rowsperpage == "%") { $cond_rowsperpage = NULL; } else { $cond_rowsperpage = " LIMIT " . Registry::ROWSPERPAGE; };
|
if ($rowsperpage == "%") { $cond_rowsperpage = NULL; } else { $cond_rowsperpage = " LIMIT " . Registry::ROWSPERPAGE; };
|
||||||
if ($offset == "%") { $cond_offset = NULL; } else { $cond_offset = " OFFSET " . $offset; };
|
if ($offset == "%") { $cond_offset = NULL; } else { $cond_offset = " OFFSET " . $offset; };
|
||||||
@@ -86,6 +86,7 @@ class Users {
|
|||||||
";
|
";
|
||||||
$database = new \App\LobbySIO\Database\Connect();
|
$database = new \App\LobbySIO\Database\Connect();
|
||||||
$count = $database->runQuery($query);
|
$count = $database->runQuery($query);
|
||||||
|
return $count;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setUserInfo($uid, $firstname, $lastname, $email, $usertypeid, $password) {
|
public function setUserInfo($uid, $firstname, $lastname, $email, $usertypeid, $password) {
|
||||||
@@ -102,6 +103,7 @@ class Users {
|
|||||||
";
|
";
|
||||||
$database = new \App\LobbySIO\Database\Connect();
|
$database = new \App\LobbySIO\Database\Connect();
|
||||||
$count = $database->runQuery($query);
|
$count = $database->runQuery($query);
|
||||||
|
return $count;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUserType ($usertypeid){
|
public function getUserType ($usertypeid){
|
||||||
@@ -122,6 +124,7 @@ class Users {
|
|||||||
";
|
";
|
||||||
$database = new \App\LobbySIO\Database\Connect();
|
$database = new \App\LobbySIO\Database\Connect();
|
||||||
$count = $database->runQuery($query);
|
$count = $database->runQuery($query);
|
||||||
|
return $count;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUserTypeInfo ($usertypeid) {
|
public function getUserTypeInfo ($usertypeid) {
|
||||||
|
|||||||
2
src/Database/VisitInfo.php
Executable file → Normal file
2
src/Database/VisitInfo.php
Executable file → Normal file
@@ -41,7 +41,7 @@ class VisitInfo {
|
|||||||
if ($rowsperpage == "%") { $cond_rowsperpage = NULL; } else { $cond_rowsperpage = " LIMIT " . Registry::ROWSPERPAGE; };
|
if ($rowsperpage == "%") { $cond_rowsperpage = NULL; } else { $cond_rowsperpage = " LIMIT " . Registry::ROWSPERPAGE; };
|
||||||
if ($offset == "%") { $cond_offset = NULL; } else { $cond_offset = " OFFSET " . $offset; };
|
if ($offset == "%") { $cond_offset = NULL; } else { $cond_offset = " OFFSET " . $offset; };
|
||||||
if ($intime == "%") { $cond_intime = NULL; } else { $cond_intime = Registry::DB_PRFX . "visits.intime=\"$intime\" AND "; };
|
if ($intime == "%") { $cond_intime = NULL; } else { $cond_intime = Registry::DB_PRFX . "visits.intime=\"$intime\" AND "; };
|
||||||
if ($siteid == "%") { $cond_siteid = NULL; } else { $cond_siteid = Registry::DB_PRFX . "visits.site_id=\"$siteid\" AND "; };
|
if ($siteid == "%") { $cond_siteid = NULL; } else { $cond_siteid = Registry::DB_PRFX . "visits.site_id IN (\"$siteid\") AND "; };
|
||||||
if ($visitid == "%") { $cond_visitid = NULL; } else { $cond_visitid = Registry::DB_PRFX . "visits.id LIKE \"$visitid\" AND "; };
|
if ($visitid == "%") { $cond_visitid = NULL; } else { $cond_visitid = Registry::DB_PRFX . "visits.id LIKE \"$visitid\" AND "; };
|
||||||
if ($starttime == "%") { $cond_intime = NULL; } else { $cond_intime = Registry::DB_PRFX . "visits.intime BETWEEN \"$starttime\" and \"$endtime\" AND "; };
|
if ($starttime == "%") { $cond_intime = NULL; } else { $cond_intime = Registry::DB_PRFX . "visits.intime BETWEEN \"$starttime\" and \"$endtime\" AND "; };
|
||||||
$query = "
|
$query = "
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ ACTIVEVISITS = 'Aktive Besuche'
|
|||||||
ADDEQPT = 'Ausrüstung hinzufügen'
|
ADDEQPT = 'Ausrüstung hinzufügen'
|
||||||
ADD_USER = 'Benutzer hinzufügen'
|
ADD_USER = 'Benutzer hinzufügen'
|
||||||
ADD_USER_DESC = 'Alle Felder sind erforderlich! Benutzername und E-Mail müssen eindeutig sein. Minimale Passwortlänge ist '
|
ADD_USER_DESC = 'Alle Felder sind erforderlich! Benutzername und E-Mail müssen eindeutig sein. Minimale Passwortlänge ist '
|
||||||
|
ADD_SITE = 'Ort hinzufügen'
|
||||||
|
SADMIN = 'Standortadministrator'
|
||||||
ADMIN = 'Administrator'
|
ADMIN = 'Administrator'
|
||||||
ADMINISTRATION = 'Verwaltung'
|
ADMINISTRATION = 'Verwaltung'
|
||||||
ALL = 'Alles'
|
ALL = 'Alles'
|
||||||
@@ -74,6 +76,7 @@ NAME = 'Vollständiger Name'
|
|||||||
NEW = 'Neu'
|
NEW = 'Neu'
|
||||||
NONEAVA = 'Keiner'
|
NONEAVA = 'Keiner'
|
||||||
NOSIGNIN = 'Keine Anmeldung'
|
NOSIGNIN = 'Keine Anmeldung'
|
||||||
|
NOSITE = 'Kein Standort ausgewählt'
|
||||||
NOTES = 'Anmerkungen'
|
NOTES = 'Anmerkungen'
|
||||||
NOTES_PLACEHOLDER = 'Geben Sie bei Bedarf Notizen ein'
|
NOTES_PLACEHOLDER = 'Geben Sie bei Bedarf Notizen ein'
|
||||||
NOT_AUTHORIZED = 'Nicht berechtigt!'
|
NOT_AUTHORIZED = 'Nicht berechtigt!'
|
||||||
@@ -94,6 +97,7 @@ REASON = 'Grund für den Zugang zu Einrichtungen'
|
|||||||
REASONCOMPANY = 'Firma / Grund'
|
REASONCOMPANY = 'Firma / Grund'
|
||||||
REFERENCE = 'Referenz'
|
REFERENCE = 'Referenz'
|
||||||
REFRESH = 'Aktualisieren'
|
REFRESH = 'Aktualisieren'
|
||||||
|
REGION ='Region'
|
||||||
REMEQPT = 'Ausrüstung entfernen'
|
REMEQPT = 'Ausrüstung entfernen'
|
||||||
REPORTS = 'Berichte'
|
REPORTS = 'Berichte'
|
||||||
REPORTS_DESC = 'Die Dropdown-Liste kann verwendet werden, um vorkonfigurierte Berichte auszuwählen. Weitere Berichte werden gerade geschrieben.'
|
REPORTS_DESC = 'Die Dropdown-Liste kann verwendet werden, um vorkonfigurierte Berichte auszuwählen. Weitere Berichte werden gerade geschrieben.'
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ ACTIVEVISITS = 'Active Visits'
|
|||||||
ADDEQPT = 'Add Equipment'
|
ADDEQPT = 'Add Equipment'
|
||||||
ADD_USER = 'Add User'
|
ADD_USER = 'Add User'
|
||||||
ADD_USER_DESC = 'All fields are required! Username and email must be unique. Minimum password length is '
|
ADD_USER_DESC = 'All fields are required! Username and email must be unique. Minimum password length is '
|
||||||
|
ADD_SITE = 'Add Site'
|
||||||
|
SADMIN = 'Site Administrator'
|
||||||
ADMIN = 'Administrator'
|
ADMIN = 'Administrator'
|
||||||
ADMINISTRATION = 'Administration'
|
ADMINISTRATION = 'Administration'
|
||||||
ALL = 'All'
|
ALL = 'All'
|
||||||
@@ -74,6 +76,7 @@ NAME = 'Name'
|
|||||||
NEW = 'New'
|
NEW = 'New'
|
||||||
NONEAVA = 'None'
|
NONEAVA = 'None'
|
||||||
NOSIGNIN = 'No sign in'
|
NOSIGNIN = 'No sign in'
|
||||||
|
NOSITE = 'No Site Selected'
|
||||||
NOTES = 'Notes'
|
NOTES = 'Notes'
|
||||||
NOTES_PLACEHOLDER = 'Enter notes if needed'
|
NOTES_PLACEHOLDER = 'Enter notes if needed'
|
||||||
NOT_AUTHORIZED = 'Not Authorized!'
|
NOT_AUTHORIZED = 'Not Authorized!'
|
||||||
@@ -94,6 +97,7 @@ REASON = 'Reason for Facility Access'
|
|||||||
REASONCOMPANY = 'Company / Reason'
|
REASONCOMPANY = 'Company / Reason'
|
||||||
REFERENCE = 'Reference'
|
REFERENCE = 'Reference'
|
||||||
REFRESH = 'Refresh'
|
REFRESH = 'Refresh'
|
||||||
|
REGION ='Region'
|
||||||
REMEQPT = 'Remove Equipment'
|
REMEQPT = 'Remove Equipment'
|
||||||
REPORTS = 'Reports'
|
REPORTS = 'Reports'
|
||||||
REPORTS_DESC = 'The drop-down below can be used to select pre-configured reports. Other reports are currently being written.'
|
REPORTS_DESC = 'The drop-down below can be used to select pre-configured reports. Other reports are currently being written.'
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ ACTIVEVISITS = 'Visitas activas'
|
|||||||
ADDEQPT = 'Agregar Equipo'
|
ADDEQPT = 'Agregar Equipo'
|
||||||
ADD_USER = 'Agregar usuario'
|
ADD_USER = 'Agregar usuario'
|
||||||
ADD_USER_DESC = '¡Todos los campos son obligatorios! El nombre de usuario y el correo electrónico deben ser únicos. La longitud mínima de la contraseña es '
|
ADD_USER_DESC = '¡Todos los campos son obligatorios! El nombre de usuario y el correo electrónico deben ser únicos. La longitud mínima de la contraseña es '
|
||||||
|
ADD_SITE = 'Agregar sitio'
|
||||||
|
SADMIN = 'Administrador de ubicación'
|
||||||
ADMIN = 'Administrador'
|
ADMIN = 'Administrador'
|
||||||
ADMINISTRATION = 'Administración'
|
ADMINISTRATION = 'Administración'
|
||||||
ALL = 'Todos'
|
ALL = 'Todos'
|
||||||
@@ -74,6 +76,7 @@ NAME = 'Nombre'
|
|||||||
NEW = 'Nuevo'
|
NEW = 'Nuevo'
|
||||||
NONEAVA = 'Nada'
|
NONEAVA = 'Nada'
|
||||||
NOSIGNIN = 'No completó'
|
NOSIGNIN = 'No completó'
|
||||||
|
NOSITE = 'Ningún sitio seleccionado'
|
||||||
NOTES = 'Notas'
|
NOTES = 'Notas'
|
||||||
NOTES_PLACEHOLDER = 'Introduce notas si es necesario'
|
NOTES_PLACEHOLDER = 'Introduce notas si es necesario'
|
||||||
NOT_AUTHORIZED = '¡No autorizado!'
|
NOT_AUTHORIZED = '¡No autorizado!'
|
||||||
@@ -94,6 +97,7 @@ REASON = 'Razón para el acceso a las instalaciones'
|
|||||||
REASONCOMPANY = 'Empresa / Razón'
|
REASONCOMPANY = 'Empresa / Razón'
|
||||||
REFERENCE = 'Referencia'
|
REFERENCE = 'Referencia'
|
||||||
REFRESH = 'Recargar'
|
REFRESH = 'Recargar'
|
||||||
|
REGION ='Región'
|
||||||
REMEQPT = 'Llevar Equipo'
|
REMEQPT = 'Llevar Equipo'
|
||||||
REPORTS = 'Informes'
|
REPORTS = 'Informes'
|
||||||
REPORTS_DESC = 'El menú desplegable a continuación se puede utilizar para seleccionar informes preconfigurados. Otros informes se están escribiendo actualmente.'
|
REPORTS_DESC = 'El menú desplegable a continuación se puede utilizar para seleccionar informes preconfigurados. Otros informes se están escribiendo actualmente.'
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ ACTIVEVISITS = 'Visites actives'
|
|||||||
ADDEQPT = 'Ajouter un équipement'
|
ADDEQPT = 'Ajouter un équipement'
|
||||||
ADD_USER = 'Ajouter un utilisateur'
|
ADD_USER = 'Ajouter un utilisateur'
|
||||||
ADD_USER_DESC = 'Tous les champs sont requis! Le nom d'utilisateur et l'adresse e-mail doivent être uniques. La longueur minimale du mot de passe est '
|
ADD_USER_DESC = 'Tous les champs sont requis! Le nom d'utilisateur et l'adresse e-mail doivent être uniques. La longueur minimale du mot de passe est '
|
||||||
|
ADD_SITE = 'Ajouter un site'
|
||||||
|
SADMIN = 'Administrateur d'emplacement'
|
||||||
ADMIN = 'Administrateur'
|
ADMIN = 'Administrateur'
|
||||||
ADMINISTRATION = 'Administration'
|
ADMINISTRATION = 'Administration'
|
||||||
ALL = 'Tout'
|
ALL = 'Tout'
|
||||||
@@ -74,6 +76,7 @@ NAME = 'Nom complet'
|
|||||||
NEW = 'Nouveau'
|
NEW = 'Nouveau'
|
||||||
NONEAVA = 'Aucun'
|
NONEAVA = 'Aucun'
|
||||||
NOSIGNIN = 'Pas de connexion'
|
NOSIGNIN = 'Pas de connexion'
|
||||||
|
NOSITE = 'Aucun site sélectionné'
|
||||||
NOTES = 'Notes'
|
NOTES = 'Notes'
|
||||||
NOTES_PLACEHOLDER = 'Entrez des notes si nécessaire'
|
NOTES_PLACEHOLDER = 'Entrez des notes si nécessaire'
|
||||||
NOT_AUTHORIZED = 'Pas autorisé!'
|
NOT_AUTHORIZED = 'Pas autorisé!'
|
||||||
@@ -94,6 +97,7 @@ REASON = 'Raison de l’accès aux installations'
|
|||||||
REASONCOMPANY = 'Organisation / Raison'
|
REASONCOMPANY = 'Organisation / Raison'
|
||||||
REFERENCE = 'Reference'
|
REFERENCE = 'Reference'
|
||||||
REFRESH = 'Actualiser'
|
REFRESH = 'Actualiser'
|
||||||
|
REGION ='Région'
|
||||||
REMEQPT = 'Remove Equipment'
|
REMEQPT = 'Remove Equipment'
|
||||||
REPORTS = 'Rapports'
|
REPORTS = 'Rapports'
|
||||||
REPORTS_DESC = 'Le menu déroulant ci-dessous peut être utilisé pour sélectionner des rapports préconfigurés. D'autres rapports sont en cours de rédaction.'
|
REPORTS_DESC = 'Le menu déroulant ci-dessous peut être utilisé pour sélectionner des rapports préconfigurés. D'autres rapports sont en cours de rédaction.'
|
||||||
|
|||||||
192
users.php
192
users.php
@@ -23,14 +23,27 @@
|
|||||||
session_save_path('.tmp'); // TEMP
|
session_save_path('.tmp'); // TEMP
|
||||||
session_start(); // START
|
session_start(); // START
|
||||||
require_once __DIR__ . '/autoload.php'; // AUTOLOAD
|
require_once __DIR__ . '/autoload.php'; // AUTOLOAD
|
||||||
$StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // CLASSES
|
$StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // DEFAULT CLASSES
|
||||||
|
$SiteInfo = new \App\LobbySIO\Database\SiteInfo();
|
||||||
$Users = new \App\LobbySIO\Database\Users();
|
$Users = new \App\LobbySIO\Database\Users();
|
||||||
if(!isset($_COOKIE['app_disp_lang'])) { $app_disp_lang = $StaticFunctions->getDefaultLanguage(); } else { $app_disp_lang = $_COOKIE['app_disp_lang']; };
|
if (isset($_SESSION['user_id'])) { // LOGGED IN? GET USER OBJECT
|
||||||
$Translate = new \App\LobbySIO\Language\Translate($app_disp_lang);
|
$session_user = $Users->getUserInfo($_SESSION['user_id'], "1", "0"); }
|
||||||
$transLang = $Translate->userLanguage(); // SETUP TRANSLATOR
|
if (isset($session_user)) { // GET UID OR SET TO KIOSK
|
||||||
$app_current_pagename = $transLang['ADMINISTRATION']; // PAGE FUNCTION
|
$uid = $session_user["0"]["users_id"];} else { $uid = "2"; }
|
||||||
$app_current_pageicon = '<i class="fas fa-list"></i> '; // PAGE ICON
|
$app_disp_lang = filter_input(INPUT_COOKIE, 'app_disp_lang'); // SETUP LANGUAGE
|
||||||
require_once("inc/header.inc.php"); // SHOW HEADER
|
if(!isset($app_disp_lang)) {
|
||||||
|
$app_disp_lang=$StaticFunctions->getDefaultLanguage(); }
|
||||||
|
$siteidcookie = filter_input(INPUT_COOKIE, 'app_site'); // SETUP SITE
|
||||||
|
foreach($SiteInfo->getSite("0", $uid, "0", "0") as $arr) {
|
||||||
|
$lookup_array[$arr['sites_id']]=1; }
|
||||||
|
if(isset($lookup_array[$siteidcookie])) {
|
||||||
|
$siteid = $siteidcookie; } else { $siteid = "1"; }
|
||||||
|
if(!isset($siteid)) { $siteid="1"; }
|
||||||
|
$Translate = new \App\LobbySIO\Language\Translate($app_disp_lang); // SETUP TRANSLATOR
|
||||||
|
$transLang = $Translate->userLanguage();
|
||||||
|
$app_current_pagename = $transLang['ADMINISTRATION']; // PAGE SETUP
|
||||||
|
$app_current_pageicon = '<i class="fas fa-list"></i> ';
|
||||||
|
require_once("inc/header.inc.php");
|
||||||
if ($StaticFunctions->getSessionStatus() == false) { // CHECK STATUS
|
if ($StaticFunctions->getSessionStatus() == false) { // CHECK STATUS
|
||||||
echo $StaticFunctions->killSession(); // ELSE DIE
|
echo $StaticFunctions->killSession(); // ELSE DIE
|
||||||
} else { ?>
|
} else { ?>
|
||||||
@@ -38,9 +51,36 @@
|
|||||||
|
|
||||||
<?php if (isset($session_user)) { if($session_user["0"]["users_usertype"] !== "ADMIN") { header("Location: index.php"); ?><h2 class="content-subhead"><?php echo $transLang['NOT_AUTHORIZED']; ?></h2><?php }; }; ?>
|
<?php if (isset($session_user)) { if($session_user["0"]["users_usertype"] !== "ADMIN") { header("Location: index.php"); ?><h2 class="content-subhead"><?php echo $transLang['NOT_AUTHORIZED']; ?></h2><?php }; }; ?>
|
||||||
|
|
||||||
<?php
|
<?php // POST ACTIONS
|
||||||
|
|
||||||
|
if (!empty($_POST['newsite'])): // NEW SITE
|
||||||
|
$SiteInfo->addSite($_POST['sitename'], $_POST['timezone'], $_POST['region']);
|
||||||
|
header('Location: ' . $_SERVER['PHP_SELF']);
|
||||||
|
endif;
|
||||||
|
|
||||||
|
if (!empty($_POST['newuser'])): // NEW USER
|
||||||
|
require_once("src/Misc/PasswordHash.php");
|
||||||
|
if (empty($_POST['username'])): $errors['username'] = $transLang['USERNAME_NOTEMPTY']; endif;
|
||||||
|
if (preg_match('/[^a-zA-Z0-9 .-_]/', $_POST['username'])): $errors['username'] = $transLang['ILLEGAL_CHARACTERS']; endif;
|
||||||
|
if (empty($_POST['password'])): $errors['password'] = $transLang['PASSWORD_NOTEMPTY']; endif;
|
||||||
|
if (strlen($_POST['password']) < $minpasslength): $errors['password'] = $transLang['MIN_PASSWORD_LENGTH'] . $minpasslength; endif;
|
||||||
|
if (empty($_POST['password_confirm'])): $errors['password_confirm'] = $transLang['PASSWORD_NOTCONFIRMED']; endif;
|
||||||
|
if ($_POST['password'] != $_POST['password_confirm']): $errors['password_confirm'] = $transLang['PASSWORD_NOTMATCH']; endif;
|
||||||
|
$email = filter_var($_POST['email'], FILTER_VALIDATE_EMAIL);
|
||||||
|
if (!$email): $errors['email'] = $transLang['EMAIL_NOTVALID']; endif;
|
||||||
|
$existing = $Users->checkUser($_POST['username'], $email);
|
||||||
|
if ($existing):
|
||||||
|
if ($existing[0]["users_username"] == $_POST['username']): $errors['username'] = $transLang['USERNAME_USED']; endif;
|
||||||
|
if ($existing[0]["users_email"] == $email): $errors['email'] = $transLang['PASSWORD_USED']; endif;
|
||||||
|
endif;
|
||||||
|
endif;
|
||||||
|
if (!empty($_POST['newuser']) && empty($errors)):
|
||||||
|
$hasher = new PasswordHash(8, FALSE);
|
||||||
|
$password = $hasher->HashPassword($_POST['password']);
|
||||||
|
$Users->addUser($_POST['firstname'], $_POST['lastname'], $_POST['username'], $timezone, $password, $_POST['email'], $_POST['usertype']);
|
||||||
|
header('Location: ' . $_SERVER['PHP_SELF']);
|
||||||
|
endif;
|
||||||
|
|
||||||
// delete user only if submitted by button
|
|
||||||
if (!empty($_POST['deluser'])) {
|
if (!empty($_POST['deluser'])) {
|
||||||
if ($_SERVER['REQUEST_METHOD'] == 'DELETE' || ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['_METHOD'] == 'DELETE')) {
|
if ($_SERVER['REQUEST_METHOD'] == 'DELETE' || ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['_METHOD'] == 'DELETE')) {
|
||||||
$deleteid = (int) $_POST['deleteid'];
|
$deleteid = (int) $_POST['deleteid'];
|
||||||
@@ -66,7 +106,7 @@ if (0 === $row_count): else: $page_count = (int)ceil($row_count / $StaticFunctio
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- USER MGMT START -->
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
@@ -86,7 +126,7 @@ if (0 === $row_count): else: $page_count = (int)ceil($row_count / $StaticFunctio
|
|||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach($Users->getUserInfo("%", $StaticFunctions->getPageRows(), $offset) as $row): ?>
|
<?php foreach($Users->getUserInfo("%", $StaticFunctions->getPageRows(), $offset) as $row): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo $row['users_lastname'] . ", " . $row['users_firstname']; ?></td><td><?php echo $row['users_username']; ?></td><td><?php echo $row['users_email']; ?></td><td><?php echo $row['users_created']; ?></td><td><?php echo $transLang[$row['users_usertype']]; ?></td><td><form method="post" onsubmit="return confirm('<?php echo $transLang['DELETE_WARNING']; ?>')"><input type="hidden" id="_METHOD" name="_METHOD" value="DELETE" /><input type="hidden" id="deleteid" name="deleteid" value="<?php echo $row['users_id']; ?>" /><button class="button-error pure-button" id="deluser" name="deluser" value="deluser" type="submit" <?php if ($row['users_username'] == "admin"): echo "disabled"; endif; ?>><i class="fa fa-trash"></i> </button></form></td>
|
<td><?php echo $row['users_lastname'] . ", " . $row['users_firstname']; ?></td><td><?php echo $row['users_username']; ?></td><td><?php echo $row['users_email']; ?></td><td><?php echo $row['users_created']; ?></td><td><?php echo $transLang[$row['users_usertype']]; ?></td><td><form method="post" onsubmit="return confirm('<?php echo $transLang['DELETE_WARNING']; ?>')"><input type="hidden" id="_METHOD" name="_METHOD" value="DELETE" /><input type="hidden" id="deleteid" name="deleteid" value="<?php echo $row['users_id']; ?>" /><button class="btn btn-danger btn-sm" id="deluser" name="deluser" value="deluser" type="submit" <?php if ($row['users_username'] == "admin"): echo "disabled"; endif; if ($row['users_username'] == "KIOSK"): echo "disabled"; endif; ?>><i class="fa fa-trash"></i> </button></form></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -113,31 +153,6 @@ if (0 === $row_count): else: $page_count = (int)ceil($row_count / $StaticFunctio
|
|||||||
<p class="lead"><?php echo $transLang['ADD_USER_DESC'] . $minpasslength; ?></p>
|
<p class="lead"><?php echo $transLang['ADD_USER_DESC'] . $minpasslength; ?></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
|
||||||
// new user pw check
|
|
||||||
require_once("src/Misc/PasswordHash.php");
|
|
||||||
if (!empty($_POST['newuser'])):
|
|
||||||
if (empty($_POST['username'])): $errors['username'] = $transLang['USERNAME_NOTEMPTY']; endif;
|
|
||||||
if (preg_match('/[^a-zA-Z0-9 .-_]/', $_POST['username'])): $errors['username'] = $transLang['ILLEGAL_CHARACTERS']; endif;
|
|
||||||
if (empty($_POST['password'])): $errors['password'] = $transLang['PASSWORD_NOTEMPTY']; endif;
|
|
||||||
if (strlen($_POST['password']) < $minpasslength): $errors['password'] = $transLang['MIN_PASSWORD_LENGTH'] . $minpasslength; endif;
|
|
||||||
if (empty($_POST['password_confirm'])): $errors['password_confirm'] = $transLang['PASSWORD_NOTCONFIRMED']; endif;
|
|
||||||
if ($_POST['password'] != $_POST['password_confirm']): $errors['password_confirm'] = $transLang['PASSWORD_NOTMATCH']; endif;
|
|
||||||
$email = filter_var($_POST['email'], FILTER_VALIDATE_EMAIL);
|
|
||||||
if (!$email): $errors['email'] = $transLang['EMAIL_NOTVALID']; endif;
|
|
||||||
$existing = $Users->checkUser($_POST['username'], $email);
|
|
||||||
if ($existing):
|
|
||||||
if ($existing[0]["users_username"] == $_POST['username']): $errors['username'] = $transLang['USERNAME_USED']; endif;
|
|
||||||
if ($existing[0]["users_email"] == $email): $errors['email'] = $transLang['PASSWORD_USED']; endif;
|
|
||||||
endif;
|
|
||||||
endif;
|
|
||||||
if (!empty($_POST['newuser']) && empty($errors)):
|
|
||||||
$hasher = new PasswordHash(8, FALSE);
|
|
||||||
$password = $hasher->HashPassword($_POST['password']);
|
|
||||||
$Users->addUser($_POST['firstname'], $_POST['lastname'], $_POST['username'], $timezone, $password, $_POST['email'], $_POST['usertype']);
|
|
||||||
header('Location: ' . $_SERVER['PHP_SELF']);
|
|
||||||
endif;
|
|
||||||
?>
|
|
||||||
<fieldset id="registration">
|
<fieldset id="registration">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -184,27 +199,55 @@ if (0 === $row_count): else: $page_count = (int)ceil($row_count / $StaticFunctio
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- MODAL END -->
|
<!-- MODAL END -->
|
||||||
|
<!-- USER MGMT END -->
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// delete user only if submitted by button
|
||||||
|
if (!empty($_POST['delsite'])) {
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] == 'DELETE' || ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['_METHOD'] == 'DELETE')) {
|
||||||
|
$deleteid = (int) $_POST['deleteid'];
|
||||||
|
echo $SiteInfo->deleteSite($deleteid);
|
||||||
|
echo "site deleted!";
|
||||||
|
header('Location: ' . $_SERVER['PHP_SELF']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set up pagination
|
||||||
|
$page_num1 = 1;
|
||||||
|
if(!empty($_GET['pnum1'])):
|
||||||
|
$page_num1 = filter_input(INPUT_GET, 'pnum1', FILTER_VALIDATE_INT);
|
||||||
|
if(false === $page_num1):
|
||||||
|
$page_num1 = 1;
|
||||||
|
endif;
|
||||||
|
endif;
|
||||||
|
$offset1 = ($page_num1 - 1) * $StaticFunctions->getPageRows();
|
||||||
|
$row_count1 = count($SiteInfo->getSite("0", "0", "0", "0"));
|
||||||
|
$page_count1 = 0;
|
||||||
|
if (0 === $row_count1): else: $page_count1 = (int)ceil($row_count1 / $StaticFunctions->getPageRows()); if($page_num1 > $page_count1): $page_num1 = 1; endif; endif;
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!-- SITE MGMT START -->
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
<h2><?php echo $app_current_pageicon . $transLang['USERS']; ?></h2>
|
<h2><?php echo $app_current_pageicon . $transLang['SITE']; ?></h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
<button type="button" class="btn btn-block btn-lg btn-success" data-toggle="modal" data-target="#addUserModal"><?php echo $transLang['ADD_USER']; ?></button>
|
<button type="button" class="btn btn-block btn-lg btn-success" data-toggle="modal" data-target="#addSiteModal"><?php echo $transLang['ADD_SITE']; ?></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php echo '<ul class="pagination pagination-sm"><li class="page-item disabled"><a class="page-link" href="#" tabindex="-1">' . $transLang['PAGE'] . '</a></li>'; for ($i = 1; $i <= $page_count; $i++): echo '<li class="page-item'; if ($i === $page_num): echo ' active'; else: echo ' '; endif; echo '"><a class="page-link" href="' . $_SERVER['PHP_SELF'] . '?pnum=' . $i . '">' . $i . '</a></li>'; endfor; echo '</ul>'; ?>
|
<?php echo '<ul class="pagination pagination-sm"><li class="page-item disabled"><a class="page-link" href="#" tabindex="-1">' . $transLang['PAGE'] . '</a></li>'; for ($i1 = 1; $i1 <= $page_count1; $i1++): echo '<li class="page-item'; if ($i1 === $page_num1): echo ' active'; else: echo ' '; endif; echo '"><a class="page-link" href="' . $_SERVER['PHP_SELF'] . '?pnum1=' . $i1 . '">' . $i1 . '</a></li>'; endfor; echo '</ul>'; ?>
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead class="thead-dark">
|
<thead class="thead-dark">
|
||||||
<tr>
|
<tr>
|
||||||
<th><?php echo $transLang['NAME']; ?></th><th><?php echo $transLang['USERNAME']; ?></th><th><?php echo $transLang['EMAIL']; ?></th><th><?php echo $transLang['CREATED']; ?></th><th><?php echo $transLang['USERTYPE']; ?></th><th><?php echo $transLang['ACTIONS']; ?></th>
|
<th><?php echo $transLang['NAME']; ?></th><th><?php echo $transLang['TIMEZONE']; ?></th><th><?php echo $transLang['REGION']; ?></th><th><?php echo $transLang['ACTIONS']; ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach($Users->getUserInfo("%", $StaticFunctions->getPageRows(), $offset) as $row): ?>
|
<?php foreach($SiteInfo->getSite("0", "0", $StaticFunctions->getPageRows(), $offset1) as $row1): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo $row['users_lastname'] . ", " . $row['users_firstname']; ?></td><td><?php echo $row['users_username']; ?></td><td><?php echo $row['users_email']; ?></td><td><?php echo $row['users_created']; ?></td><td><?php echo $transLang[$row['users_usertype']]; ?></td><td><form method="post" onsubmit="return confirm('<?php echo $transLang['DELETE_WARNING']; ?>')"><input type="hidden" id="_METHOD" name="_METHOD" value="DELETE" /><input type="hidden" id="deleteid" name="deleteid" value="<?php echo $row['users_id']; ?>" /><button class="button-error pure-button" id="deluser" name="deluser" value="deluser" type="submit" <?php if ($row['users_username'] == "admin"): echo "disabled"; endif; ?>><i class="fa fa-trash"></i> </button></form></td>
|
<td><?php echo $row1['sites_name']; ?></td><td><?php echo $row1['sites_timezone']; ?></td><td><?php echo $row1['sites_region']; ?></td><td><form method="post" onsubmit="return confirm('<?php echo $transLang['DELETE_WARNING']; ?>')"><input type="hidden" id="_METHOD" name="_METHOD" value="DELETE" /><input type="hidden" id="deleteid" name="deleteid" value="<?php echo $row1['sites_id']; ?>" /><button class="btn btn-danger btn-sm" id="deluser" name="delsite" value="delsite" type="submit"><i class="fa fa-trash"></i> </button></form></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -215,11 +258,11 @@ if (0 === $row_count): else: $page_count = (int)ceil($row_count / $StaticFunctio
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- MODAL START -->
|
<!-- MODAL START -->
|
||||||
<div class="modal fade" id="addUserModal" tabindex="-1" role="dialog" aria-labelledby="Site" aria-hidden="true">
|
<div class="modal fade" id="addSiteModal" tabindex="-1" role="dialog" aria-labelledby="Site" aria-hidden="true">
|
||||||
<div class="modal-dialog" role="document">
|
<div class="modal-dialog" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title" id="AddUser"><?php echo $transLang['ADD_USER']; ?></h5>
|
<h5 class="modal-title" id="AddSite"><?php echo $transLang['ADD_SITE']; ?></h5>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -228,69 +271,33 @@ if (0 === $row_count): else: $page_count = (int)ceil($row_count / $StaticFunctio
|
|||||||
<form class="form-inline my-2 my-lg-0" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
|
<form class="form-inline my-2 my-lg-0" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
<p class="lead"><?php echo $transLang['ADD_USER_DESC'] . $minpasslength; ?></p>
|
<p class="lead"><?php echo $transLang['ADD_SITE']; ?></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
|
||||||
// new user pw check
|
|
||||||
require_once("src/Misc/PasswordHash.php");
|
|
||||||
if (!empty($_POST['newuser'])):
|
|
||||||
if (empty($_POST['username'])): $errors['username'] = $transLang['USERNAME_NOTEMPTY']; endif;
|
|
||||||
if (preg_match('/[^a-zA-Z0-9 .-_]/', $_POST['username'])): $errors['username'] = $transLang['ILLEGAL_CHARACTERS']; endif;
|
|
||||||
if (empty($_POST['password'])): $errors['password'] = $transLang['PASSWORD_NOTEMPTY']; endif;
|
|
||||||
if (strlen($_POST['password']) < $minpasslength): $errors['password'] = $transLang['MIN_PASSWORD_LENGTH'] . $minpasslength; endif;
|
|
||||||
if (empty($_POST['password_confirm'])): $errors['password_confirm'] = $transLang['PASSWORD_NOTCONFIRMED']; endif;
|
|
||||||
if ($_POST['password'] != $_POST['password_confirm']): $errors['password_confirm'] = $transLang['PASSWORD_NOTMATCH']; endif;
|
|
||||||
$email = filter_var($_POST['email'], FILTER_VALIDATE_EMAIL);
|
|
||||||
if (!$email): $errors['email'] = $transLang['EMAIL_NOTVALID']; endif;
|
|
||||||
$existing = $Users->checkUser($_POST['username'], $email);
|
|
||||||
if ($existing):
|
|
||||||
if ($existing[0]["users_username"] == $_POST['username']): $errors['username'] = $transLang['USERNAME_USED']; endif;
|
|
||||||
if ($existing[0]["users_email"] == $email): $errors['email'] = $transLang['PASSWORD_USED']; endif;
|
|
||||||
endif;
|
|
||||||
endif;
|
|
||||||
if (!empty($_POST['newuser']) && empty($errors)):
|
|
||||||
$hasher = new PasswordHash(8, FALSE);
|
|
||||||
$password = $hasher->HashPassword($_POST['password']);
|
|
||||||
$Users->addUser($_POST['firstname'], $_POST['lastname'], $_POST['username'], $timezone, $password, $_POST['email'], $_POST['usertype']);
|
|
||||||
header('Location: ' . $_SERVER['PHP_SELF']);
|
|
||||||
endif;
|
|
||||||
?>
|
|
||||||
<fieldset id="registration">
|
<fieldset id="registration">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
<input type="text" class="form-control" id="firstname" name="firstname" placeholder="First Name" required />
|
<input type="text" class="form-control" id="sitename" name="sitename" placeholder="Site Name" required />
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
<input type="text" class="form-control" id="lastname" name="lastname" placeholder="Last Name" required />
|
<select class="form-control" id="timezone" name="timezone" required>
|
||||||
|
<option value=""><?php echo $transLang['TIMEZONE']; ?></option>
|
||||||
|
<?php foreach(DateTimeZone::listIdentifiers(DateTimeZone::ALL) as $row2) { ?><option><?php echo $row2; ?></option><?php }; ?>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
<input type="text" class="form-control" id="username" name="username" placeholder="Username" required />
|
<select class="form-control" id="region" name="region" required>
|
||||||
</div>
|
<option value=""><?php echo $transLang['REGION']; ?></option>
|
||||||
<div class="col-sm">
|
<option>CAN</option>
|
||||||
<input type="text" class="form-control" id="email" name="email" placeholder="Email" />
|
<option>EMEA</option>
|
||||||
</div>
|
<option>US</option>
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm">
|
|
||||||
<input type="password" class="form-control" id="password" name="password" placeholder="Password" required />
|
|
||||||
</div>
|
|
||||||
<div class="col-sm">
|
|
||||||
<input type="password" class="form-control" id="password_confirm" name="password_confirm" placeholder="Confirm Password" required />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm">
|
|
||||||
<select class="custom-select" id="usertype" aria-label="<?php echo $transLang['ACCESS_LEVEL']; ?>" name="usertype" required>
|
|
||||||
<option value="" selected><?php echo $transLang['CHOOSE']; ?> <?php echo $transLang['ACCESS_LEVEL']; ?></option><?php foreach($Users->getUserTypeInfo("%") as $row): ?>
|
|
||||||
<option value="<?php echo $row['usertypes_id']; ?>"><?php echo $transLang[$row['usertypes_name']]; ?></option><?php endforeach; ?>
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
<button type="submit" class="form-control btn btn-block btn-primary" value="Submit" name="newuser"><i class="fa fa-user-plus"></i> <?php echo $transLang['ADD_USER']; ?></button>
|
<button type="submit" class="form-control btn btn-block btn-primary" value="Submit" name="newsite"><i class="fa fa-user-plus"></i> <?php echo $transLang['ADD_SITE']; ?></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -302,6 +309,7 @@ if (0 === $row_count): else: $page_count = (int)ceil($row_count / $StaticFunctio
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- MODAL END -->
|
<!-- MODAL END -->
|
||||||
|
<!-- SITE MGMT END -->
|
||||||
|
|
||||||
|
|
||||||
<!-- CONTENT END -->
|
<!-- CONTENT END -->
|
||||||
|
|||||||
Reference in New Issue
Block a user