consolidation, cleanup, security, users and admin page updates and fixes

This commit is contained in:
Josh North 2021-06-16 23:17:53 -04:00
parent 4de9eca8d6
commit 9eb76b2c4a
6 changed files with 423 additions and 316 deletions

View File

@ -84,99 +84,126 @@
<!-- START CONTENT -->
<?php
// FILTER POSTED DATA
$form_data = filter_input_array(INPUT_POST, [
'form_data_saveprofile' => (string)FILTER_SANITIZE_STRING,
'form_data_passwordinitial' => (string)FILTER_SANITIZE_STRING,
'form_data_passwordconfirm' => (string)FILTER_SANITIZE_STRING,
'form_data_firstname' => (string)FILTER_SANITIZE_STRING,
'form_data_lastname' => (string)FILTER_SANITIZE_STRING,
'form_data_email' => (string)FILTER_SANITIZE_STRING
]);
$minpasslength = $StaticFunctions->getMinPass();
if (isset($_POST['saveprofile'])):
if (empty($_POST['password']) && empty($_POST['newpassword2'])):
$Users->setUserInfo($session_user["0"]["users_id"], $_POST['firstname'], $_POST['lastname'], $_POST['email'], $session_user["0"]["users_usertypeid"], $session_user["0"]["users_password"]);
header('Location: ' . $_SERVER['PHP_SELF']);
elseif (strlen($_POST['password']) < $minpasslength):
if (isset($form_data['form_data_saveprofile'])):
if (empty($form_data['form_data_passwordinitial']) && empty($form_data['form_data_passwordconfirm'])):
$Users->setUserInfo($session_user["0"]["users_id"], $form_data['form_data_firstname'], $form_data['form_data_lastname'], $form_data['form_data_email'], $session_user["0"]["users_usertypeid"], $session_user["0"]["users_password"]);
header('Location: profile.php');
elseif (strlen($form_data['form_data_passwordinitial']) < $minpasslength):
echo "Password must be at least $minpasslength characters.";
elseif (!empty($_POST['password']) && empty($_POST['newpassword2'])):
elseif (!empty($form_data['form_data_passwordinitial']) && empty($form_data['form_data_passwordconfirm'])):
echo "Please confirm password if you wish to change it";
elseif ($_POST['password'] != $_POST['newpassword2']):
elseif ($form_data['form_data_passwordinitial'] != $form_data['form_data_passwordconfirm']):
echo "New passwords do not match";
elseif (!empty($_POST['password']) && ($_POST['password'] = $_POST['newpassword2'])):
elseif (!empty($form_data['form_data_passwordinitial']) && ($form_data['form_data_passwordinitial'] = $form_data['form_data_passwordconfirm'])):
// change pass
require_once("src/Misc/PasswordHash.php");
$hasher = new PasswordHash(8, FALSE);
$password = $hasher->HashPassword($_POST['password']);
$Users->setUserInfo($session_user["0"]["users_id"], $_POST['firstname'], $_POST['lastname'], $_POST['email'], $session_user["0"]["users_usertypeid"], $password);
header('Location: ' . $_SERVER['PHP_SELF']);
$password = $hasher->HashPassword($form_data['form_data_passwordinitial']);
$Users->setUserInfo($session_user["0"]["users_id"], $form_data['form_data_firstname'], $form_data['form_data_lastname'], $form_data['form_data_email'], $session_user["0"]["users_usertypeid"], $password);
header('Location: profile.php');
endif;
endif;
?>
<div class="container">
<div class="row row-cols-1">
<div class="container-fluid">
<div class="row row-cols-3 mb-2">
<div class="col d-grid gap-2">
<h2><i class="fas fa-user-circle"></i> <?php echo $transLang['EDIT_PROFILE']; ?></h2>
</div>
<div class="col d-grid gap-2 text-center">
</div>
<div class="col text-end">
<a href="profile.php" type="button" class="btn btn-primary btn-lg"><i class="fa fa-redo"></i> <?php echo $transLang['REFRESH']; ?></a>
</div>
</div>
<?php if (Registry::AUTHMETHOD == 'INTERNAL') { ?>
<p class="lead"><?php echo $transLang['ACCOUNT_INFO_DESC'] . $minpasslength; ?></p>
<?php } ?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<?php if (Registry::AUTHMETHOD == 'INTERNAL') { ?>
<div class="row row-cols-1 mb-2">
<div class="col d-grid gap-2">
<p class="lead"><?php echo $transLang['ACCOUNT_INFO_DESC'] . $minpasslength; ?></p>
</div>
</div>
<?php } elseif (Registry::AUTHMETHOD == 'SAML') { ?>
<div class="row row-cols-1 mb-2">
<div class="col d-grid gap-2">
<p class="lead"><?php echo $transLang['ACCOUNT_INFO_AUTHLOCKED']; ?></p>
</div>
</div>
<?php } ?>
<form method="post">
<fieldset>
<div class="row row-cols-3">
<div class="col">
<div class="input-group input-group-sm mb-0">
<span class="input-group-text bg-info text-dark"><?php echo $transLang['USER-USERNAME']; ?></span>
<input class="form-control form-control-sm" type="text" name="username" id="username" maxlength="50" value="<?php echo $session_user["0"]["users_username"]; ?>" readonly />
</div>
</div>
<div class="col">
<div class="input-group input-group-sm mb-0">
<span class="input-group-text bg-info text-dark"><?php echo $transLang['CREATED']; ?></span>
<input class="form-control form-control-sm" type="text" name="created" id="created" value="<?php echo $session_user["0"]["users_created"]; ?>" readonly />
</div>
</div>
<div class="col">
<div class="input-group input-group-sm mb-0">
<span class="input-group-text bg-info text-dark"><?php echo $transLang['USER-TYPE']; ?></span>
<input class="form-control form-control-sm" type="text" name="usertype" id="usertype" maxlength="50" value="<?php echo $transLang[$session_user["0"]["users_usertype"]]; ?>" readonly />
</div>
</div>
</div>
<div class="row row-cols-3">
<div class="col">
<div class="input-group input-group-sm mb-0">
<span class="input-group-text bg-info text-dark"><?php echo $transLang['FIRSTNAME']; ?></span>
<input class="form-control" type="text" name="firstname" id="firstname" maxlength="50" value="<?php echo $session_user["0"]["users_firstname"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } ?>/>
</div>
</div>
<div class="col">
<div class="input-group input-group-sm mb-0">
<span class="input-group-text bg-info text-dark"><?php echo $transLang['LASTNAME']; ?></span>
<input class="form-control" type="text" name="lastname" id="lastname" maxlength="50" value="<?php echo $session_user["0"]["users_lastname"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } ?>/>
</div>
</div>
<div class="col">
<div class="input-group input-group-sm mb-0">
<span class="input-group-text bg-info text-dark"><?php echo $transLang['EMAIL']; ?></span>
<input class="form-control" type="text" name="email" id="email" maxlength="100" value="<?php echo $session_user["0"]["users_email"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } ?>/>
</div>
</div>
</div>
<?php if (Registry::AUTHMETHOD == 'INTERNAL') { ?>
<div class="row row-cols-3">
<div class="col">
<div class="input-group input-group-sm mb-0">
<span class="input-group-text bg-info text-dark"><?php echo $transLang['NEW'] . " " . $transLang['PASSWORD']; ?></span>
<input class="form-control" type="password" name="password" id="password" />
</div>
</div>
<div class="col">
<div class="input-group input-group-sm mb-0">
<span class="input-group-text bg-info text-dark"><?php echo $transLang['STR_COMMON_CONFIRM'] . " " . $transLang['NEW'] . " " . $transLang['PASSWORD']; ?></span>
<input class="form-control" type="password" name="newpassword2" id="newpassword2" />
<div class="row row-cols-2 mb-2">
<div class="col d-grid gap-2">
<div class="input-group">
<span class="input-group-text"><?php echo $transLang['USER-USERNAME']; ?></span>
<input class="form-control bg-white" type="text" name="username" id="username" maxlength="50" value="<?php echo $session_user["0"]["users_username"]; ?>" readonly />
</div>
</div>
<div class="col d-grid gap-2">
<div class="input-group input-group-sm mb-0">
<button type="submit" name="saveprofile" id="saveprofile" class="form-control btn btn-primary"><i class="fas fa-save"></i>&nbsp;<?php echo $transLang['STR_COMMON_SAVE']; ?></button>
<div class="input-group">
<span class="input-group-text"><?php echo $transLang['CREATED']; ?></span>
<input class="form-control bg-white" type="text" name="created" id="created" value="<?php echo $session_user["0"]["users_created"]; ?>" readonly />
</div>
</div>
</div>
<?php } ?>
<div class="row row-cols-2 mb-2">
<div class="col d-grid gap-2">
<div class="input-group">
<span class="input-group-text"><?php echo $transLang['USER-TYPE']; ?></span>
<input class="form-control bg-white" type="text" name="usertype" id="usertype" maxlength="50" value="<?php echo $transLang[$session_user["0"]["users_usertype"]]; ?>" readonly />
</div>
</div>
<div class="col d-grid gap-2">
<div class="input-group">
<span class="input-group-text"><?php echo $transLang['EMAIL']; ?></span>
<input class="form-control bg-white" type="text" name="form_data_email" id="form_data_email" maxlength="100" value="<?php echo $session_user["0"]["users_email"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } ?>/>
</div>
</div>
</div>
<div class="row row-cols-2 mb-2">
<div class="col d-grid gap-2">
<div class="input-group">
<span class="input-group-text"><?php echo $transLang['FIRSTNAME']; ?></span>
<input class="form-control bg-white" type="text" name="form_data_firstname" id="form_data_firstname" maxlength="50" value="<?php echo $session_user["0"]["users_firstname"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } ?>/>
</div>
</div>
<div class="col d-grid gap-2">
<div class="input-group">
<span class="input-group-text"><?php echo $transLang['LASTNAME']; ?></span>
<input class="form-control bg-white" type="text" name="form_data_lastname" id="form_data_lastname" maxlength="50" value="<?php echo $session_user["0"]["users_lastname"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } ?>/>
</div>
</div>
</div>
<?php if (Registry::AUTHMETHOD == 'INTERNAL') { ?>
<div class="row row-cols-3 mb-2">
<div class="col d-grid gap-2">
<div class="input-group">
<span class="input-group-text"><?php echo $transLang['NEW'] . " " . $transLang['PASSWORD']; ?></span>
<input class="form-control bg-white" type="password" name="form_data_passwordinitial" id="form_data_passwordinitial" />
</div>
</div>
<div class="col d-grid gap-2">
<div class="input-group">
<span class="input-group-text"><?php echo $transLang['STR_COMMON_CONFIRM'] . " " . $transLang['NEW'] . " " . $transLang['PASSWORD']; ?></span>
<input class="form-control bg-white" type="password" name="form_data_passwordconfirm" id="form_data_passwordconfirm" />
</div>
</div>
<div class="col d-grid gap-2">
<div class="input-group">
<button type="submit" name="form_data_saveprofile" id="form_data_saveprofile" class="form-control btn btn-success"><i class="fas fa-save"></i>&nbsp;<?php echo $transLang['STR_COMMON_SAVE']; ?></button>
</div>
</div>
</div>
<?php } ?>
</fieldset>
</form>
<hr />

