Update user_settings.php

This commit is contained in:
FusionPBX 2018-08-30 09:57:55 -06:00 committed by GitHub
parent e3fae9043d
commit 2315fa8ff9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -99,6 +99,7 @@
$sql .= "and not ( ";
$sql .= "(user_setting_category = 'domain' and user_setting_subcategory = 'language') ";
$sql .= "or (user_setting_category = 'domain' and user_setting_subcategory = 'time_zone') ";
$sql .= "or (user_setting_category = 'message' and user_setting_subcategory = 'key') ";
$sql .= ") ";
if (strlen($order_by) == 0) {
$sql .= "order by user_setting_category, user_setting_subcategory, user_setting_order asc ";
@ -109,8 +110,7 @@
$sql .= "limit $rows_per_page offset $offset ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$result_count = count($result);
$user_settings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
unset ($prep_statement, $sql);
$c = 0;
@ -120,9 +120,9 @@
//show the content
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
if ($result_count > 0) {
if (is_array($user_settings)) {
$previous_category = '';
foreach($result as $row) {
foreach($user_settings as $row) {
if ($previous_category != $row['user_setting_category']) {
$c = 0;
echo "<tr>\n";
@ -247,7 +247,7 @@
$previous_category = $row['user_setting_category'];
if ($c==0) { $c=1; } else { $c=0; }
} //end foreach
unset($sql, $result, $row_count);
unset($sql, $user_settings);
} //end if results
echo "<tr>\n";
@ -260,7 +260,7 @@
if (permission_exists('user_setting_add')) {
echo "<a href='user_setting_edit.php?user_uuid=".check_str($_GET['id'])."' alt='".$text['button-add']."'>$v_link_label_add</a>";
}
if (permission_exists('user_setting_delete') && $result_count > 0) {
if (permission_exists('user_setting_delete') && is_array($user_settings)) {
echo "<a href='javascript:void(0);' onclick=\"if (confirm('".$text['confirm-delete']."')) { document.getElementById('frm_settings').submit(); }\" alt='".$text['button-delete']."'>".$v_link_label_delete."</a>";
}
echo " </td>\n";