Update sip_profile_delete.php

Delete data from the sip profile domains table.
This commit is contained in:
FusionPBX 2017-01-24 04:10:35 -07:00 committed by GitHub
parent 47573debcf
commit d76371522e
1 changed files with 23 additions and 12 deletions

View File

@ -17,22 +17,26 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2015 Portions created by the Initial Developer are Copyright (C) 2008-2016
the Initial Developer. All Rights Reserved. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
*/ */
require_once "root.php";
require_once "resources/require.php"; //includes
require_once "resources/check_auth.php"; require_once "root.php";
if (permission_exists('sip_profile_delete')) { require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('sip_profile_delete')) {
//access granted //access granted
} }
else { else {
echo "access denied"; echo "access denied";
exit; exit;
} }
//add multi-lingual support //add multi-lingual support
$language = new text; $language = new text;
@ -59,6 +63,13 @@ else {
} }
unset ($prep_statement); unset ($prep_statement);
//delete the sip profile domains
$sql = "delete from v_sip_profile_domains ";
$sql .= "where sip_profile_uuid = '$id' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
unset($sql);
//delete the sip profile settings //delete the sip profile settings
$sql = "delete from v_sip_profile_settings "; $sql = "delete from v_sip_profile_settings ";
$sql .= "where sip_profile_uuid = '$id' "; $sql .= "where sip_profile_uuid = '$id' ";