View File

@ -1,5 +1,6 @@
ACCESS_LEVEL = 'Zugriffsebene'
ACCOUNT = 'Konto'
ACCOUNT_INFO_AUTHLOCKED = 'Dieses System verwendet SSO-Authentifizierung. Die meisten Benutzerdaten dürfen hier nicht geändert werden.'
ACCOUNT_INFO_DESC = 'Sie können Änderungen an Ihrem Benutzerprofil vornehmen. Um Ihr Passwort zu ändern, geben Sie ein neues Passwort zweimal ein und drücken Sie auf Speichern. Minimale Passwortlänge ist '
ACCOUNT_INFO_HEADER = 'Kontoinformationen'
ACKNOWLEDGEMENT = 'Mit der Anmeldung erkenne ich an, dass ich die Regeln gelesen und verstanden habe und bin einverstanden, die Regeln dieses Dokuments zu befolgen, während ich Arbeiten innerhalb der Einrichtung verrichtet. Wir verfügen über eine bestehende Sicherheitsrichtlinie für Anlagen, die die Staatsangehörigkeit und die Staatsangehörigkeit der Besucher des Rechenzentrums berücksichtigt, um die US-Gesetze wie Exportkontroll- und Wirtschaftssanktionsgesetze einzuhalten. Unser Ziel besteht lediglich darin, diese US-Gesetze einzuhalten und den Zugang zu Personal nicht willkürlich zu verweigern.'
@ -147,8 +148,8 @@ STR_COMMON_VSIGNATURE = 'Unterschrift des Besuchers'
STR_COMMON_YES = 'Ja'
STR_REPORT_EXECUTE_TITLE = 'Bericht ausführen'
STR_SIGNIN_MANUAL = 'Manuelle Anmeldung'
STR_TAGS_FORMCOMPLETE_TITLE = 'Formular vollständig'
STR_TAGS_FORMINCOMPLETE_TITLE = 'Formular unvollständig'
STR_TAGS_FORMCOMPLETE_TITLE = 'Vollständig'
STR_TAGS_FORMINCOMPLETE_TITLE = 'Unvollständig'
STR_VENDORINFO_CHECKLISTCOMPLETED_DESC = 'Falls eine Checkliste erforderlich war, wurde diese ausgefüllt und eingereicht?'
STR_VENDORINFO_CHECKLISTCOMPLETED_TITLE = 'Checkliste abgeschlossen'
STR_VENDORINFO_CHECKLISTREQUIRED_DESC = 'Muss für diese Arbeit eine Checkliste ausgefüllt und abgegeben werden?'
@ -201,6 +202,7 @@ USER-USERNAME = 'Nutzername'
USER-USERNAMENOTEMPTY = 'Der Benutzername darf nicht leer sein'
USER-USERNAMEUSED = 'Benutzername bereits vergeben'
USER-USERS = 'Benutzerverwaltung'
USER-SITES = 'Standortverwaltung'
VALIDATIONS = 'Validierungen'
VISITOR = 'Besucher'
VOID = 'Leere'

