Adjust the indentation and organization of these to xml cdr files.
This commit is contained in:
parent
d47151ba8d
commit
7895492492
|
|
@ -24,16 +24,20 @@
|
||||||
Mark J Crane <markjcrane@fusionpbx.com>
|
Mark J Crane <markjcrane@fusionpbx.com>
|
||||||
Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
|
Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
|
||||||
*/
|
*/
|
||||||
require_once "root.php";
|
|
||||||
require_once "resources/require.php";
|
//includes
|
||||||
require_once "resources/check_auth.php";
|
require_once "root.php";
|
||||||
if (permission_exists('xml_cdr_view')) {
|
require_once "resources/require.php";
|
||||||
//access granted
|
require_once "resources/check_auth.php";
|
||||||
}
|
|
||||||
else {
|
//check permisions
|
||||||
echo "access denied";
|
if (permission_exists('xml_cdr_view')) {
|
||||||
exit;
|
//access granted
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
echo "access denied";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
//add multi-lingual support
|
//add multi-lingual support
|
||||||
$language = new text;
|
$language = new text;
|
||||||
|
|
|
||||||
|
|
@ -23,46 +23,49 @@
|
||||||
Contributor(s):
|
Contributor(s):
|
||||||
Mark J Crane <markjcrane@fusionpbx.com>
|
Mark J Crane <markjcrane@fusionpbx.com>
|
||||||
*/
|
*/
|
||||||
include "root.php";
|
|
||||||
require_once "resources/require.php";
|
//includes
|
||||||
require_once "resources/check_auth.php";
|
include "root.php";
|
||||||
if (permission_exists('xml_cdr_delete')) {
|
require_once "resources/require.php";
|
||||||
//access granted
|
require_once "resources/check_auth.php";
|
||||||
}
|
|
||||||
else {
|
//check permisions
|
||||||
echo "access denied";
|
if (permission_exists('xml_cdr_delete')) {
|
||||||
exit;
|
//access granted
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
echo "access denied";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
//add multi-lingual support
|
//add multi-lingual support
|
||||||
$language = new text;
|
$language = new text;
|
||||||
$text = $language->get();
|
$text = $language->get();
|
||||||
|
|
||||||
//get posted values, if any
|
//get posted values, if any
|
||||||
if (sizeof($_REQUEST) > 0) {
|
if (sizeof($_REQUEST) > 0) {
|
||||||
|
$xml_cdr_uuids = $_REQUEST["id"];
|
||||||
|
$recording_file_path = $_REQUEST["rec"];
|
||||||
|
|
||||||
$xml_cdr_uuids = $_REQUEST["id"];
|
if (sizeof($xml_cdr_uuids) > 0) {
|
||||||
$recording_file_path = $_REQUEST["rec"];
|
foreach ($xml_cdr_uuids as $index => $xml_cdr_uuid) {
|
||||||
|
// delete record
|
||||||
if (sizeof($xml_cdr_uuids) > 0) {
|
$sql = "delete from v_xml_cdr ";
|
||||||
foreach ($xml_cdr_uuids as $index => $xml_cdr_uuid) {
|
$sql .= "where uuid = '".$xml_cdr_uuid."' ";
|
||||||
// delete record
|
$sql .= "and domain_uuid = '".$domain_uuid."' ";
|
||||||
$sql = "delete from v_xml_cdr ";
|
$prep_statement = $db->prepare(check_sql($sql));
|
||||||
$sql .= "where uuid = '".$xml_cdr_uuid."' ";
|
$prep_statement->execute();
|
||||||
$sql .= "and domain_uuid = '".$domain_uuid."' ";
|
unset($sql, $prep_statement);
|
||||||
$prep_statement = $db->prepare(check_sql($sql));
|
//delete recording, if any
|
||||||
$prep_statement->execute();
|
if ($recording_file_path[$index] != '' && file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name'].base64_decode($recording_file_path[$index]))) {
|
||||||
unset($sql, $prep_statement);
|
@unlink($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name'].base64_decode($recording_file_path[$index]));
|
||||||
//delete recording, if any
|
}
|
||||||
if ($recording_file_path[$index] != '' && file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name'].base64_decode($recording_file_path[$index]))) {
|
|
||||||
@unlink($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name'].base64_decode($recording_file_path[$index]));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
//set message and redirect the user
|
||||||
|
$_SESSION["message"] = $text['message-delete'].": ".sizeof($xml_cdr_uuids);
|
||||||
|
header("Location: xml_cdr.php".(($_SESSION['xml_cdr']['last_query'] != '') ? "?".$_SESSION['xml_cdr']['last_query'] : null));
|
||||||
|
|
||||||
// set message
|
|
||||||
$_SESSION["message"] = $text['message-delete'].": ".sizeof($xml_cdr_uuids);
|
|
||||||
header("Location: xml_cdr.php".(($_SESSION['xml_cdr']['last_query'] != '') ? "?".$_SESSION['xml_cdr']['last_query'] : null));
|
|
||||||
?>
|
?>
|
||||||
Loading…
Reference in New Issue