SIP Profiles: Database class integration.

This commit is contained in:
Nate
2019-08-13 07:32:07 -06:00
parent 1041c2a76f
commit 4002f3cd01
8 changed files with 462 additions and 502 deletions
+20 -17
View File
@@ -38,29 +38,32 @@ else {
$language = new text;
$text = $language->get();
if (count($_GET)>0) {
$id = check_str($_GET["id"]);
$sip_profile_uuid = check_str($_GET["sip_profile_uuid"]);
}
if (strlen($id)>0) {
//delete the sip profile setting
$sql = "delete from v_sip_profile_settings ";
$sql .= "where sip_profile_setting_uuid = '$id' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
unset($sql);
//get ids
$sip_profile_setting_uuid = $_GET["id"];
$sip_profile_uuid = $_GET["sip_profile_uuid"];
if (is_uuid($sip_profile_setting_uuid) && is_uuid($sip_profile_uuid)) {
//build array
$array['sip_profile_settings'][0]['sip_profile_setting_uuid'] = $sip_profile_setting_uuid;
//execute delete
$database = new database;
$database->app_name = 'sip_profiles';
$database->app_uuid = '159a8da8-0e8c-a26b-6d5b-19c532b6d470';
$database->delete($array);
unset($array);
//save the sip profile xml
save_sip_profile_xml();
//apply settings reminder
$_SESSION["reload_xml"] = true;
//set message
message::add($text['message-delete']);
//redirect
header("Location: sip_profile_edit.php?id=".$sip_profile_uuid);
exit;
}
//redirect the browser
message::add($text['message-delete']);
header("Location: sip_profile_edit.php?id=".$sip_profile_uuid);
return;
//default redirect
header("Location: sip_profiles.php");
exit;
?>