post remove

This commit is contained in:
Josh North 2021-06-21 12:18:37 -04:00
parent 2697965571
commit fffb3f4418
2 changed files with 20 additions and 18 deletions

View File

@ -101,8 +101,6 @@
<meta name="apple-mobile-web-app-title" content="<?php echo $transLang['STR_VENDORINFO_FORM_TITLE']; ?>">
<link rel="apple-touch-icon" href="assets/touch-logo.png?v3">
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<?php if (basename($_SERVER['PHP_SELF']) == 'signin_display.php'): ?> <meta http-equiv="refresh" content="5; url=index.php" /><?php endif; ?>
<?php if (basename($_SERVER['PHP_SELF']) == 'signout.php'): ?><?php if (!empty($_POST['endvisit'])): ?> <meta http-equiv="refresh" content="5; url=index.php" /><?php endif; ?><?php endif; ?>
<link rel="stylesheet" href="css/bootstrap.min.css?v3"/>
<link rel="stylesheet" href="css/sticky-footer-navbar.css?v3">
<link rel="stylesheet" href="css/all.min.css?v3"/>

View File

@ -92,7 +92,11 @@ $form_data = filter_input_array(INPUT_POST, [
'fd_confirmPassword' => (string)FILTER_SANITIZE_STRING,
'fd_firstName' => (string)FILTER_SANITIZE_STRING,
'fd_lastName' => (string)FILTER_SANITIZE_STRING,
'fd_userEmail' => (string)FILTER_SANITIZE_STRING
'fd_userEmail' => (string)FILTER_SANITIZE_STRING,
'fd_actionNewSite' => (string)FILTER_SANITIZE_STRING,
'fd_newSiteName' => (string)FILTER_SANITIZE_STRING,
'fd_newSiteTimezone' => (string)FILTER_SANITIZE_STRING,
'fd_newSiteRegion' => (string)FILTER_SANITIZE_STRING
]);
?>
@ -198,18 +202,17 @@ if (!empty($form_data['edituser'])) { $edituser = $Users->getUserInfo($form_data
<?php } else { ?>
<?php if(!empty($form_data['fd_formAction'])){ // ADD NEW SITE
if($form_data['fd_formAction']==='actionNewSite'){
ob_start();
$SiteInfo->addSite($form_data['fd_newSiteName'], $form_data['fd_newSiteTimezone'], $form_data['fd_newSiteRegion']);
$fd_newSiteId = $SiteInfo->getSiteByID($form_data['fd_newSiteName']);
$SiteInfo->grantSitePermissionBySiteAndUser($fd_newSiteId["0"]["id"], "1");
$SiteInfo->grantSitePermissionBySiteAndUser($fd_newSiteId["0"]["id"], "2");
header('Location: users.php');
ob_end_clean(); unset($form_data); } } ?>
<?php // POST ACTIONS
if (!empty($_POST['newsite'])): // NEW SITE
$SiteInfo->addSite($_POST['sitename'], $_POST['timezone'], $_POST['region']);
$newsiteid = $SiteInfo->getSiteByID($_POST['sitename']);
$SiteInfo->grantSitePermissionBySiteAndUser($newsiteid["0"]["id"], "1");
$SiteInfo->grantSitePermissionBySiteAndUser($newsiteid["0"]["id"], "2");
header('Location: users.php');
endif;
<?php
if (Registry::AUTHMETHOD == 'INTERNAL') {
if (!empty($_POST['newuser'])): // NEW USER INTERNAL
require_once("src/Misc/PasswordHash.php");
@ -559,11 +562,12 @@ if (0 === $row_count1): else: $page_count1 = (int)ceil($row_count1 / $StaticFunc
</div>
<div class="modal-body">
<form class="form form-approve" method="post">
<input type="hidden" name="fd_formAction" id="fd_formAction" value="actionNewSite" />
<div class="row row-cols-1">
<div class="col d-grid gap-2">
<div class="input-group input-group-sm mb-0">
<span class="input-group-text"><?php echo $transLang['NAME']; ?></span>
<input type="text" class="form-control" id="sitename" name="sitename" required />
<input type="text" class="form-control" id="fd_newSiteName" name="fd_newSiteName" required />
</div>
</div>
</div>
@ -571,7 +575,7 @@ if (0 === $row_count1): else: $page_count1 = (int)ceil($row_count1 / $StaticFunc
<div class="col d-grid gap-2">
<div class="input-group input-group-sm mb-0">
<span class="input-group-text"><?php echo $transLang['STR_COMMON_TIMEZONE']; ?></span>
<select class="form-control" id="timezone" name="timezone" required>
<select class="form-control" id="fd_newSiteTimezone" name="fd_newSiteTimezone" required>
<option value=""><?php echo $transLang['STR_COMMON_TIMEZONE']; ?></option>
<?php foreach(DateTimeZone::listIdentifiers(DateTimeZone::ALL) as $row2) { ?>
<option><?php echo $row2; ?></option>
@ -584,7 +588,7 @@ if (0 === $row_count1): else: $page_count1 = (int)ceil($row_count1 / $StaticFunc
<div class="col d-grid gap-2">
<div class="input-group input-group-sm mb-0">
<span class="input-group-text"><?php echo $transLang['NAME']; ?></span>
<select class="form-control" id="region" name="region" required>
<select class="form-control" id="fd_newSiteRegion" name="fd_newSiteRegion" required>
<option value=""><?php echo $transLang['STR_COMMON_REGION']; ?></option>
<option>CAN</option>
<option>EMEA</option>
@ -596,7 +600,7 @@ if (0 === $row_count1): else: $page_count1 = (int)ceil($row_count1 / $StaticFunc
<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"><i class="fas fa-ban"></i>&nbsp;<?php echo $transLang['STR_COMMON_CANCEL']; ?></button>
<button type="submit" class="btn btn-success btn-sm" value="Submit" name="newsite"><i class="fas fa-user-plus"></i>&nbsp;<?php echo $transLang['ADD_SITE']; ?></button>
<button type="submit" class="btn btn-success btn-sm" value="Submit" name="fd_actionNewSite"><i class="fas fa-user-plus"></i>&nbsp;<?php echo $transLang['ADD_SITE']; ?></button>
</div>
</div>
</form>