From 6907d88fcb2f8f19c290cabe5a0b3832a3d9b497 Mon Sep 17 00:00:00 2001 From: Josh North Date: Fri, 18 Jun 2021 17:03:32 -0400 Subject: [PATCH] lang, signout --- inc/header.inc.php | 1 - signout.php | 166 +++++++++++++++++++------------ src/Language/de.lang.ini.example | 2 + src/Language/en.lang.ini.example | 2 + src/Language/es.lang.ini.example | 2 + src/Language/fr.lang.ini.example | 2 + users.php | 20 ++-- 7 files changed, 118 insertions(+), 77 deletions(-) diff --git a/inc/header.inc.php b/inc/header.inc.php index 568bdbf..98a702d 100644 --- a/inc/header.inc.php +++ b/inc/header.inc.php @@ -100,7 +100,6 @@ - diff --git a/signout.php b/signout.php index 1e091eb..b5a99e7 100644 --- a/signout.php +++ b/signout.php @@ -27,7 +27,7 @@ session_save_path('.tmp'); // TEMP session_start(); // START require_once __DIR__ . '/autoload.php'; // AUTOLOAD - use App\LobbySIO\Misc\Csrf; // ANTICSRF + use App\LobbySIO\Misc\Csrf; // ANTICSRF $StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // DEFAULT CLASSES $SiteInfo = new \App\LobbySIO\Database\SiteInfo(); $Users = new \App\LobbySIO\Database\Users(); @@ -65,84 +65,118 @@ - -endVisit($_POST['endvisit'], $StaticFunctions->getUTC()); + (string)FILTER_SANITIZE_STRING, + 'fd_pageNumber' => (int)FILTER_VALIDATE_INT, + 'fd_endVisitForId' => (int)FILTER_VALIDATE_INT +]); +if(empty($form_data['fd_formAction'])){ + $form_data['fd_formAction'] = 'fa_initial'; // SET INITIAL STAGE +} ?> - -
-
+ + + +getPageRows(); + $pgRowCount=(int)count($VisitInfo->getVisitInfo($siteid, $isApproved, "empty", "%", "%", "%", "%", "%", "%")); + $pgCount=(int)0; + if(0===$pgRowCount){}else{$pgCount=(int)ceil($pgRowCount/$StaticFunctions->getPageRows());if($pgNum>$pgCount){$pgNum=(int)1;}} +?> + +
+
-

+

+
+
+
+ +
    +
  • + +
  • + +
+
+
+
+
- -getPageRows(); - $row_count = count($VisitInfo->getVisitInfo($siteid, $approval, "empty", "%", "%", "%", "%", "%", "%")); - $page_count = 0; - if (0 === $row_count): else: $page_count = (int)ceil($row_count / $StaticFunctions->getPageRows()); if($page_num > $page_count): $page_num = 1; endif; endif; -?> - -
-
-
-

-
-
- -
-
-
- -
  • - -
  • - -
- - - - - -getVisitInfo($siteid, $approval, "empty", "%", "%", "%", "%", $StaticFunctions->getPageRows(), $offset) as $row): - $timein = new DateTime($row['visits_intime'], new DateTimeZone('UTC')); - $timein->setTimezone(new DateTimeZone("$timezone")); - $timein_disp = $timein->format('Y-m-d H:i:s'); - $isvendor = $row['visits_isvendor']; -?> - - + + + +