View File

@ -1,5 +1,6 @@
ACCESS_LEVEL = 'Access'
ACCOUNT = 'Account'
ACCOUNT_INFO_AUTHLOCKED = 'This system is using SSO authentication. Most user details may not be changed here.'
ACCOUNT_INFO_DESC = 'You may make changes to your user profile below. To change your password, enter a new password twice below and press save. Minimum password length is '
ACCOUNT_INFO_HEADER = 'Account Information'
ACKNOWLEDGEMENT = 'By signing in, I acknowledge I have read and understand the Rules and agree to follow the rules of that document while performing work inside the facility. We have an existing facility security policy that takes into account the nationality and citizenship of visitors to the data center in order to comply with U.S. laws such as export control and economic sanction laws. Our objective is only to comply with such U.S. laws and not to deny entrance to personnel arbitrarily.'
@ -147,8 +148,8 @@ STR_COMMON_VSIGNATURE = 'Visitor Signature'
STR_COMMON_YES = 'Yes'
STR_REPORT_EXECUTE_TITLE = 'Run Report'
STR_SIGNIN_MANUAL = 'Manual Sign-In'
STR_TAGS_FORMCOMPLETE_TITLE = 'Form Complete'
STR_TAGS_FORMINCOMPLETE_TITLE = 'Form Incomplete'
STR_TAGS_FORMCOMPLETE_TITLE = 'Complete'
STR_TAGS_FORMINCOMPLETE_TITLE = 'Incomplete'
STR_VENDORINFO_CHECKLISTCOMPLETED_DESC = 'If a checklist was required, has it been completed and submitted?'
STR_VENDORINFO_CHECKLISTCOMPLETED_TITLE = 'Checklist Completed'
STR_VENDORINFO_CHECKLISTREQUIRED_DESC = 'Does this work require that a checklist be completed and turned in?'
@ -201,6 +202,7 @@ USER-USERNAME = 'Username'
USER-USERNAMENOTEMPTY = 'Username cannot be empty'
USER-USERNAMEUSED = 'Username already in use'
USER-USERS = 'User Management'
USER-SITES = 'Site Management'
VALIDATIONS = 'Validations'
VISITOR = 'Visitor'
VOID = 'Void'

View File

