Fax Server: Database class integration.

This commit is contained in:
Nate
2019-08-07 18:59:26 -06:00
parent e94f154ee4
commit d23c5d84c4
16 changed files with 836 additions and 940 deletions
+19 -28
View File
@@ -38,37 +38,28 @@ else {
}
//authorized referrer
if(stristr($_SERVER["HTTP_REFERER"], '/fax_active.php') === false) {
echo " access denied";
exit;
}
//http get variables set to php variables
if (count($_GET)>0) {
$cmd = trim(check_str($_GET['cmd']));
$fax_uuid = trim(check_str($_GET['id']));
}
//authorized commands
if ($cmd == 'delete') {
//authorized;
} else {
//not found. this command is not authorized
if (stristr($_SERVER["HTTP_REFERER"], '/fax_active.php') === false) {
echo "access denied";
exit;
}
//Command
if ($cmd == 'delete') {
if($fax_uuid){
$sql = <<<HERE
delete from v_fax_tasks
where fax_task_uuid='$fax_uuid'
HERE;
$result = $db->exec($sql);
// if($result === false){
// var_dump($db->errorInfo());
// }
}
//http get variables set to php variables
$cmd = trim($_GET['cmd']);
$fax_uuid = trim($_GET['id']);
//command
if ($cmd == 'delete' && is_uuid($fax_uuid)) {
$array['fax_tasks'][0]['fax_task_uuid'] = $fax_uuid;
$p = new permissions;
$p->add('fax_task_delete', 'temp');
$database = new database;
$database->app_name = 'fax';
$database->app_uuid = '24108154-4ac3-1db6-1551-4731703a4440';
$database->delete($array);
unset($array);
$p->delete('fax_task_delete', 'temp');
}
?>