mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Use boolean setting as true boolean (#7284)
* use boolean setting as true boolean * Update settings class to use the php filter_var function for boolean Using the built-in filter type for boolean seems like a better option as they are faster, already hardened, and more widely tested. I found this better method used originally by Mark J. Crane in 2022 in the content.php page so I included it here. * Update settings class to use the php filter_var function for boolean Using the built-in filter type for boolean seems like a better option as they are faster, already hardened, and more widely tested. I found this better method used originally by Mark J. Crane in 2022 in the content.php page so I included it here.
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
}
|
||||
|
||||
//set from session variables
|
||||
$list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false';
|
||||
$list_row_edit_button = filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL);
|
||||
|
||||
//set the uuid
|
||||
if (!empty($_GET['id']) && is_uuid($_GET['id'])) {
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
}
|
||||
|
||||
//set from session variables
|
||||
$list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false';
|
||||
$list_row_edit_button = filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL);
|
||||
|
||||
//get the contact attachment list
|
||||
$sql = "select *, length(decode(attachment_content,'base64')) as attachment_size from v_contact_attachments ";
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
|
||||
//$contact_users = $_POST["contact_users"];
|
||||
//$contact_groups = $_POST["contact_groups"];
|
||||
$contact_user_uuid = ($_SESSION['contact']['permissions']['boolean'] == "true") ? ($_POST["contact_user_uuid"] ?? $_SESSION["user_uuid"]) : ($contact_user_uuid = $_POST["contact_user_uuid"] ?? null);
|
||||
$contact_user_uuid = filter_var($_SESSION['contact']['permissions']['boolean'] ?? false, FILTER_VALIDATE_BOOLEAN) ? ($_POST["contact_user_uuid"] ?? $_SESSION["user_uuid"]) : ($contact_user_uuid = $_POST["contact_user_uuid"] ?? null);
|
||||
$contact_group_uuid = $_POST["contact_group_uuid"] ?? null;
|
||||
|
||||
$contact_phones = $_POST["contact_phones"];
|
||||
@@ -1529,7 +1529,7 @@ echo " </div>\n";
|
||||
echo " </div>\n";
|
||||
unset($contact_note);
|
||||
|
||||
if ($_SESSION['contact']['permissions']['boolean'] == "true") {
|
||||
if (filter_var($_SESSION['contact']['permissions']['boolean'] ?? false, FILTER_VALIDATE_BOOL)) {
|
||||
if (permission_exists('contact_user_view') || permission_exists('contact_group_view')) {
|
||||
echo " <div class='form_set card'>\n";
|
||||
echo " <div class='heading'>\n";
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
}
|
||||
|
||||
//set from session variables
|
||||
$list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false';
|
||||
$list_row_edit_button = filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL);
|
||||
|
||||
//get the contact list
|
||||
$sql = "select * from v_contact_emails ";
|
||||
@@ -71,7 +71,7 @@
|
||||
echo "<th class='pct-15'>".$text['label-email_label']."</th>\n";
|
||||
echo "<th>".$text['label-email_address']."</th>\n";
|
||||
echo "<th class='hide-md-dn'>".$text['label-email_description']."</th>\n";
|
||||
if (permission_exists('contact_email_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('contact_email_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
@@ -96,7 +96,7 @@
|
||||
echo " <td>".escape($row['email_label'])." ".($row['email_primary'] ? " <i class='fas fa-star fa-xs' style='float: right; margin-top: 0.5em; margin-right: -0.5em;' title=\"".$text['label-primary']."\"></i>" : null)."</td>\n";
|
||||
echo " <td class='no-link'><a href='mailto:".escape($row['email_address'])."'>".escape($row['email_address'])."</a> </td>\n";
|
||||
echo " <td class='description overflow hide-md-dn'>".escape($row['email_description'])." </td>\n";
|
||||
if (permission_exists('contact_email_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('contact_email_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'>\n";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
}
|
||||
|
||||
//set from session variables
|
||||
$list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false';
|
||||
$list_row_edit_button = filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL);
|
||||
|
||||
//get the extension list
|
||||
$sql = "select e.extension_uuid, e.extension, e.enabled, e.description ";
|
||||
@@ -69,7 +69,7 @@
|
||||
echo "<th>".$text['label-extension']."</th>\n";
|
||||
echo "<th class='center'>".$text['label-enabled']."</th>\n";
|
||||
echo "<th class='hide-md-dn'>".$text['label-description']."</th>\n";
|
||||
if (permission_exists('extension_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('extension_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
@@ -95,7 +95,7 @@
|
||||
echo " </td>\n";
|
||||
echo " <td class='center'>".$text['label-'.escape($row['enabled'])]." </td>\n";
|
||||
echo " <td class='description overflow hide-md-dn'>".$row['description']." </td>\n";
|
||||
if (permission_exists('extension_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('extension_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'>\n";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
echo "<th>".$text['label-phone_type']."</th>\n";
|
||||
echo "<th>".$text['label-phone_tools']."</th>\n";
|
||||
echo "<th class='hide-md-dn'>".$text['label-phone_description']."</th>\n";
|
||||
if (permission_exists('contact_phone_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
||||
if (permission_exists('contact_phone_edit') && filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL)) {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
@@ -130,7 +130,7 @@
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " <td class='description overflow hide-md-dn'>".escape($row['phone_description'])." </td>\n";
|
||||
if (permission_exists('contact_phone_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
||||
if (permission_exists('contact_phone_edit') && filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL)) {
|
||||
echo " <td class='action-button'>\n";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
}
|
||||
|
||||
//set from session variables
|
||||
$list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false';
|
||||
$list_row_edit_button = filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL);
|
||||
|
||||
//get the related contacts
|
||||
$sql = "select ";
|
||||
@@ -85,7 +85,7 @@
|
||||
echo "<th>".$text['label-contact_relation_label']."</th>\n";
|
||||
echo "<th>".$text['label-contact_relation_organization']."</th>\n";
|
||||
echo "<th>".$text['label-contact_relation_name']."</th>\n";
|
||||
if (permission_exists('contact_relation_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('contact_relation_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
@@ -110,7 +110,7 @@
|
||||
echo " <td>".escape($row['relation_label'])." </td>\n";
|
||||
echo " <td class='no-link'><a href='contact_edit.php?id=".urlencode($row['contact_uuid'])."'>".escape($row['contact_organization'])."</a> </td>\n";
|
||||
echo " <td class='no-link'><a href='contact_edit.php?id=".urlencode($row['contact_uuid'])."'>".escape($row['contact_name_given']).((!empty($row['contact_name_given']) && !empty($row['contact_name_family'])) ? ' ' : null).escape($row['contact_name_family'])."</a> </td>\n";
|
||||
if (permission_exists('contact_relation_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('contact_relation_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'>\n";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
}
|
||||
|
||||
//set from session variables
|
||||
$list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false';
|
||||
$list_row_edit_button = filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL);
|
||||
|
||||
//get the list
|
||||
$sql = "select * from v_contact_settings ";
|
||||
@@ -78,7 +78,7 @@
|
||||
echo "<th>".$text['label-contact_setting_value']."</th>";
|
||||
echo "<th class='center'>".$text['label-enabled']."</th>";
|
||||
echo "<th class='hide-md-dn'>".$text['label-description']."</th>";
|
||||
if (permission_exists('contact_setting_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('contact_setting_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
@@ -119,7 +119,7 @@
|
||||
echo " </td>\n";
|
||||
echo " <td class='center'>".$text['label-'.escape($row['contact_setting_enabled'])]." </td>\n";
|
||||
echo " <td class='description overflow hide-md-dn'>".$row['contact_setting_description']." </td>\n";
|
||||
if (permission_exists('contact_setting_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('contact_setting_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'>\n";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
}
|
||||
|
||||
//set from session variables
|
||||
$list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false';
|
||||
$list_row_edit_button = filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL);
|
||||
|
||||
//set the uuid
|
||||
if (!empty($_GET['id']) && is_uuid($_GET['id'])) {
|
||||
@@ -79,7 +79,7 @@
|
||||
echo "<th class='pct-20'>".$text['label-time_start']."</th>\n";
|
||||
echo "<th class='pct-20'>".$text['label-time_duration']."</th>\n";
|
||||
echo "<th class='pct-40 hide-md-dn'>".$text['label-time_description']."</th>\n";
|
||||
if (permission_exists('contact_time_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('contact_time_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
@@ -115,7 +115,7 @@
|
||||
echo " <td>".$time_start." </td>\n";
|
||||
echo " <td>".$time." </td>\n";
|
||||
echo " <td class='description overflow hide-md-dn'>".escape($row['time_description'])." </td>\n";
|
||||
if (permission_exists('contact_time_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('contact_time_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'>\n";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
echo "<th class='pct-15'>".$text['label-url_label']."</th>\n";
|
||||
echo "<th>".$text['label-url_address']."</th>\n";
|
||||
echo "<th class='hide-md-dn'>".$text['label-url_description']."</th>\n";
|
||||
if (permission_exists('contact_url_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
||||
if (permission_exists('contact_url_edit') && filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL)) {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
@@ -98,7 +98,7 @@
|
||||
echo " <td>".escape($row['url_label'])." ".($row['url_primary'] ? " <i class='fas fa-star fa-xs' style='float: right; margin-top: 0.5em; margin-right: -0.5em;' title=\"".$text['label-primary']."\"></i>" : null)."</td>\n";
|
||||
echo " <td class='no-link overflow no-wrap'><a href='".escape($row['url_address'])."' target='_blank'>".str_replace("http://", "", str_replace("https://", "", escape($row['url_address'])))."</a></td>\n";
|
||||
echo " <td class='description overflow hide-md-dn'>".escape($row['url_description'])." </td>\n";
|
||||
if (permission_exists('contact_url_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
||||
if (permission_exists('contact_url_edit') && filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL)) {
|
||||
echo " <td class='action-button'>\n";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
$show = $_GET["show"] ?? '';
|
||||
|
||||
//set from session variables
|
||||
$list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false';
|
||||
$list_row_edit_button = filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL);
|
||||
|
||||
//get posted data
|
||||
if (!empty($_POST['contacts'])) {
|
||||
@@ -387,7 +387,7 @@
|
||||
echo th_order_by('contact_title', $text['label-contact_title'], $order_by, $order, null, "class='hide-sm-dn'");
|
||||
echo th_order_by('contact_role', $text['label-contact_role'], $order_by, $order, null, "class='hide-sm-dn'");
|
||||
echo "<th class='shrink hide-sm-dn'> </th>\n";
|
||||
if ($list_row_edit_button == 'true') {
|
||||
if ($list_row_edit_button) {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
@@ -439,7 +439,7 @@
|
||||
echo " ";
|
||||
}
|
||||
echo " </td>\n";
|
||||
if ($list_row_edit_button == 'true') {
|
||||
if ($list_row_edit_button) {
|
||||
echo " <td class='action-button'>";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-view'],'icon'=>$_SESSION['theme']['button_icon_view'],'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
|
||||
@@ -194,7 +194,7 @@
|
||||
echo th_order_by('dashboard_order', $text['label-dashboard_order'], $order_by, $order);
|
||||
echo th_order_by('dashboard_enabled', $text['label-dashboard_enabled'], $order_by, $order, null, "class='center'");
|
||||
echo " <th class='hide-sm-dn'>".$text['label-dashboard_description']."</th>\n";
|
||||
if (permission_exists('dashboard_edit') && isset($_SESSION['theme']['list_row_edit_button']['boolean']) && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
||||
if (permission_exists('dashboard_edit') && filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL)) {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
@@ -238,7 +238,7 @@
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " <td class='description overflow hide-sm-dn'>".escape($row['dashboard_description'])."</td>\n";
|
||||
if (permission_exists('dashboard_edit') && isset($_SESSION['theme']['list_row_edit_button']['boolean']) && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
||||
if (permission_exists('dashboard_edit') && filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL)) {
|
||||
echo " <td class='action-button'>\n";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
$text = $language->get();
|
||||
|
||||
//set from session variables
|
||||
$list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false';
|
||||
$list_row_edit_button = filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL);
|
||||
|
||||
//get the http post data
|
||||
if (!empty($_POST['databases'])) {
|
||||
@@ -150,7 +150,7 @@
|
||||
echo th_order_by('database_host', $text['label-host'], $order_by, $order);
|
||||
echo th_order_by('database_name', $text['label-name'], $order_by, $order);
|
||||
echo th_order_by('database_description', $text['label-description'], $order_by, $order, null, "class='hide-sm-dn'");
|
||||
if (permission_exists('database_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('database_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
@@ -178,7 +178,7 @@
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " <td class='description overflow hide-sm-dn'>".escape($row['database_description'])." </td>\n";
|
||||
if (permission_exists('database_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('database_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'>\n";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
}
|
||||
|
||||
//set from session variables
|
||||
$list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false';
|
||||
$list_row_edit_button = filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL);
|
||||
|
||||
//build the query string
|
||||
$query_string = '';
|
||||
@@ -458,7 +458,7 @@
|
||||
echo th_order_by('default_setting_value', $text['label-value'], $order_by, $order, null, "class='pct-30'");
|
||||
echo th_order_by('default_setting_enabled', $text['label-enabled'], $order_by, $order, null, "class='center'");
|
||||
echo " <th class='pct-25 hide-sm-dn'>".$text['label-description']."</th>\n";
|
||||
if ($permission['default_setting_edit'] && $list_row_edit_button == 'true') {
|
||||
if ($permission['default_setting_edit'] && $list_row_edit_button) {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
@@ -603,7 +603,7 @@
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " <td class='description overflow hide-sm-dn' title=\"".escape($row['default_setting_description'])."\">".escape($row['default_setting_description'])."</td>\n";
|
||||
if ($permission['default_setting_edit'] && $list_row_edit_button == 'true') {
|
||||
if ($permission['default_setting_edit'] && $list_row_edit_button) {
|
||||
echo " <td class='action-button'>\n";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
$show = !empty($_GET["show"]) ? $_GET["show"] : '';
|
||||
|
||||
//set from session variables
|
||||
$list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false';
|
||||
$list_row_edit_button = filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL);
|
||||
|
||||
//get the http post data
|
||||
if (!empty($_POST['action'])) {
|
||||
@@ -259,7 +259,7 @@
|
||||
echo th_order_by('domain_setting_value', $text['label-value'], $order_by, $order, null, "class='pct-30'");
|
||||
echo th_order_by('domain_setting_enabled', $text['label-enabled'], $order_by, $order, null, "class='center'");
|
||||
echo " <th class='pct-25 hide-sm-dn'>".$text['label-description']."</th>\n";
|
||||
if (permission_exists('domain_setting_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('domain_setting_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
@@ -389,7 +389,7 @@
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " <td class='description overflow hide-sm-dn' title=\"".escape($row['domain_setting_description'])."\">".escape($row['domain_setting_description'])." </td>\n";
|
||||
if (permission_exists('domain_setting_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('domain_setting_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'>\n";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
$show = $_GET["show"] ?? '';
|
||||
|
||||
//set from session variables
|
||||
$list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false';
|
||||
$list_row_edit_button = filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL);
|
||||
|
||||
//add the search string
|
||||
if (!empty($search)) {
|
||||
@@ -241,7 +241,7 @@
|
||||
echo "<th class='center'>".$text['label-tools']."</th>";
|
||||
echo th_order_by('domain_enabled', $text['label-domain_enabled'], $order_by, $order, null, "class='center'");
|
||||
echo " <th class='hide-sm-dn'>".$text['label-domain_description']."</th>\n";
|
||||
if (permission_exists('domain_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('domain_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
@@ -289,7 +289,7 @@
|
||||
echo " </td>\n";
|
||||
}
|
||||
echo " <td class='description overflow hide-sm-dn'>".escape($row['domain_description'])."</td>\n";
|
||||
if (permission_exists('domain_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('domain_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'>\n";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
|
||||
@@ -180,9 +180,9 @@
|
||||
//load editor preferences/defaults
|
||||
$setting_size = !empty($_SESSION["editor"]["font_size"]["text"]) ? $_SESSION["editor"]["font_size"]["text"] : '12px';
|
||||
$setting_theme = !empty($_SESSION["editor"]["theme"]["text"]) ? $_SESSION["editor"]["theme"]["text"] : 'cobalt';
|
||||
$setting_invisibles = !empty($_SESSION["editor"]["invisibles"]["boolean"]) ? $_SESSION["editor"]["invisibles"]["boolean"] : 'false';
|
||||
$setting_indenting = !empty($_SESSION["editor"]["indent_guides"]["boolean"]) ? $_SESSION["editor"]["indent_guides"]["boolean"] : 'false';
|
||||
$setting_numbering = !empty($_SESSION["editor"]["line_numbers"]["boolean"]) ? $_SESSION["editor"]["line_numbers"]["boolean"] : 'true';
|
||||
$setting_invisibles = filter_var($_SESSION["editor"]["invisibles"]["boolean"] ?? false, FILTER_VALIDATE_BOOL) ? 'true' : 'false';
|
||||
$setting_indenting = filter_var($_SESSION["editor"]["indent_guides"]["boolean"] ?? false, FILTER_VALIDATE_BOOL) ? 'true' : 'false';
|
||||
$setting_numbering = filter_var($_SESSION["editor"]["line_numbers"]["boolean"] ?? true, FILTER_VALIDATE_BOOL) ? 'true' : 'false';
|
||||
|
||||
//create token
|
||||
$object = new token;
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
$text = $language->get();
|
||||
|
||||
//set from session variables
|
||||
$list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false';
|
||||
$list_row_edit_button = filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL);
|
||||
|
||||
//get posted data
|
||||
if (!empty($_POST['email_templates'])) {
|
||||
@@ -249,7 +249,7 @@
|
||||
echo th_order_by('template_type', $text['label-template_type'], $order_by, $order, null, null, $param);
|
||||
echo th_order_by('template_enabled', $text['label-template_enabled'], $order_by, $order, null, "class='center pct-10'", $param);
|
||||
echo th_order_by('template_description', $text['label-template_description'], $order_by, $order, null, "class='hide-sm-dn'", $param);
|
||||
if (permission_exists('email_template_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('email_template_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
@@ -303,7 +303,7 @@
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " <td class='description overflow hide-sm-dn'>".escape($row['template_description'])."</td>\n";
|
||||
if (permission_exists('email_template_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('email_template_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'>";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
}
|
||||
|
||||
//set from session variables
|
||||
$list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false';
|
||||
$list_row_edit_button = filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL);
|
||||
|
||||
//get the count
|
||||
$sql = "select count(*) from view_groups \n";
|
||||
@@ -204,7 +204,7 @@
|
||||
echo th_order_by('group_level', $text['label-group_level'], $order_by, $order, null, "class='center'");
|
||||
echo th_order_by('group_protected', $text['label-group_protected'], $order_by, $order, null, "class='center'");
|
||||
echo " <th class='pct-30 hide-sm-dn'>".$text['label-group_description']."</th>\n";
|
||||
if (permission_exists('group_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('group_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
@@ -246,7 +246,7 @@ echo " <td>".escape($row['domain_name'])."</td>\n";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " <td class='description overflow hide-sm-dn'>".escape($row['group_description'])."</td>\n";
|
||||
if (permission_exists('group_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('group_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'>\n";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
|
||||
@@ -48,8 +48,8 @@
|
||||
$search = $_GET["search"] ?? '';
|
||||
|
||||
//set from session variables
|
||||
$list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false';
|
||||
$button_icon_add = !empty($_SESSION['theme']['button_icon_add']) ? $_SESSION['theme']['button_icon_add'] : '';
|
||||
$list_row_edit_button = filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL);
|
||||
$button_icon_add = $_SESSION['theme']['button_icon_add'] ?? '';
|
||||
|
||||
//get the http post data
|
||||
if (!empty($_POST['menus'])) {
|
||||
@@ -154,7 +154,7 @@
|
||||
echo th_order_by('menu_name', $text['label-menu_name'], $order_by, $order);
|
||||
echo th_order_by('menu_language', $text['label-menu_language'], $order_by, $order);
|
||||
echo " <th class='hide-sm-dn'>".$text['label-menu_description']."</th>\n";
|
||||
if (permission_exists('menu_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('menu_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
@@ -182,7 +182,7 @@
|
||||
echo " </td>\n";
|
||||
echo " <td>".escape($row['menu_language'])."</td>\n";
|
||||
echo " <td class='description overflow hide-sm-dn'>".escape($row['menu_description'])."</td>\n";
|
||||
if (permission_exists('menu_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('menu_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'>\n";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$button_icon_edit,'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
$order = $_GET["order"] ?? '';
|
||||
|
||||
//set from session variables
|
||||
$list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false';
|
||||
$list_row_edit_button = filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL);
|
||||
|
||||
//set the initial value
|
||||
$tmp_menu_item_order = 0;
|
||||
@@ -192,7 +192,7 @@
|
||||
//}
|
||||
//echo "</td>";
|
||||
|
||||
if (permission_exists('menu_item_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('menu_item_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'>\n";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
@@ -278,7 +278,7 @@
|
||||
echo " <th class='no-wrap center shrink'>".$text['label-category']."</th>";
|
||||
echo " <th class='no-wrap center shrink'>".$text['label-protected']."</th>";
|
||||
echo " <th class='no-wrap center shrink'>".$text['label-menu_order']."</th>";
|
||||
if (permission_exists('menu_item_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('menu_item_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
@@ -380,7 +380,7 @@
|
||||
//}
|
||||
//echo "</td>";
|
||||
|
||||
if (permission_exists('menu_item_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('menu_item_edit') && $list_row_edit_button) {
|
||||
echo "<td class='action-button'>\n";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
||||
echo "</td>\n";
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
$order = $_GET["order"] ?? '';
|
||||
|
||||
//set from session variables
|
||||
$list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false';
|
||||
$list_row_edit_button = filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL) ? 'true' : 'false';
|
||||
$button_icon_back = !empty($_SESSION['theme']['button_icon_back']) ? $_SESSION['theme']['button_icon_back'] : '';
|
||||
$button_icon_add = !empty($_SESSION['theme']['button_icon_add']) ? $_SESSION['theme']['button_icon_add'] : '';
|
||||
$button_icon_copy = !empty($_SESSION['theme']['button_icon_copy']) ? $_SESSION['theme']['button_icon_copy'] : '';
|
||||
@@ -259,7 +259,7 @@
|
||||
echo "<th class='pct-30'>".$text['label-value']."</th>";
|
||||
echo "<th class='center'>".$text['label-enabled']."</th>";
|
||||
echo "<th class='pct-25 hide-sm-dn'>".$text['label-description']."</th>";
|
||||
if (permission_exists('user_setting_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('user_setting_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
@@ -383,7 +383,7 @@
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " <td class='description overflow hide-sm-dn' title=\"".escape($row['user_setting_description'])."\">".escape($row['user_setting_description'])." </td>\n";
|
||||
if (permission_exists('user_setting_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('user_setting_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'>\n";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$button_icon_edit,'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
|
||||
@@ -105,10 +105,10 @@
|
||||
//retrieve password requirements
|
||||
if (permission_exists('user_password')) {
|
||||
$required['length'] = $_SESSION['users']['password_length']['numeric'];
|
||||
$required['number'] = ($_SESSION['users']['password_number']['boolean'] == 'true') ? true : false;
|
||||
$required['lowercase'] = ($_SESSION['users']['password_lowercase']['boolean'] == 'true') ? true : false;
|
||||
$required['uppercase'] = ($_SESSION['users']['password_uppercase']['boolean'] == 'true') ? true : false;
|
||||
$required['special'] = ($_SESSION['users']['password_special']['boolean'] == 'true') ? true : false;
|
||||
$required['number'] = filter_var($_SESSION['users']['password_number']['boolean'] ?? false, FILTER_VALIDATE_BOOL);
|
||||
$required['lowercase'] = filter_var($_SESSION['users']['password_lowercase']['boolean'] ?? false, FILTER_VALIDATE_BOOL);
|
||||
$required['uppercase'] = filter_var($_SESSION['users']['password_uppercase']['boolean'] ?? false, FILTER_VALIDATE_BOOL);
|
||||
$required['special'] = filter_var($_SESSION['users']['password_special']['boolean'] ?? false, FILTER_VALIDATE_BOOL);
|
||||
}
|
||||
|
||||
//prepare the data
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
$show = !empty($_GET["show"]) ? $_GET["show"] : '';
|
||||
|
||||
//set from session variables
|
||||
$list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false';
|
||||
$list_row_edit_button = filter_var($_SESSION['theme']['list_row_edit_button']['boolean'] ?? false, FILTER_VALIDATE_BOOL);
|
||||
|
||||
//add the search string
|
||||
if (!empty($search)) {
|
||||
@@ -251,7 +251,7 @@
|
||||
//echo th_order_by('add_date', $text['label-add_date'], $order_by, $order);
|
||||
echo th_order_by('contact_note', $text['label-contact_note'], $order_by, $order, null, "class='center'", $param);
|
||||
echo th_order_by('user_enabled', $text['label-user_enabled'], $order_by, $order, null, "class='center'", $param);
|
||||
if (permission_exists('user_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('user_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
@@ -300,7 +300,7 @@
|
||||
echo $text['label-'.$row['user_enabled']];
|
||||
}
|
||||
echo " </td>\n";
|
||||
if (permission_exists('user_edit') && $list_row_edit_button == 'true') {
|
||||
if (permission_exists('user_edit') && $list_row_edit_button) {
|
||||
echo " <td class='action-button'>\n";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
|
||||
Reference in New Issue
Block a user