Update sip_profiles.php

This commit is contained in:
FusionPBX 2018-07-04 12:01:09 -06:00 committed by GitHub
parent 67ed8acbb0
commit 8a744da327
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 8 deletions

View File

@ -93,8 +93,12 @@
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$sip_profiles = $prep_statement->fetchAll(PDO::FETCH_NAMED);
foreach ($sip_profiles as &$row) { $row = array_map("escape", $row); }
unset ($prep_statement, $sql);
//escape the search
$search = escape($search);
//alternate the row style
$c = 0;
$row_style["0"] = "row_style0";
@ -106,7 +110,7 @@
echo " <td width='50%' align='left' nowrap='nowrap'><b>".$text['title-sip_profiles']."</b></td>\n";
echo " <form method='get' action=''>\n";
echo " <td width='50%' style='vertical-align: top; text-align: right; white-space: nowrap;'>\n";
echo " <input type='text' class='txt' style='width: 150px' name='search' id='search' value='".escape($search)."'>\n";
echo " <input type='text' class='txt' style='width: 150px' name='search' id='search' value='".$search."'>\n";
echo " <input type='submit' class='btn' name='submit' value='".$text['button-search']."'>\n";
echo " </td>\n";
echo " </form>\n";
@ -137,19 +141,19 @@
if (is_array($sip_profiles)) {
foreach($sip_profiles as $row) {
if (permission_exists('sip_profile_edit')) {
$tr_link = "href='sip_profile_edit.php?id=".escape($row['sip_profile_uuid'])."'";
$tr_link = "href='sip_profile_edit.php?id=".$row['sip_profile_uuid']."'";
}
echo "<tr ".$tr_link.">\n";
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['sip_profile_name'])."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['sip_profile_hostname'])."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".escape($row['sip_profile_enabled'])."&nbsp;</td>\n";
echo " <td valign='top' class='row_stylebg'>".escape($row['sip_profile_description'])."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['sip_profile_name']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['sip_profile_hostname']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['sip_profile_enabled']."&nbsp;</td>\n";
echo " <td valign='top' class='row_stylebg'>".$row['sip_profile_description']."&nbsp;</td>\n";
echo " <td class='list_control_icons'>";
if (permission_exists('sip_profile_edit')) {
echo "<a href='sip_profile_edit.php?id=".escape($row['sip_profile_uuid'])."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
echo "<a href='sip_profile_edit.php?id=".$row['sip_profile_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
}
if (permission_exists('sip_profile_delete')) {
echo "<a href='sip_profile_delete.php?id=".escape($row['sip_profile_uuid'])."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
echo "<a href='sip_profile_delete.php?id=".$row['sip_profile_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
}
echo " </td>\n";
echo "</tr>\n";