@ -1,5 +1,6 @@
ACCESS_LEVEL = 'Nivel de acceso'
ACCOUNT = 'Cuenta'
ACCOUNT_INFO_AUTHLOCKED = 'Este sistema utiliza autenticación SSO. Es posible que la mayoría de los detalles del usuario no se modifiquen aquí.'
ACCOUNT_INFO_DESC = 'Puede realizar cambios en su perfil de usuario a continuación. Para cambiar su contraseña, ingrese una nueva contraseña dos veces abajo y presione guardar. La longitud mínima de la contraseña es '
ACCOUNT_INFO_HEADER = 'Información de la cuenta'
ACKNOWLEDGEMENT = 'Al iniciar sesión, reconozco que he leído y entiendo las Reglas y acepto seguir las reglas de ese documento mientras realizo el trabajo dentro de la instalación. Tenemos una política de seguridad en las instalaciones que tiene en cuenta la nacionalidad y la ciudadanía de los visitantes del centro de datos para cumplir con las leyes de los EE. UU., Como las leyes de control de exportaciones y sanciones económicas. Nuestro objetivo es solo cumplir con las leyes de los EE. UU. Y no negar la entrada al personal de manera arbitraria.'
@ -147,8 +148,8 @@ STR_COMMON_VSIGNATURE = 'Firma del Visitante'
STR_COMMON_YES = 'Sí'
STR_REPORT_EXECUTE_TITLE = 'Sacar un reporte'
STR_SIGNIN_MANUAL = 'Inicio de sesión manual'
STR_TAGS_FORMCOMPLETE_TITLE = 'Formulario completo'
STR_TAGS_FORMINCOMPLETE_TITLE = 'Formulario incompleto'
STR_TAGS_FORMCOMPLETE_TITLE = 'Completo'
STR_TAGS_FORMINCOMPLETE_TITLE = 'Incompleto'
STR_VENDORINFO_CHECKLISTCOMPLETED_DESC = 'Si se requirió una lista de verificación, ¿se ha completado y enviado?'
STR_VENDORINFO_CHECKLISTCOMPLETED_TITLE = 'Lista de verificación completada'
STR_VENDORINFO_CHECKLISTREQUIRED_DESC = '¿Requiere este trabajo que se complete y se entregue una lista de verificación?'
@ -201,6 +202,7 @@ USER-USERNAME = 'Usuario'
USER-USERNAMENOTEMPTY = 'El nombre de usuario no puede estar vacío'
USER-USERNAMEUSED = 'Nombre de usuario ya está en uso'
USER-USERS = 'Gestión de usuarios'
USER-SITES = 'Manejo de sitio'
VALIDATIONS = 'Validaciones'
VISITOR = 'Visitante'
VOID = 'Invalidar'

View File

@ -1,5 +1,6 @@
ACCESS_LEVEL = 'Niveau d&#39;accès'
ACCOUNT = 'Compte'
ACCOUNT_INFO_AUTHLOCKED = 'Ce système utilise l&#39;authentification SSO. La plupart des détails de l&#39;utilisateur ne peuvent pas être modifiés ici.'
ACCOUNT_INFO_DESC = 'Vous pouvez modifier votre profil d&#39;utilisateur ci-dessous. Pour changer votre mot de passe, entrez un nouveau mot de passe deux fois ci-dessous et appuyez sur enregistrer. La longueur minimale du mot de passe est '
ACCOUNT_INFO_HEADER = 'Information sur le compte'
ACKNOWLEDGEMENT = 'En me connectant, je reconnais avoir lu et compris les Règles et accepté de suivre les règles de ce document lors de l&#39;exécution de travaux à l&#39;intérieur de l&#39;établissement. Nous avons une politique de sécurité des installations existante qui prend en compte la nationalité et la citoyenneté des visiteurs du centre de données afin de respecter les lois américaines, telles que les lois sur le contrôle des exportations et les sanctions économiques. Notre objectif est uniquement de nous conformer à ces lois américaines et non de refuser l&#39;entrée au personnel de manière arbitraire.'
@ -147,8 +148,8 @@ STR_COMMON_VSIGNATURE = 'Visiteur Signature'
STR_COMMON_YES = 'Oui'
STR_REPORT_EXECUTE_TITLE = 'Rapport d&#39;exécution'
STR_SIGNIN_MANUAL = 'Connexion manuelle'
STR_TAGS_FORMCOMPLETE_TITLE = 'Formulaire rempli'
STR_TAGS_FORMINCOMPLETE_TITLE = 'Formulaire incomplet'
STR_TAGS_FORMCOMPLETE_TITLE = 'Rempli'
STR_TAGS_FORMINCOMPLETE_TITLE = 'Incomplet'
STR_VENDORINFO_CHECKLISTCOMPLETED_DESC = 'Si une liste de contrôle était requise, a-t-elle été complétée et soumise ?'
STR_VENDORINFO_CHECKLISTCOMPLETED_TITLE = 'Liste de contrôle terminée'
STR_VENDORINFO_CHECKLISTREQUIRED_DESC = 'Ce travail nécessite-t-il qu&#39;une liste de contrôle soit remplie et remise ?'
@ -201,6 +202,7 @@ USER-USERNAME = 'Nom d&#39;utilisateur'
USER-USERNAMENOTEMPTY = 'Le nom d&#39;utilisateur ne peut pas être vide'
USER-USERNAMEUSED = 'Nom d&#39;utilisateur déjà utilisé'
USER-USERS = 'Gestion des utilisateurs'
USER-SITES = 'Administration du site'
VALIDATIONS = 'Endossements'
VISITOR = 'Visiteur'
VOID = 'Vide'

544
users.php
View File

