Vendor & contractor integration
This commit is contained in:
20
users.php
20
users.php
@@ -82,7 +82,7 @@
|
||||
} else { ?>
|
||||
<!-- CONTENT START -->
|
||||
|
||||
<?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"] !== "USER-TYPES-ADMIN") { header("Location: index.php"); ?><h2 class="content-subhead"><?php echo $transLang['NOT_AUTHORIZED']; ?></h2><?php }; }; ?>
|
||||
|
||||
|
||||
<?php if (!empty($_POST['edituser'])): // NEW SITE
|
||||
@@ -117,7 +117,7 @@
|
||||
<div class="form-row">
|
||||
<div class="col input-group">
|
||||
<div class="input-group-text">
|
||||
<span class="input-group-text" id="username"><?php echo $transLang['USERNAME']; ?></span>
|
||||
<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>
|
||||
@@ -155,7 +155,7 @@
|
||||
<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="fa fa-user-plus"></i> <?php echo $transLang['SAVE']; ?></button>
|
||||
<button type="submit" class="form-control btn btn-block btn-success" value="Submit" name="editusercomplete"><i class="fas fa-save"></i> <?php echo $transLang['SAVE']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
@@ -186,7 +186,7 @@
|
||||
if (Registry::AUTHMETHOD == 'INTERNAL') {
|
||||
if (!empty($_POST['newuser'])): // NEW USER INTERNAL
|
||||
require_once("src/Misc/PasswordHash.php");
|
||||
if (empty($_POST['username'])): $errors['username'] = $transLang['USERNAME_NOTEMPTY']; endif;
|
||||
if (empty($_POST['username'])): $errors['username'] = $transLang['USER-USERNAMENOTEMPTY']; 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;
|
||||
@@ -196,7 +196,7 @@ if (Registry::AUTHMETHOD == 'INTERNAL') {
|
||||
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_username"] == $_POST['username']): $errors['username'] = $transLang['USER-USERNAMEUSED']; endif;
|
||||
if ($existing[0]["users_email"] == $email): $errors['email'] = $transLang['PASSWORD_USED']; endif;
|
||||
endif;
|
||||
endif;
|
||||
@@ -226,7 +226,7 @@ if (Registry::AUTHMETHOD == 'INTERNAL') {
|
||||
if (!empty($_POST['editusercomplete'])): // EDIT USER
|
||||
if (Registry::AUTHMETHOD == 'INTERNAL') {
|
||||
require_once("src/Misc/PasswordHash.php");
|
||||
if (empty($_POST['username'])): $errors['username'] = $transLang['USERNAME_NOTEMPTY']; endif;
|
||||
if (empty($_POST['username'])): $errors['username'] = $transLang['USER-USERNAMENOTEMPTY']; 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;
|
||||
@@ -236,7 +236,7 @@ if (Registry::AUTHMETHOD == 'INTERNAL') {
|
||||
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_username"] == $_POST['username']): $errors['username'] = $transLang['USER-USERNAMEUSED']; endif;
|
||||
// if ($existing[0]["users_email"] == $email): $errors['email'] = $transLang['PASSWORD_USED']; endif;
|
||||
// endif;
|
||||
}
|
||||
@@ -290,7 +290,7 @@ if (0 === $row_count): else: $page_count = (int)ceil($row_count / $StaticFunctio
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-sm">
|
||||
<h2><?php echo $app_current_pageicon . $transLang['USERS']; ?></h2>
|
||||
<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>
|
||||
@@ -300,7 +300,7 @@ if (0 === $row_count): else: $page_count = (int)ceil($row_count / $StaticFunctio
|
||||
<table class="table">
|
||||
<thead class="thead-dark">
|
||||
<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['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>
|
||||
@@ -520,7 +520,7 @@ if (0 === $row_count1): else: $page_count1 = (int)ceil($row_count1 / $StaticFunc
|
||||
</div>
|
||||
<div class="row row-cols-1">
|
||||
<div class="col d-grid gap-2">
|
||||
<button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal"><?php echo $transLang['CANCEL']; ?></button>
|
||||
<button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal"><i class="fas fa-ban"></i> <?php echo $transLang['CANCEL']; ?></button>
|
||||
<button type="submit" class="btn btn-success btn-sm" value="Submit" name="newsite"><i class="fas fa-user-plus"></i> <?php echo $transLang['ADD_SITE']; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user