Update gateways.php

Reverse the changes to the Gateways list to fix multiple bugs introduced to it from a pull request.
This commit is contained in:
FusionPBX
2016-11-25 20:37:44 -07:00
committed by GitHub
parent 352877108d
commit 90d9fbff02

View File

@@ -23,16 +23,20 @@
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
if (permission_exists('gateway_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//includes
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('gateway_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
@@ -169,30 +173,11 @@ else {
if ($total_gateways > 0) {
foreach($gateways as $row) {
$edit_link = null;
$delete_link = null;
if (strlen($row['domain_uuid']) == 0) {
if (permission_exists('gateway_domain')) {
if (permission_exists('gateway_edit')) {
$edit_link = "href='gateway_edit.php?id=".$row['gateway_uuid'];
}
if (permission_exists('gateway_delete')) {
$delete_link = "href='gateway_delete.php?id=".$row['gateway_uuid'];
}
}
}
else {
if (permission_exists('gateway_edit')) {
$edit_link = "href='gateway_edit.php?id=".$row['gateway_uuid'];
}
if (permission_exists('gateway_delete')) {
$delete_link = "href='gateway_delete.php?id=".$row['gateway_uuid'];
}
}
echo "<tr ".$edit_link.">\n";
$tr_link = (permission_exists('gateway_edit')) ? "href='gateway_edit.php?id=".$row['gateway_uuid']."'" : null;
echo "<tr ".$tr_link.">\n";
echo " <td valign='top' class='".$row_style[$c]."'>";
if (strlen($edit_link) > 0) {
echo "<a href='$edit_link'>".$row["gateway"]."</a>";
if (permission_exists('gateway_edit')) {
echo "<a href='gateway_edit.php?id=".$row['gateway_uuid']."'>".$row["gateway"]."</a>";
}
else {
echo $row["gateway"];
@@ -236,18 +221,18 @@ else {
}
echo " <td valign='top' class='row_stylebg'>".$row["description"]."&nbsp;</td>\n";
echo " <td class='list_control_icons'>";
if (strlen($edit_link) > 0) {
echo "<a href='$edit_link' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
if (permission_exists('gateway_edit')) {
echo "<a href='gateway_edit.php?id=".$row['gateway_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
}
if (strlen($delete_link) > 0) {
echo "<a href='$delete_link' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
if (permission_exists('gateway_delete')) {
echo "<a href='gateway_delete.php?id=".$row['gateway_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
}
echo " </td>\n";
echo "</tr>\n";
}
if ($c==0) { $c=1; } else { $c=0; }
} //end foreach
unset($sql, $gateways, $row_count, $edit_link, $delete_link);
unset($sql, $gateways, $row_count);
} //end if results
echo "<tr>\n";
@@ -260,4 +245,4 @@ else {
//include the footer
require_once "resources/footer.php";
?>
?>