Permissions: Consistify (new word!) permission names for Show All functionality on Devices & Destinations.

This commit is contained in:
Nate Jones
2015-03-29 01:33:56 +00:00
parent cd3d93a1fd
commit 4307cb800a
4 changed files with 16 additions and 16 deletions

View File

@@ -42,7 +42,7 @@
$apps[$x]['permissions'][$y]['name'] = 'destination_domain';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'destination_show_all';
$apps[$x]['permissions'][$y]['name'] = 'destination_all';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
$y++;

View File

@@ -56,7 +56,7 @@ else {
echo " <td width='50%' align='left' nowrap='nowrap' valign='top'><b>".$text['header-destinations']."</b></td>\n";
echo " <form method='get' action=''>\n";
echo " <td width='50%' align='right'>\n";
if (permission_exists('destination_show_all')) {
if (permission_exists('destination_all')) {
if ($_GET['showall'] == 'true') {
echo " <input type='hidden' name='showall' value='true'>";
}
@@ -78,7 +78,7 @@ else {
//get total destination count from the database
$sql = "select count(*) as num_rows from v_destinations ";
if ($_GET['showall'] && permission_exists('destination_show_all')) {
if ($_GET['showall'] && permission_exists('destination_all')) {
if (strlen($search) > 0) {
$sql .= "where ";
}
@@ -110,7 +110,7 @@ else {
//prepare to page the results
$rows_per_page = 150;
$param = "&search=".$search;
if ($_GET['showall'] && permission_exists('destination_show_all')) {
if ($_GET['showall'] && permission_exists('destination_all')) {
$param .= "&showall=true";
}
$page = $_GET['page'];
@@ -120,7 +120,7 @@ else {
//get the list
$sql = "select * from v_destinations ";
if ($_GET['showall'] && permission_exists('destination_show_all')) {
if ($_GET['showall'] && permission_exists('destination_all')) {
if (strlen($search) > 0) {
$sql .= " where ";
}
@@ -153,7 +153,7 @@ else {
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
if ($_GET['showall'] && permission_exists('destination_show_all')) {
if ($_GET['showall'] && permission_exists('destination_all')) {
echo th_order_by('domain_name', $text['label-domain-name'], $order_by, $order, '', '', $param);
}
echo th_order_by('destination_type', $text['label-destination_type'], $order_by, $order, '', '', $param);
@@ -174,7 +174,7 @@ else {
foreach($destination as $row) {
$tr_link = "href='destination_edit.php?id=".$row['destination_uuid']."'";
echo "<tr ".$tr_link.">\n";
if ($_GET['showall'] && permission_exists('destination_show_all')) {
if ($_GET['showall'] && permission_exists('destination_all')) {
echo " <td valign='top' class='".$row_style[$c]."'>".$_SESSION['domains'][$row['domain_uuid']]['domain_name']."</td>\n";
}
echo " <td valign='top' class='".$row_style[$c]."'>".ucwords($row['destination_type'])."</td>\n";
@@ -197,7 +197,7 @@ else {
} //end if results
echo "<tr>\n";
if ($_GET['showall'] && permission_exists('destination_show_all')) {
if ($_GET['showall'] && permission_exists('destination_all')) {
echo "<td colspan='7' align='right'>\n";
}
else {

View File

@@ -121,7 +121,7 @@
$apps[$x]['permissions'][$y]['name'] = 'device_profile_domain';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'device_show_all';
$apps[$x]['permissions'][$y]['name'] = 'device_all';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
//schema details

View File

@@ -58,7 +58,7 @@ else {
echo " </td>\n";
echo " <td align='right' nowrap='nowrap' valign='top'>\n";
echo " <form method='get' action=''>\n";
if (permission_exists('device_show_all')) {
if (permission_exists('device_all')) {
echo " <input type='button' class='btn' value='".$text['button-show_all']."' onclick=\"window.location='devices.php?showall=true';\">\n";
if ($_GET['showall'] == 'true') {
echo " <input type='hidden' name='showall' value='true'>";
@@ -87,14 +87,14 @@ else {
//prepare to page the results
$sql = "select count(*) as num_rows from v_devices ";
if ($_GET['showall'] && permission_exists('device_show_all')) {
if ($_GET['showall'] && permission_exists('device_all')) {
if (strlen($search) > 0) {
$sql .= "where ";
}
} else {
$sql .= "where (";
$sql .= " domain_uuid = '$domain_uuid' ";
if (permission_exists('device_show_all')) {
if (permission_exists('device_all')) {
$sql .= " or domain_uuid is null ";
}
$sql .= ") ";
@@ -134,14 +134,14 @@ else {
//get the list
$sql = "select * from v_devices ";
if ($_GET['showall'] && permission_exists('device_show_all')) {
if ($_GET['showall'] && permission_exists('device_all')) {
if (strlen($search) > 0) {
$sql .= "where ";
}
} else {
$sql .= "where (";
$sql .= " domain_uuid = '$domain_uuid' ";
if (permission_exists('device_show_all')) {
if (permission_exists('device_all')) {
$sql .= " or domain_uuid is null ";
}
$sql .= ") ";
@@ -178,7 +178,7 @@ else {
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
if ($_GET['showall'] && permission_exists('device_show_all')) {
if ($_GET['showall'] && permission_exists('device_all')) {
echo th_order_by('domain_name', $text['label-domain-name'], $order_by, $order, $param);
}
echo th_order_by('device_mac_address', $text['label-device_mac_address'], $order_by, $order);
@@ -203,7 +203,7 @@ else {
foreach($result as $row) {
$tr_link = (permission_exists('device_edit')) ? "href='device_edit.php?id=".$row['device_uuid']."'" : null;
echo "<tr ".$tr_link.">\n";
if ($_GET['showall'] && permission_exists('device_show_all')) {
if ($_GET['showall'] && permission_exists('device_all')) {
echo " <td valign='top' class='".$row_style[$c]."'>".$_SESSION['domains'][$row['domain_uuid']]['domain_name']."</td>\n";
}
echo " <td valign='top' class='".$row_style[$c]."'>";