@ -82,93 +82,117 @@
} else { ?>
<!-- CONTENT START -->
<?php if (isset($session_user)) { if($session_user["0"]["users_usertype"] !== "USER-TYPES-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"] !== "USER-TYPES-ADMIN") { header("Location: index.php"); ?><h2 class="content-subhead"><?php echo $transLang['NOT_AUTHORIZED']; ?></h2><?php } } ?>
<?php $minpasslength = $StaticFunctions->getMinPass(); ?>
<?php if (!empty($_POST['edituser'])): // NEW SITE
$edituser = $Users->getUserInfo($_POST['editid'], "0", "0")
//$SiteInfo->addSite($_POST['sitename'], $_POST['timezone'], $_POST['region']);
//header('Location: ' . $_SERVER['PHP_SELF']);
?>
<!-- USER EDIT START -->
<div class="container bg-info rounded">
<div class="row">
<div class="col-sm">
<h2><?php echo $app_current_pageicon . $transLang['EDIT_PROFILE']; ?></h2>
</div>
</div>
<form class="form" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<fieldset id="editor">
<div class="form-row">
<div class="col input-group">
<div class="input-group-text">
<span class="input-group-text" id="firstname"><?php echo $transLang['FIRSTNAME']; ?></span>
</div>
<input type="text" class="form-control" id="firstname" name="firstname" value="<?php echo $edituser["0"]["users_firstname"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } else { echo "required "; } ?>/>
</div>
<div class="col input-group">
<div class="input-group-text">
<span class="input-group-text" id="lastname"><?php echo $transLang['LASTNAME']; ?></span>
</div>
<input type="text" class="form-control" id="lastname" name="lastname" value="<?php echo $edituser["0"]["users_lastname"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } else { echo "required "; } ?>/>
</div>
</div>
<div class="form-row">
<div class="col input-group">
<div class="input-group-text">
<span class="input-group-text" id="username"><?php echo $transLang['USER-USERNAME']; ?></span>
</div>
<input type="text" class="form-control" id="username" name="username" value="<?php echo $edituser["0"]["users_username"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } else { echo "required "; } ?>/>
</div>
<div class="col input-group">
<div class="input-group-text">
<span class="input-group-text" id="email"><?php echo $transLang['EMAIL']; ?></span>
</div>
<input type="text" class="form-control" id="email" name="email" value="<?php echo $edituser["0"]["users_email"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } else { echo "required "; } ?>/>
</div>
</div>
<div class="form-row">
<div class="col input-group">
<div class="input-group-text">
<span class="input-group-text" id="username"><?php echo $transLang['ACCESS_LEVEL']; ?></span>
</div>
<select class="form-select" id="usertype" aria-label="<?php echo $transLang['ACCESS_LEVEL']; ?>" name="usertype" required>
<?php foreach($Users->readUserTypeByUserTypeID("%") as $row): ?>
<option value="<?php echo $row['usertypes_id']; ?>"<?php if ($row['usertypes_id']==$edituser["0"]["users_usertypeid"]) { echo " selected"; } ?>><?php echo $transLang[$row['usertypes_name']]; ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="form-row">
<div class="col input-group">
<div class="input-group-text">
<span class="input-group-text" id="username"><?php echo $transLang['STR_COMMON_SITE']; ?></span>
</div>
<select id="sitepermissions" name="sitepermissions[]" class="form-select" multiple size="5">
<?php foreach($SiteInfo->listSite("0", "0") as $row): ?>
<option value="<?php echo $row['sites_id']; ?>"<?php if ($SiteInfo->readSitePermissionBySiteAndUser($row['sites_id'], $edituser["0"]["users_id"])=="1") { echo " selected"; } ?>><?php echo $row['sites_name']; ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="form-row">
<div class="col input-group">
<input type="hidden" id="edituserid" name="edituserid" value="<?php echo $edituser["0"]["users_id"]; ?>" />
<button type="submit" class="form-control btn btn-block btn-success" value="Submit" name="editusercomplete"><i class="fas fa-save"></i>&nbsp;<?php echo $transLang['STR_COMMON_SAVE']; ?></button>
</div>
</div>
</fieldset>
</form>
</div>
<?php
$minpasslength = $StaticFunctions->getMinPass();
?>
<!-- USER EDIT END -->
<?php
endif;
?>
// FILTER POSTED DATA
$form_data = filter_input_array(INPUT_POST, [
'edituser' => (string)FILTER_SANITIZE_STRING,
'editid' => (string)FILTER_SANITIZE_STRING,
'form_data_passwordconfirm' => (string)FILTER_SANITIZE_STRING,
'form_data_firstname' => (string)FILTER_SANITIZE_STRING,
'form_data_lastname' => (string)FILTER_SANITIZE_STRING,
'form_data_email' => (string)FILTER_SANITIZE_STRING
]);
if (!empty($form_data['edituser'])) { $edituser = $Users->getUserInfo($form_data['editid'], "0", "0") ?>
<!-- USER EDIT SECTION -->
<div class="container-fluid">
<form method="post">
<input type="hidden" id="edituserid" name="edituserid" value="<?php echo $edituser["0"]["users_id"]; ?>" />
<div class="row row-cols-3 mb-2">
<div class="col d-grid gap-2">
<h2><i class="fas fa-user-edit"></i> <?php echo $transLang['EDIT_PROFILE']; ?></h2>
</div>
<div class="col d-grid gap-2 text-center">
</div>
<div class="col text-end">
<button type="submit" class="btn btn-success btn-lg" value="Submit" name="editusercomplete"><i class="fas fa-save"></i> <?php echo $transLang['STR_COMMON_SAVE']; ?></button>
<a href="users.php" type="button" class="btn btn-primary btn-lg"><i class="fas fa-ban"></i> <?php echo $transLang['CANCEL']; ?></a>
</div>
</div>
<?php if (Registry::AUTHMETHOD == 'INTERNAL') { ?>
<div class="row row-cols-1 mb-2">
<div class="col d-grid gap-2">
<p class="lead"><?php echo $transLang['ACCOUNT_INFO_DESC'] . $minpasslength; ?></p>
</div>
</div>
<?php } elseif (Registry::AUTHMETHOD == 'SAML') { ?>
<div class="row row-cols-1 mb-2">
<div class="col d-grid gap-2">
<p class="lead"><?php echo $transLang['ACCOUNT_INFO_AUTHLOCKED']; ?></p>
</div>
</div>
<?php } ?>
<fieldset>
<div class="row row-cols-2 mb-2">
<div class="col d-grid gap-2">
<div class="input-group">
<span class="input-group-text"><?php echo $transLang['USER-USERNAME']; ?></span>
<input type="text" class="form-control" id="username" name="username" value="<?php echo $edituser["0"]["users_username"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } else { echo "required "; } ?>/>
</div>
</div>
<div class="col d-grid gap-2">
<div class="input-group">
<span class="input-group-text"><?php echo $transLang['CREATED']; ?></span>
<input type="text" class="form-control" id="created" name="created" value="<?php echo $edituser["0"]["users_created"]; ?>" readonly/>
</div>
</div>
</div>
<div class="row row-cols-2 mb-2">
<div class="col d-grid gap-2">
<div class="input-group">
<span class="input-group-text"><?php echo $transLang['ACCESS_LEVEL']; ?></span>
<select class="form-select" id="usertype" aria-label="<?php echo $transLang['ACCESS_LEVEL']; ?>" name="usertype" required>
<?php foreach($Users->readUserTypeByUserTypeID("%") as $row): ?>
<option value="<?php echo $row['usertypes_id']; ?>"<?php if ($row['usertypes_id']==$edituser["0"]["users_usertypeid"]) { echo " selected"; } ?>><?php echo $transLang[$row['usertypes_name']]; ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="col d-grid gap-2">
<div class="input-group">
<span class="input-group-text"><?php echo $transLang['EMAIL']; ?></span>
<input type="text" class="form-control" id="email" name="email" value="<?php echo $edituser["0"]["users_email"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } else { echo "required "; } ?>/>
</div>
</div>
</div>
<div class="row row-cols-2 mb-2">
<div class="col d-grid gap-2">
<div class="input-group">
<span class="input-group-text"><?php echo $transLang['FIRSTNAME']; ?></span>
<input type="text" class="form-control" id="firstname" name="firstname" value="<?php echo $edituser["0"]["users_firstname"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } else { echo "required "; } ?>/>
</div>
</div>
<div class="col d-grid gap-2">
<div class="input-group">
<span class="input-group-text"><?php echo $transLang['LASTNAME']; ?></span>
<input type="text" class="form-control" id="lastname" name="lastname" value="<?php echo $edituser["0"]["users_lastname"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } else { echo "required "; } ?>/>
</div>
</div>
</div>
<div class="row row-cols-1 mb-2">
<div class="col d-grid gap-2">
<div class="input-group">
<span class="input-group-text"><?php echo $transLang['STR_COMMON_SITE']; ?></span>
<select id="sitepermissions" name="sitepermissions[]" class="form-select" multiple size="5">
<?php foreach($SiteInfo->listSite("0", "0") as $row): ?>
<option value="<?php echo $row['sites_id']; ?>"<?php if ($SiteInfo->readSitePermissionBySiteAndUser($row['sites_id'], $edituser["0"]["users_id"])=="1") { echo " selected"; } ?>><?php echo $row['sites_name']; ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
</fieldset>
</form>
</div>
<!-- END USER EDIT SECTION -->
<?php } else { ?>
@ -286,130 +310,168 @@ if (0 === $row_count): else: $page_count = (int)ceil($row_count / $StaticFunctio
<!-- USER MGMT START -->
<div class="container">
<div class="row">
<div class="col-sm">
<h2><?php echo $app_current_pageicon . $transLang['USER-USERS']; ?></h2>
</div>
<div class="col-sm">
<button type="button" class="btn btn-block btn-lg btn-success" data-bs-toggle="modal" data-bs-target="#addUserModal"><?php echo $transLang['ADD_USER']; ?></button>
</div>
<!-- USER MANAGEMENT SECTION -->
<div class="container-fluid">
<div class="row row-cols-3 mb-2">
<div class="col d-grid gap-2">
<h2><i class="fas fa-users"></i> <?php echo $transLang['USER-USERS']; ?></h2>
</div>
<div class="col d-grid gap-2 text-center">
<ul class="pagination pagination-sm">
<li class="page-item disabled"><a class="page-link" href="#" tabindex="-1"><?php echo $transLang['STR_COMMON_PAGE']; ?></a></li>
<?php for ($i = 1; $i <= $page_count; $i++): ?>
<li class="page-item<?php if ($i === $page_num): echo ' active'; else: echo ' '; endif; ?>"><a class="page-link" href="<?php echo 'users.php?pnum=' . $i; ?>"><?php echo $i; ?></a></li>
<?php endfor; ?>
</ul>
</div>
<div class="col text-end">
<a data-bs-toggle="modal" data-bs-target="#addUserModal" href="#addUserModal" name="addUserModal" type="button" class="btn btn-info btn-lg open-addUserModal"><i class="fas fa-user-plus"></i> <?php echo $transLang['ADD_USER']; ?></a>
<a href="users.php" type="button" class="btn btn-primary btn-lg"><i class="fa fa-redo"></i> <?php echo $transLang['REFRESH']; ?></a>
</div>
</div>
<div class="row row-cols-1 mb-2">
<div class="col d-grid gap-2">
<table class="table table-striped w-auto">
<thead>
<tr>
<th><?php echo $transLang['NAME']; ?></th><th><?php echo $transLang['USER-USERNAME']; ?></th><th><?php echo $transLang['EMAIL']; ?></th><th><?php echo $transLang['CREATED']; ?></th><th><?php echo $transLang['USER-TYPE']; ?></th><th><?php echo $transLang['STR_COMMON_SITE']; ?></th><th><?php echo $transLang['ACTIONS']; ?></th>
</tr>
</thead>
<tbody>
<?php foreach($Users->getUserInfo("%", $StaticFunctions->getPageRows(), $offset) as $row): ?>
<?php if ($row['users_id'] == "1"): echo " "; else: ?>
<?php if ($row['users_id'] == "2"): echo " "; else: ?>
<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>
<?php $sidrowcount=0; foreach($SiteInfo->getSite("0", $row['users_id'], "0", "0") as $sidrow) { ?>
<span class="badge rounded-pill bg-info text-dark"><?php echo $sidrow['sites_name']; ?></span>
<?php ++$sidrowcount; if($sidrowcount==3) { echo "<br>"; } elseif($sidrowcount==5) {echo '<span class="badge rounded-pill bg-danger">...</span>'; break; } } ?>
</td>
<td class="nowrap">
<form method="post">
<input type="hidden" id="_METHOD" name="_METHOD" value="EDITUSER" />
<input type="hidden" id="editid" name="editid" value="<?php echo $row['users_id']; ?>" />
<button class="btn btn-primary btn-sm" id="edituser" name="edituser" value="edituser" type="submit" <?php if ($row['users_username'] == "admin"): echo "disabled"; endif; if ($row['users_username'] == "KIOSK"): echo "disabled"; endif; ?>><i class="fa fa-edit"></i> </button>
</form>
<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>
<?php endif; ?>
<?php endif; ?>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
<!-- END USER MANAGEMENT SECTION -->
<!-- ADD USER FORM MODAL -->
<div class="modal fade" id="addUserModal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header text-light bg-secondary">
<h5 class="modal-title"><?php echo $transLang['ADD_USER']; ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<form method="post">
<div class="row row-cols-1 mb-2">
<div class="col d-grid gap-2">
<?php if (Registry::AUTHMETHOD == 'INTERNAL') { ?>
<p><?php echo $transLang['ADD_USER_DESC'] . $minpasslength; ?></p>
<?php } elseif (Registry::AUTHMETHOD == 'SAML') { ?>
<p><?php echo $transLang['ACCOUNT_INFO_AUTHLOCKED']; ?></p>
<?php } ?>
</div>
</div>
<?php echo '<ul class="pagination pagination-sm"><li class="page-item disabled"><a class="page-link" href="#" tabindex="-1">' . $transLang['STR_COMMON_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>'; ?>
<table class="table">
<thead class="thead-dark">
<tr>
<th><?php echo $transLang['NAME']; ?></th><th><?php echo $transLang['USER-USERNAME']; ?></th><th><?php echo $transLang['EMAIL']; ?></th><th><?php echo $transLang['CREATED']; ?></th><th><?php echo $transLang['USER-TYPE']; ?></th><th><?php echo $transLang['ACTIONS']; ?></th>
</tr>
</thead>
<tbody>
<?php foreach($Users->getUserInfo("%", $StaticFunctions->getPageRows(), $offset) as $row): ?>
<?php if ($row['users_id'] == "1"): echo " "; else: ?>
<?php if ($row['users_id'] == "2"): echo " "; else: ?>
<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">
<input type="hidden" id="_METHOD" name="_METHOD" value="EDITUSER" />
<input type="hidden" id="editid" name="editid" value="<?php echo $row['users_id']; ?>" />
<button class="btn btn-primary btn-sm" id="edituser" name="edituser" value="edituser" type="submit" <?php if ($row['users_username'] == "admin"): echo "disabled"; endif; if ($row['users_username'] == "KIOSK"): echo "disabled"; endif; ?>><i class="fa fa-edit"></i> </button>
</form>
<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>
<?php endif; ?>
<?php endif; ?>
<?php if (Registry::AUTHMETHOD == 'INTERNAL') { ?>
<div class="row row-cols-2 mb-2">
<div class="col d-grid gap-2">
<div class="input-group">
<span class="input-group-text"><?php echo $transLang['FIRSTNAME']; ?></span>
<input type="text" class="form-control" id="firstname" name="firstname" required />
</div>
</div>
<div class="col d-grid gap-2">
<div class="input-group">
<span class="input-group-text"><?php echo $transLang['LASTNAME']; ?></span>
<input type="text" class="form-control" id="lastname" name="lastname" required />
</div>
</div>
</div>
<div class="row row-cols-2 mb-2">
<div class="col d-grid gap-2">
<div class="input-group">
<span class="input-group-text"><?php echo $transLang['USER-USERNAME']; ?></span>
<input type="text" class="form-control" id="username" name="username" required />
</div>
</div>
<div class="col d-grid gap-2">
<div class="input-group">
<span class="input-group-text"><?php echo $transLang['EMAIL']; ?></span>
<input type="text" class="form-control" id="email" name="email" required />
</div>
</div>
</div>
<div class="row row-cols-2 mb-2">
<div class="col d-grid gap-2">
<div class="input-group">
<span class="input-group-text"><?php echo $transLang['NEW'] . " " . $transLang['PASSWORD']; ?></span>
<input type="password" class="form-control" id="password" name="password" required />
</div>
</div>
<div class="col d-grid gap-2">
<div class="input-group">
<span class="input-group-text"><?php echo $transLang['STR_COMMON_CONFIRM'] . " " . $transLang['NEW'] . " " . $transLang['PASSWORD']; ?></span>
<input type="password" class="form-control" id="password_confirm" name="password_confirm" required />
</div>
</div>
</div>
<?php }elseif (Registry::AUTHMETHOD == 'SAML') { ?>
<div class="row row-cols-1 mb-2">
<div class="col d-grid gap-2">
<div class="input-group">
<span class="input-group-text"><?php echo $transLang['EMAIL']; ?></span>
<input type="text" class="form-control" id="email" name="email" required />
</div>
</div>
</div>
<?php } ?>
<div class="row row-cols-2 mb-2">
<div class="col d-grid gap-2">
<div class="input-group">
<span class="input-group-text"><?php echo $transLang['ACCESS_LEVEL']; ?></span>
<select class="form-select" id="usertype" name="usertype" required >
<option value="" selected><?php echo $transLang['STR_COMMON_CHOOSE'] . " " . $transLang['ACCESS_LEVEL']; ?></option>
<?php foreach($Users->readUserTypeByUserTypeID("%") as $row): ?>
<option value="<?php echo $row['usertypes_id']; ?>"><?php echo $transLang[$row['usertypes_name']]; ?></option>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php
$minpasslength = $StaticFunctions->getMinPass();
?>
<!-- MODAL START -->
<div class="modal fade" id="addUserModal" tabindex="-1" role="dialog" aria-labelledby="Site" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="AddUser"><?php echo $transLang['ADD_USER']; ?></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form class="form-inline my-2 my-lg-0" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<div class="row">
<?php if (Registry::AUTHMETHOD == 'INTERNAL') { ?>
<div class="col-sm">
<p class="lead"><?php echo $transLang['ADD_USER_DESC'] . $minpasslength; ?></p>
</div>
<?php } ?>
</div>
<fieldset id="registration">
<div class="form-group">
<?php if (Registry::AUTHMETHOD == 'INTERNAL') { ?>
<div class="row">
<div class="col-sm">
<input type="text" class="form-control" id="firstname" name="firstname" placeholder="First Name" required />
</div>
<div class="col-sm">
<input type="text" class="form-control" id="lastname" name="lastname" placeholder="Last Name" required />
</div>
</div>
<?php } ?>
<div class="row">
<?php if (Registry::AUTHMETHOD == 'INTERNAL') { ?>
<div class="col-sm">
<input type="text" class="form-control" id="username" name="username" placeholder="Username" required />
</div>
<?php } ?>
<div class="col-sm">
<input type="text" class="form-control" id="email" name="email" placeholder="Email" />
</div>
</div>
<?php if (Registry::AUTHMETHOD == 'INTERNAL') { ?>
<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>
<?php } ?>
<div class="row">
<div class="col-sm">
<select class="form-select" id="usertype" aria-label="<?php echo $transLang['ACCESS_LEVEL']; ?>" name="usertype" required>
<option value="" selected><?php echo $transLang['STR_COMMON_CHOOSE']; ?> <?php echo $transLang['ACCESS_LEVEL']; ?></option><?php foreach($Users->readUserTypeByUserTypeID("%") as $row): ?>
<option value="<?php echo $row['usertypes_id']; ?>"><?php echo $transLang[$row['usertypes_name']]; ?></option><?php endforeach; ?>
</select>
</div>
<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>
</div>
</div>
</div>
</fieldset>
</form>
</div>
</select>
</div>
</div>
<div class="col d-grid gap-2">
<div class="input-group input-group-sm mb-0 d-grid gap-2">
<button type="submit" class="btn btn-success btn-lg" value="Submit" name="newuser"><i class="fas fa-save"></i> <?php echo $transLang['STR_COMMON_SAVE']; ?></button>
</div>
</div>
</div>
</form>
</div>
<!-- MODAL END -->
<!-- USER MGMT END -->
</div>
</div>
</div>
<!-- END ADD USER FORM MODAL -->
<?php
@ -440,39 +502,48 @@ $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="row">
<div class="col-sm">
<h2><?php echo $app_current_pageicon . $transLang['STR_COMMON_SITE']; ?></h2>
</div>
<div class="col-sm">
<button type="button" class="btn btn-success btn-lg" data-bs-toggle="modal" data-bs-target="#addSiteModal"><?php echo $transLang['ADD_SITE']; ?></button>
</div>
</div>
<?php echo '<ul class="pagination pagination-sm"><li class="page-item disabled"><a class="page-link" href="#" tabindex="-1">' . $transLang['STR_COMMON_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">
<thead class="thead-dark">
<tr>
<th><?php echo $transLang['NAME']; ?></th><th><?php echo $transLang['STR_COMMON_TIMEZONE']; ?></th><th><?php echo $transLang['STR_COMMON_REGION']; ?></th><th><?php echo $transLang['ACTIONS']; ?></th>
</tr>
</thead>
<tbody>
<?php foreach($SiteInfo->listSite($StaticFunctions->getPageRows(), $offset1) as $row1): ?>
<?php if ($row1['sites_name'] === "NOSITE"): echo " "; else: ?>
<tr>
<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>
<?php endif; ?>
<?php endforeach; ?>
</tbody>
</table>
<hr />
</div>
<?php
$minpasslength = $StaticFunctions->getMinPass();
?>
<!-- SITE MGMT START -->
<div class="container-fluid">
<div class="row row-cols-3 mb-2">
<div class="col d-grid gap-2">
<h2><i class="fas fa-globe-americas"></i> <?php echo $transLang['USER-SITES']; ?></h2>
</div>
<div class="col d-grid gap-2 text-center">
<ul class="pagination pagination-sm">
<li class="page-item disabled"><a class="page-link" href="#" tabindex="-1"><?php echo $transLang['STR_COMMON_PAGE']; ?></a></li>
<?php for ($i1 = 1; $i1 <= $page_count1; $i1++): ?>
<li class="page-item<?php if ($i1 === $page_num1): echo ' active'; else: echo ' '; endif; ?>"><a class="page-link" href="<?php echo 'users.php?pnum1=' . $i1; ?>"><?php echo $i1; ?></a></li>
<?php endfor; ?>
</ul>
</div>
<div class="col text-end">
<a data-bs-toggle="modal" data-bs-target="#addSiteModal" href="#addSiteModal" name="addSiteModal" type="button" class="btn btn-info btn-lg open-addSiteModal"><i class="fas fa-map-marker-alt"></i> <?php echo $transLang['ADD_SITE']; ?></a>
<a href="users.php" type="button" class="btn btn-primary btn-lg"><i class="fa fa-redo"></i> <?php echo $transLang['REFRESH']; ?></a>
</div>
</div>
<div class="row row-cols-1 mb-2">
<div class="col d-grid gap-2">
<table class="table table-striped w-auto">
<thead>
<tr>
<th><?php echo $transLang['NAME']; ?></th><th><?php echo $transLang['STR_COMMON_TIMEZONE']; ?></th><th><?php echo $transLang['STR_COMMON_REGION']; ?></th><th><?php echo $transLang['ACTIONS']; ?></th>
</tr>
</thead>
<tbody>
<?php foreach($SiteInfo->listSite($StaticFunctions->getPageRows(), $offset1) as $row1): ?>
<?php if ($row1['sites_name'] === "NOSITE"): echo " "; else: ?>
<tr>
<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>
<?php endif; ?>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
<hr />
<!-- START ADDSITE MODAL -->
@ -531,7 +602,8 @@ if (0 === $row_count1): else: $page_count1 = (int)ceil($row_count1 / $StaticFunc
</div>
</div>
<!-- END ADDSITE MODAL -->
<?php } ?>
<hr />
<!-- END PAGE -->
<?php }; require_once("inc/footer.inc.php"); ?>