mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Cache key add hostname prefix
This commit is contained in:
@@ -144,7 +144,7 @@
|
||||
//clear the cache
|
||||
$cache = new cache;
|
||||
$cache->delete("configuration:acl.conf");
|
||||
$cache->delete("configuration:sofia.conf:".gethostname());
|
||||
$cache->delete(gethostname().":configuration:sofia.conf");
|
||||
|
||||
//create the event socket connection
|
||||
$esl = event_socket::create();
|
||||
|
||||
@@ -116,10 +116,10 @@
|
||||
//delete extension from the cache
|
||||
$cache = new cache;
|
||||
if (!empty($row['extension'])) {
|
||||
$cache->delete("directory:".$row['extension']."@".$_SESSION['user']['domain_name']);
|
||||
$cache->delete(gethostname().":directory:".$row['extension']."@".$_SESSION['user']['domain_name']);
|
||||
}
|
||||
if (!empty($number_alias)) {
|
||||
$cache->delete("directory:".$row['number_alias']."@".$_SESSION['user']['domain_name']);
|
||||
$cache->delete(gethostname().":directory:".$row['number_alias']."@".$_SESSION['user']['domain_name']);
|
||||
}
|
||||
|
||||
//incrment
|
||||
@@ -137,10 +137,10 @@
|
||||
//delete extension from the cache
|
||||
$cache = new cache;
|
||||
if (!empty($row['extension'])) {
|
||||
$cache->delete("directory:".$row['extension']."@".$_SESSION['user']['domain_name']);
|
||||
$cache->delete(gethostname().":directory:".$row['extension']."@".$_SESSION['user']['domain_name']);
|
||||
}
|
||||
if (!empty($number_alias)) {
|
||||
$cache->delete("directory:".$row['number_alias']."@".$_SESSION['user']['domain_name']);
|
||||
$cache->delete(gethostname().":directory:".$row['number_alias']."@".$_SESSION['user']['domain_name']);
|
||||
}
|
||||
|
||||
//incrment
|
||||
@@ -162,10 +162,11 @@
|
||||
//delete extension from the cache
|
||||
$cache = new cache;
|
||||
if (!empty($extension)) {
|
||||
$cache->delete(gethostname().":directory:".$extension."@".$this->domain_name);
|
||||
$cache->delete("directory:".$extension."@".$domain_name);
|
||||
}
|
||||
if (!empty($number_alias)) {
|
||||
$cache->delete("directory:".$number_alias."@".$domain_name);
|
||||
$cache->delete(gethostname().":directory:".$number_alias."@".$this->domain_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -419,9 +419,9 @@
|
||||
|
||||
//clear the cache
|
||||
$cache = new cache;
|
||||
$cache->delete("directory:".$extension."@".$_SESSION['domain_name']);
|
||||
$cache->delete(gethostname().":directory:".$extension."@".$_SESSION['domain_name']);
|
||||
if (!empty($number_alias)) {
|
||||
$cache->delete("directory:".$number_alias."@".$_SESSION['domain_name']);
|
||||
$cache->delete(gethostname().":directory:".$number_alias."@".$_SESSION['domain_name']);
|
||||
}
|
||||
|
||||
//add the message
|
||||
|
||||
@@ -144,9 +144,9 @@
|
||||
|
||||
//delete extension from the cache
|
||||
$cache = new cache;
|
||||
$cache->delete("directory:" . $this->extension . "@" . $this->domain_name);
|
||||
$cache->delete(gethostname().":directory:" . $this->extension . "@" . $this->domain_name);
|
||||
if (!empty($this->number_alias)) {
|
||||
$cache->delete("directory:" . $this->number_alias . "@" . $this->domain_name);
|
||||
$cache->delete(gethostname().":directory:" . $this->number_alias . "@" . $this->domain_name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -291,9 +291,9 @@
|
||||
//clear the cache
|
||||
$cache = new cache;
|
||||
foreach ($extensions as $uuid => $extension) {
|
||||
$cache->delete("directory:" . $extension['extension'] . "@" . $this->domain_name);
|
||||
$cache->delete(gethostname().":directory:" . $extension['extension'] . "@" . $_SESSION['domain_name']);
|
||||
if ($extension['number_alias'] != '') {
|
||||
$cache->delete("directory:" . $extension['number_alias'] . "@" . $this->domain_name);
|
||||
$cache->delete(gethostname().":directory:" . $extension['number_alias'] . "@" . $_SESSION['domain_name']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -174,9 +174,9 @@
|
||||
|
||||
//delete extension from the cache
|
||||
$cache = new cache;
|
||||
$cache->delete("directory:".$this->extension."@".$this->domain_name);
|
||||
$cache->delete(gethostname().":directory:".$this->extension."@".$this->domain_name);
|
||||
if(!empty($this->number_alias)){
|
||||
$cache->delete("directory:".$this->number_alias."@".$this->domain_name);
|
||||
$cache->delete(gethostname().":directory:".$this->number_alias."@".$this->domain_name);
|
||||
}
|
||||
|
||||
} //function
|
||||
@@ -316,9 +316,9 @@
|
||||
//clear the cache
|
||||
$cache = new cache;
|
||||
foreach ($extensions as $uuid => $extension) {
|
||||
$cache->delete("directory:".$extension['extension']."@".$this->domain_name);
|
||||
$cache->delete(gethostname().":directory:".$extension['extension']."@".$_SESSION['domain_name']);
|
||||
if ($extension['number_alias'] != '') {
|
||||
$cache->delete("directory:".$extension['number_alias']."@".$this->domain_name);
|
||||
$cache->delete(gethostname().":directory:".$extension['number_alias']."@".$_SESSION['domain_name']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -459,9 +459,9 @@
|
||||
//clear the cache
|
||||
$cache = new cache;
|
||||
foreach ($extensions as $uuid => $extension) {
|
||||
$cache->delete("directory:".$extension['extension']."@".$this->domain_name);
|
||||
$cache->delete(gethostname().":directory:".$extension['extension']."@".$_SESSION['domain_name']);
|
||||
if ($extension['number_alias'] != '') {
|
||||
$cache->delete("directory:".$extension['number_alias']."@".$this->domain_name);
|
||||
$cache->delete(gethostname().":directory:".$extension['number_alias']."@".$_SESSION['domain_name']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -160,8 +160,8 @@
|
||||
$parameters['extension_uuid'] = $extension_uuid;
|
||||
$extension = $database->select($sql, $parameters, 'row');
|
||||
$cache = new cache;
|
||||
$cache->delete("directory:".$extension["extension"]."@".$extension["user_context"]);
|
||||
$cache->delete("directory:".$extension["number_alias"]."@".$extension["user_context"]);
|
||||
$cache->delete(gethostname().":directory:".$extension["extension"]."@".$extension["user_context"]);
|
||||
$cache->delete(gethostname().":directory:".$extension["number_alias"]."@".$extension["user_context"]);
|
||||
|
||||
//redirect the user
|
||||
if (isset($action)) {
|
||||
|
||||
@@ -135,8 +135,8 @@
|
||||
$parameters['extension_uuid'] = $this->extension_uuid;
|
||||
$extension = $this->database->select($sql, $parameters, 'row');
|
||||
$cache = new cache;
|
||||
$cache->delete("directory:".$extension["extension"]."@".$extension["user_context"]);
|
||||
$cache->delete("directory:".$extension["number_alias"]."@".$extension["user_context"]);
|
||||
$cache->delete(gethostname().":directory:".$extension["extension"]."@".$extension["user_context"]);
|
||||
$cache->delete(gethostname().":directory:".$extension["number_alias"]."@".$extension["user_context"]);
|
||||
|
||||
//set message
|
||||
message::add($text['message-delete']);
|
||||
@@ -211,8 +211,8 @@
|
||||
$parameters['extension_uuid'] = $extension_uuid;
|
||||
$extension = $this->database->select($sql, $parameters, 'row');
|
||||
$cache = new cache;
|
||||
$cache->delete("directory:".$extension["extension"]."@".$extension["user_context"]);
|
||||
$cache->delete("directory:".$extension["number_alias"]."@".$extension["user_context"]);
|
||||
$cache->delete(gethostname().":directory:".$extension["extension"]."@".$extension["user_context"]);
|
||||
$cache->delete(gethostname().":directory:".$extension["number_alias"]."@".$extension["user_context"]);
|
||||
|
||||
//set message
|
||||
message::add($text['message-toggle']);
|
||||
|
||||
@@ -862,9 +862,9 @@
|
||||
$user_context = $database->select($sql, $parameters, 'column');
|
||||
}
|
||||
$cache = new cache;
|
||||
$cache->delete("directory:".$extension."@".$user_context);
|
||||
$cache->delete(gethostname().":directory:".$extension."@".$user_context);
|
||||
if (permission_exists('number_alias') && !empty($number_alias)) {
|
||||
$cache->delete("directory:".$number_alias."@".$user_context);
|
||||
$cache->delete(gethostname().":directory:".$number_alias."@".$user_context);
|
||||
}
|
||||
|
||||
//clear the destinations session array
|
||||
|
||||
@@ -696,9 +696,9 @@
|
||||
//clear the cache
|
||||
foreach ($extensions as $x => $extension) {
|
||||
$cache = new cache;
|
||||
$cache->delete("directory:".$extension['extension']."@".$extension['user_context']);
|
||||
$cache->delete(gethostname().":directory:".$extension['extension']."@".$extension['user_context']);
|
||||
if (permission_exists('number_alias') && !empty($extension['number_alias'])) {
|
||||
$cache->delete("directory:".$extension['number_alias']."@".$extension['user_context']);
|
||||
$cache->delete(gethostname().":directory:".$extension['number_alias']."@".$extension['user_context']);
|
||||
}
|
||||
}
|
||||
unset($extensions);
|
||||
@@ -807,9 +807,9 @@
|
||||
//clear the cache
|
||||
foreach ($extensions as $uuid => $extension) {
|
||||
$cache = new cache;
|
||||
$cache->delete("directory:".$extension['extension']."@".$extension['user_context']);
|
||||
$cache->delete(gethostname().":directory:".$extension['extension']."@".$extension['user_context']);
|
||||
if (permission_exists('number_alias') && !empty($extension['number_alias'])) {
|
||||
$cache->delete("directory:".$extension['number_alias']."@".$extension['user_context']);
|
||||
$cache->delete(gethostname().":directory:".$extension['number_alias']."@".$extension['user_context']);
|
||||
}
|
||||
}
|
||||
unset($extensions);
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
//clear the cache
|
||||
$cache = new cache;
|
||||
foreach($_SESSION['user']['extension'] as $field) {
|
||||
$cache->delete("directory:".$field['destination']."@".$field['user_context']);
|
||||
$cache->delete(gethostname().":directory:".$field['destination']."@".$field['user_context']);
|
||||
}
|
||||
|
||||
//set the message
|
||||
|
||||
@@ -145,10 +145,8 @@
|
||||
save_gateway_xml();
|
||||
|
||||
//clear the cache
|
||||
$esl = event_socket::create();
|
||||
$hostname = trim(event_socket::api('switchname'));
|
||||
$cache = new cache;
|
||||
$cache->delete("configuration:sofia.conf:".$hostname);
|
||||
$cache->delete(gethostname().":configuration:sofia.conf");
|
||||
|
||||
//set message
|
||||
message::add($text['message-copy']);
|
||||
|
||||
@@ -223,10 +223,8 @@
|
||||
save_gateway_xml();
|
||||
|
||||
//clear the cache
|
||||
$esl = event_socket::create();
|
||||
$hostname = trim(event_socket::api('switchname'));
|
||||
$cache = new cache;
|
||||
$cache->delete("configuration:sofia.conf:".$hostname);
|
||||
$cache->delete(gethostname().":configuration:sofia.conf");
|
||||
|
||||
//rescan the external profile to look for new or stopped gateways
|
||||
//create the event socket connection
|
||||
|
||||
@@ -343,12 +343,9 @@
|
||||
save_gateway_xml();
|
||||
|
||||
//clear the cache
|
||||
$esl = event_socket::create();
|
||||
if ($esl->is_connected()) {
|
||||
$hostname = trim(event_socket::api('switchname'));
|
||||
$cache = new cache;
|
||||
$cache->delete("configuration:sofia.conf:".$hostname);
|
||||
}
|
||||
|
||||
$cache = new cache;
|
||||
$cache->delete(gethostname().":configuration:sofia.conf");
|
||||
|
||||
//rescan the sip profile to look for new or stopped gateways
|
||||
$esl = event_socket::create();
|
||||
@@ -464,7 +461,7 @@
|
||||
|
||||
//clear the cache
|
||||
$esl = event_socket::create();
|
||||
$hostname = trim(event_socket::api('switchname'));
|
||||
$hostname = trim(event_socket::api('hostname'));
|
||||
$cache = new cache;
|
||||
$cache->delete("configuration:sofia.conf:".$hostname);
|
||||
|
||||
@@ -587,7 +584,7 @@
|
||||
|
||||
//clear the cache
|
||||
$esl = event_socket::create();
|
||||
$hostname = trim(event_socket::api('switchname'));
|
||||
$hostname = trim(event_socket::api('hostname'));
|
||||
$cache = new cache;
|
||||
$cache->delete("configuration:sofia.conf:".$hostname);
|
||||
|
||||
|
||||
@@ -182,10 +182,9 @@
|
||||
}
|
||||
}
|
||||
if ($empty_hostname) {
|
||||
$esl = event_socket::create();
|
||||
if ($esl->is_connected()) {
|
||||
$hostnames[] = event_socket::api('switchname');
|
||||
}
|
||||
|
||||
$hostnames[] = gethostname();
|
||||
|
||||
}
|
||||
|
||||
//clear the cache
|
||||
@@ -193,7 +192,7 @@
|
||||
$hostnames = array_unique($hostnames);
|
||||
$cache = new cache;
|
||||
foreach ($hostnames as $hostname) {
|
||||
$cache->delete("configuration:sofia.conf:".$hostname);
|
||||
$cache->delete($hostname.":configuration:sofia.conf");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,10 +260,7 @@
|
||||
|
||||
//get system hostname if necessary
|
||||
if (empty($sip_profile_hostname)) {
|
||||
$esl = event_socket::create();
|
||||
if ($esl->is_connected()) {
|
||||
$sip_profile_hostname = event_socket::api('switchname');
|
||||
}
|
||||
$sip_profile_hostname = gethostname();
|
||||
}
|
||||
|
||||
//clear the cache
|
||||
@@ -335,16 +331,13 @@
|
||||
|
||||
//get system hostname if necessary
|
||||
if (empty($sip_profile_hostname)) {
|
||||
$esl = event_socket::create();
|
||||
if ($esl->is_connected()) {
|
||||
$sip_profile_hostname = event_socket::api('switchname');
|
||||
}
|
||||
$sip_profile_hostname = gethostname();
|
||||
}
|
||||
|
||||
//clear the cache
|
||||
if (!empty($sip_profile_hostname)) {
|
||||
$cache = new cache;
|
||||
$cache->delete("configuration:sofia.conf:".$sip_profile_hostname);
|
||||
$cache->delete($sip_profile_hostname.":configuration:sofia.conf");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -422,7 +415,7 @@
|
||||
if ($empty_hostname) {
|
||||
$esl = event_socket::create();
|
||||
if ($esl->is_connected()) {
|
||||
$hostnames[] = event_socket::api('switchname');
|
||||
$hostnames[] = gethostname();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -240,16 +240,13 @@
|
||||
}
|
||||
|
||||
//get the hostname
|
||||
if ($sip_profile_hostname == '') {
|
||||
$esl = event_socket::create();
|
||||
if ($esl->is_connected()) {
|
||||
$sip_profile_hostname = event_socket::api('switchname');
|
||||
}
|
||||
if (empty($sip_profile_hostname) {
|
||||
$sip_profile_hostname = gethostname();
|
||||
}
|
||||
|
||||
//clear the cache
|
||||
$cache = new cache;
|
||||
$cache->delete("configuration:sofia.conf:".$sip_profile_hostname);
|
||||
$cache->delete($sip_profile_hostname.":configuration:sofia.conf");
|
||||
|
||||
//save the sip profile xml
|
||||
save_sip_profile_xml();
|
||||
|
||||
@@ -56,9 +56,8 @@
|
||||
unset($sql);
|
||||
|
||||
//get the sip profiles
|
||||
if ($esl->is_connected()) {
|
||||
$hostname = trim(event_socket::api('switchname'));
|
||||
}
|
||||
$hostname = gethostname();
|
||||
|
||||
$sql = "select sip_profile_uuid, sip_profile_name from v_sip_profiles ";
|
||||
$sql .= "where sip_profile_enabled = true ";
|
||||
if (!empty($hostname)) {
|
||||
|
||||
Reference in New Issue
Block a user