'; } ?> +
+ + + + + + + + + getVisitInfo($siteid, $isApproved, "empty", "%", "%", "%", "%", $StaticFunctions->getPageRows(), $pgOffset) as $row) { + $timein = new DateTime($row['visits_intime'], new DateTimeZone('UTC')); + $timein->setTimezone(new DateTimeZone("$timezone")); + $timein_disp = $timein->format('Y-m-d H:i:s'); + $isvendor = $row['visits_isvendor']; + ?> + + + + + + - - -

'; } ?> getInfoVendorVisitFinal($row['visits_id']) as $rowvm) { $db_vendorinfo_workcompleted = $rowvm['db_vendorinfo_workcompleted']; $db_vendorinfo_sitecleanup = $rowvm['db_vendorinfo_sitecleanup']; if ($db_vendorinfo_workcompleted === 1 && $db_vendorinfo_sitecleanup === 1) { $finalvendorformcomplete=1; } else { $finalvendorformcomplete=0; } if($finalvendorformcomplete===1){ ?> - + - - + + - -
+
+
- - + - -endVisit($form_data['fd_endVisitForId'], $StaticFunctions->getUTC()); ?> + +
+
+
+

+
+
+
+
+ +
+
+
+
+

+
+
+
+ + + +"; } // INVALID STAGE - GO HOME +} require_once("inc/footer.inc.php"); // PRINT FOOTER diff --git a/src/Language/de.lang.ini.example b/src/Language/de.lang.ini.example index 583c48e..a666a5a 100644 --- a/src/Language/de.lang.ini.example +++ b/src/Language/de.lang.ini.example @@ -120,6 +120,8 @@ SIGNINBY = 'Geprüft von' SIGNIN_THANKYOU = 'Danke, dass Sie sich angemeldet haben. Wir werden Ihnen in Kürze ein Badge zuweisen.' SIGNOUT = 'Abmelden' SIGNOUT_THANKYOU = 'Danke - Sie wurden erfolgreich abgemeldet.' +STR_SIGNOUT_THANKYOU_TITLE = 'Danke!' +STR_SIGNOUT_THANKYOU_DESC = 'Sie wurden erfolgreich abgemeldet. Danke für Ihren Besuch.' SOFTWARE_VERSION = 'Version' SSANUM = 'SSA-Ticketnummer' STATEID = 'Staat ID' diff --git a/src/Language/en.lang.ini.example b/src/Language/en.lang.ini.example index fd709d9..937c6dc 100644 --- a/src/Language/en.lang.ini.example +++ b/src/Language/en.lang.ini.example @@ -120,6 +120,8 @@ SIGNINBY = 'Sign-In By' SIGNIN_THANKYOU = 'Thank you for signing in. We will assign a badge shortly.' SIGNOUT = 'Sign Out' SIGNOUT_THANKYOU = 'Thank you - you have been successfully signed out.' +STR_SIGNOUT_THANKYOU_TITLE = 'Thank You!' +STR_SIGNOUT_THANKYOU_DESC = 'You have been successfully signed out. Thank you for visiting.' SOFTWARE_VERSION = 'Version' SSANUM = 'SSA Ticket #' STATEID = 'State ID' diff --git a/src/Language/es.lang.ini.example b/src/Language/es.lang.ini.example index 51cd2a9..bc276fa 100644 --- a/src/Language/es.lang.ini.example +++ b/src/Language/es.lang.ini.example @@ -120,6 +120,8 @@ SIGNINBY = 'Verificada por' SIGNIN_THANKYOU = 'Gracias por iniciar sesión. Le asignaremos una credencial en breve.' SIGNOUT = 'Salida del cliente' SIGNOUT_THANKYOU = 'Gracias, te has desconectado.' +STR_SIGNOUT_THANKYOU_TITLE = '¡Gracias!' +STR_SIGNOUT_THANKYOU_DESC = 'Se ha cerrado correctamente. Gracias por su visita.' SOFTWARE_VERSION = 'Versión del software' SSANUM = 'Número de boleto de la SSA' STATEID = 'Identificación del estado' diff --git a/src/Language/fr.lang.ini.example b/src/Language/fr.lang.ini.example index b060a75..f78188b 100644 --- a/src/Language/fr.lang.ini.example +++ b/src/Language/fr.lang.ini.example @@ -120,6 +120,8 @@ SIGNINBY = 'Vérifié par' SIGNIN_THANKYOU = 'Merci pour votre connexion. Nous attribuerons un badge dans quelques instants.' SIGNOUT = 'Se déconnecter' SIGNOUT_THANKYOU = 'Merci - vous avez été déconnecté avec succès.' +STR_SIGNOUT_THANKYOU_TITLE = 'Merci!' +STR_SIGNOUT_THANKYOU_DESC = 'Vous avez été déconnecté avec succès. Merci pour votre visite.' SOFTWARE_VERSION = 'Version' SSANUM = 'Numéro de billet SSA' STATEID = 'Identifiant d'état' diff --git a/users.php b/users.php index a4fd307..ec36410 100644 --- a/users.php +++ b/users.php @@ -203,7 +203,7 @@ if (!empty($form_data['edituser'])) { $edituser = $Users->getUserInfo($form_data $newsiteid = $SiteInfo->getSiteByID($_POST['sitename']); $SiteInfo->grantSitePermissionBySiteAndUser($newsiteid["0"]["id"], "1"); $SiteInfo->grantSitePermissionBySiteAndUser($newsiteid["0"]["id"], "2"); - header('Location: ' . $_SERVER['PHP_SELF']); + header('Location: users.php'); endif; @@ -228,7 +228,7 @@ if (Registry::AUTHMETHOD == 'INTERNAL') { $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']); + header('Location: users.php'); endif; } elseif (Registry::AUTHMETHOD == 'SAML') { @@ -243,9 +243,9 @@ if (Registry::AUTHMETHOD == 'INTERNAL') { endif; if (!empty($_POST['newuser']) && empty($errors)): $Users->addSAMLUser($timezone, $_POST['email'], $_POST['usertype']); - header('Location: ' . $_SERVER['PHP_SELF']); + header('Location: users.php'); endif; -}; +} if (!empty($_POST['editusercomplete'])): // EDIT USER if (Registry::AUTHMETHOD == 'INTERNAL') { @@ -279,7 +279,7 @@ if (Registry::AUTHMETHOD == 'INTERNAL') { foreach($_POST['sitepermissions'] as $editsitepermission) { $SiteInfo->grantSitePermissionBySiteAndUser($editsitepermission, $_POST['edituserid']); } - header('Location: ' . $_SERVER['PHP_SELF']); + header('Location: users.php'); endif; @@ -290,7 +290,7 @@ if (Registry::AUTHMETHOD == 'INTERNAL') { $deleteid = (int) $_POST['deleteid']; echo $Users->deleteUser($deleteid); echo "user deleted!"; - header('Location: ' . $_SERVER['PHP_SELF']); + header('Location: users.php'); } } @@ -484,7 +484,7 @@ if (!empty($_POST['delsite'])) { $SiteInfo->deleteSitePermissionByUserAndSite ('2', $deleteid); echo $SiteInfo->deleteSite($deleteid); echo "site deleted!"; - header('Location: ' . $_SERVER['PHP_SELF']); + header('Location: users.php'); } } @@ -555,7 +555,7 @@ if (0 === $row_count1): else: $page_count1 = (int)ceil($row_count1 / $StaticFunc