-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcallData.php
More file actions
75 lines (73 loc) · 2.1 KB
/
callData.php
File metadata and controls
75 lines (73 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
include('lock.h');
include_once('auditTrial.php');
function hasMultipleUcidCalls($ucid) {
$sql="SELECT id_uniquekey FROM t_astcalldata WHERE id_ucid='$ucid'";
$result=mysql_query($sql);
$row=mysql_fetch_array($result);
if (mysql_num_rows($result)>1) {
return true;
}
return false;
}
function recPath($key) {
$sql="SELECT id_recpath, id_archivepath FROM t_astcalldata WHERE id_uniquekey='$key'";
$result=mysql_query($sql);
$row=mysql_fetch_array($result);
if (mysql_num_rows($result)==1) {
if (file_exists(substr($row['id_recpath'], 1))) {
$recpath = $row['id_recpath'];
} else {
$recpath = $row['id_archivepath'];
}
$pos = strpos($recpath, ".ssl");
if ($pos!==FALSE) {
return substr($recpath, 0, $pos);
}
$pos = strpos($recpath, ".gpg");
if ($pos!==FALSE) {
return substr($recpath, 0, $pos);
}
return $recpath;
}
}
function recPathArray($key) {
$sql="SELECT id_recpath, id_archivepath, id_recformat FROM t_astcalldata WHERE id_uniquekey='$key'";
$result=mysql_query($sql);
$row=mysql_fetch_array($result);
if (mysql_num_rows($result)==1) {
if (file_exists(substr($row['id_recpath'], 1))) {
$recpath = $row['id_recpath'];
} else {
$recpath = $row['id_archivepath'];
}
$recformat = $row['id_recformat'];
if ((strpos($recpath, ".ssl")!==FALSE) ||
(strpos($recpath, ".gpg")!==FALSE)) {
$url = "http://localhost:5003/recordpath?recordkey=$key";
$ch = curl_init();
// Will return the response, if false it print the response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Set the url
curl_setopt($ch, CURLOPT_URL,$url);
// Execute
$result=curl_exec($ch);
// Closing
curl_close($ch);
if (!empty($result)) {
$data = json_decode($result, true);
if (!empty($data)) {
if ($data['result']=='success') {
return array($data['recordpath'], $recformat, $data['decrypted'], $data['filename']);
}
}
}
} else {
$pos = strrpos($recpath, "/");
$filename = substr($recpath, $pos+1);
return array($recpath, $recformat, "false", $filename);
}
}
return array();
}
?>