-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfunctions.inc.php
More file actions
58 lines (55 loc) · 1.75 KB
/
functions.inc.php
File metadata and controls
58 lines (55 loc) · 1.75 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
<?php
/*if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); }
if(!function_exists('sysadmin_get_storage_email')){
function sysadmin_get_storage_email() {
echo "Funktion wir ausgefuehrt<br>\n";
return true;
}
}*/
function systemadminFetchEmail() {
$email = array();
$dbh = \FreePBX::Database();
$sql = 'SELECT value FROM systemadmin_settings WHERE `key` = \'notifications_settings\'';
$stmt = $dbh->prepare($sql);
$stmt->execute();
if ($result = $stmt->fetch(\PDO::FETCH_ASSOC)) {
$email = json_decode($result['value'], true);
}
return $email;
}
function systemadminFetchEmailConfig() {
$emailconfig = array();
$emailconfig['setup'] = "local";
$emailconfig['relayhost'] = "";
$emailconfig['port'] = "";
$emailconfig['username'] = "";
$dbh = \FreePBX::Database();
$sql = 'SELECT value FROM systemadmin_settings WHERE `key` = \'email_config\'';
$stmt = $dbh->prepare($sql);
$stmt->execute();
if ($result = $stmt->fetch(\PDO::FETCH_ASSOC)) {
$emailconfig = json_decode($result['value'], true);
}
return $emailconfig;
}
function systemadminFetchPacketCaptures() {
$packetcaptures = array();
$dbh = \FreePBX::Database();
$sql = 'SELECT id, date, stopped FROM systemadmin_packetcapture';
$stmt = $dbh->prepare($sql);
$stmt->execute();
$packetcapture = $stmt->fetchAll(PDO::FETCH_ASSOC);
return $packetcapture;
}
function systemadminFetchStorageConfig() {
$storageconfig = array();
$dbh = \FreePBX::Database();
$sql = 'SELECT value FROM systemadmin_settings WHERE `key` = \'storage_settings\'';
$stmt = $dbh->prepare($sql);
$stmt->execute();
if ($result = $stmt->fetch(\PDO::FETCH_ASSOC)) {
$storageconfig = json_decode($result['value'], true);
}
return $storageconfig;
}
?>