Domain Settings: Ensure redirect if none checked on copy/toggle/delete.

This commit is contained in:
Nate 2019-10-09 17:22:28 -06:00
parent bda3cdba44
commit f2c7aeafaf
1 changed files with 127 additions and 121 deletions

View File

@ -54,7 +54,8 @@
}
//copy (to a different domain)
if ($action == 'copy' && permission_exists('domain_select') && count($_SESSION['domains']) > 1) {
if ($action == 'copy') {
if (permission_exists('domain_select') && count($_SESSION['domains']) > 1) {
$target_domain_uuid = $_POST["target_domain_uuid"];
if (is_uuid($target_domain_uuid) && is_array($domain_setting_uuids) && @sizeof($domain_setting_uuids) > 0) {
@ -142,6 +143,7 @@
// set message
message::add($text['message-copy'].": ".escape($settings_copied));
}
}
header("Location: ".PROJECT_PATH."/core/domains/domain_edit.php?id=".escape($_REQUEST["domain_uuid"]));
exit;
@ -149,7 +151,8 @@
//toggle
$toggled = 0;
if ($action == 'toggle' && is_array($domain_setting_uuids) && sizeof($domain_setting_uuids) > 0) {
if ($action == 'toggle') {
if (is_array($domain_setting_uuids) && sizeof($domain_setting_uuids) > 0) {
foreach ($domain_setting_uuids as $domain_setting_uuid) {
if (is_uuid($domain_setting_uuid)) {
//get current status
@ -175,13 +178,15 @@
if ($toggled > 0) {
message::add($text['message-toggle'].': '.$toggled);
}
}
header("Location: ".PROJECT_PATH."/core/domains/domain_edit.php?id=".escape($_REQUEST["domain_uuid"]));
exit;
}
//delete
if ($action == 'delete' && permission_exists('domain_setting_delete')) {
if ($action == 'delete') {
if (permission_exists('domain_setting_delete')) {
//add multi-lingual support
$language = new text;
$text = $language->get();
@ -205,6 +210,7 @@
unset($array);
}
}
}
header("Location: ".PROJECT_PATH."/core/domains/domain_edit.php?id=".escape($_REQUEST["domain_uuid"]));
exit;
@ -280,9 +286,9 @@
}
//show the content
echo "<form name='domain_frm' id='domain_frm' method='post' action='".PROJECT_PATH."/core/domain_settings/domain_settings.php'>";
echo "<form name='domain_frm' id='domain_frm' method='post' action='".PROJECT_PATH."/core/domain_settings/domain_settings.php'>\n";
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
echo "<input type='hidden' name='domain_uuid' value='".escape($domain_uuid)."'>";
echo "<input type='hidden' name='domain_uuid' value='".escape($domain_uuid)."'>\n";
echo "<div style='float: right;'>\n";
if (permission_exists('domain_setting_add')) {