mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
\r\n --> \n
Cause all the .php files containing lines ending with \r\n to instead end with \n.
DYI with:
find fusionpbx -type f -name '*.php' -exec dos2unix '{}' \;
This commit is contained in:
@@ -1,170 +1,170 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Copyright (C) 2010-2015
|
||||
All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Matthew Vale <github@mafoo.org>
|
||||
|
||||
*/
|
||||
require_once "root.php";
|
||||
require_once "resources/classes/event_socket.php";
|
||||
|
||||
//define the install class
|
||||
class detect_switch {
|
||||
|
||||
// cached data
|
||||
protected $_dirs;
|
||||
protected $_vdirs;
|
||||
public function get_dirs() { return $this->_dirs; }
|
||||
public function get_vdirs() { return $this->_vdirs; }
|
||||
|
||||
// version information
|
||||
protected $_major;
|
||||
protected $_minor;
|
||||
protected $_build;
|
||||
protected $_bits;
|
||||
public function major() { return $this->_major; }
|
||||
public function minor() { return $this->_minor; }
|
||||
public function build() { return $this->_build; }
|
||||
public function bits() { return $this->_bits; }
|
||||
public function version() { return $this->_major.".".$this->_minor.".".$this->_build." (".$this->_bits.")"; }
|
||||
|
||||
// dirs - detected by from the switch
|
||||
protected $_base_dir = '';
|
||||
protected $_cache_dir = '';
|
||||
protected $_conf_dir = '';
|
||||
protected $_db_dir = '';
|
||||
protected $_grammar_dir = '';
|
||||
protected $_htdocs_dir = '';
|
||||
protected $_log_dir = '';
|
||||
protected $_mod_dir = '';
|
||||
protected $_recordings_dir = '';
|
||||
protected $_run_dir = '';
|
||||
protected $_script_dir = '';
|
||||
protected $_sounds_dir = '';
|
||||
protected $_storage_dir = '';
|
||||
protected $_temp_dir = '';
|
||||
public function base_dir() { return $this->_base_dir; }
|
||||
public function cache_dir() { return $this->_cache_dir; }
|
||||
public function conf_dir() { return $this->_conf_dir; }
|
||||
public function db_dir() { return $this->_db_dir; }
|
||||
public function grammar_dir() { return $this->_grammar_dir; }
|
||||
public function htdocs_dir() { return $this->_htdocs_dir; }
|
||||
public function log_dir() { return $this->_log_dir; }
|
||||
public function mod_dir() { return $this->_mod_dir; }
|
||||
public function recordings_dir() { return $this->_recordings_dir; }
|
||||
public function run_dir() { return $this->_run_dir; }
|
||||
public function script_dir() { return $this->_script_dir; }
|
||||
public function sounds_dir() { return $this->_sounds_dir; }
|
||||
public function storage_dir() { return $this->_storage_dir; }
|
||||
public function temp_dir() { return $this->_temp_dir; }
|
||||
|
||||
// virtual dirs - assumed based on the detected dirs
|
||||
protected $_voicemail_vdir = '';
|
||||
protected $_phrases_vdir = '';
|
||||
protected $_extensions_vdir = '';
|
||||
protected $_sip_profiles_vdir = '';
|
||||
protected $_dialplan_vdir = '';
|
||||
protected $_backup_vdir = '';
|
||||
public function voicemail_vdir() { return $this->_voicemail_vdir; }
|
||||
public function phrases_vdir() { return $this->_phrases_vdir; }
|
||||
public function extensions_vdir() { return $this->_extensions_vdir; }
|
||||
public function sip_profiles_vdir() { return $this->_sip_profiles_vdir; }
|
||||
public function dialplan_vdir() { return $this->_dialplan_vdir; }
|
||||
public function backup_vdir() { return $this->_backup_vdir; }
|
||||
|
||||
// event socket
|
||||
public $event_host = 'localhost';
|
||||
public $event_port = '8021';
|
||||
public $event_password = 'ClueCon';
|
||||
protected $event_socket;
|
||||
|
||||
public function __construct($event_host, $event_port, $event_password) {
|
||||
//do not take these settings from session as they be detecting a new switch
|
||||
if($event_host){ $this->event_host = $event_host; }
|
||||
if($event_port){ $this->event_port = $event_port; }
|
||||
if($event_password){ $this->event_password = $event_password; }
|
||||
$this->connect_event_socket();
|
||||
if(!$this->event_socket){
|
||||
$this->detect_event_socket();
|
||||
}
|
||||
$this->_dirs = preg_grep ('/.*_dir$/', get_class_methods('detect_switch') );
|
||||
sort( $this->_dirs );
|
||||
$this->_vdirs = preg_grep ('/.*_vdir$/', get_class_methods('detect_switch') );
|
||||
sort( $this->_vdirs );
|
||||
}
|
||||
|
||||
protected function detect_event_socket() {
|
||||
//perform searches for user's config here
|
||||
}
|
||||
|
||||
public function detect() {
|
||||
$this->connect_event_socket();
|
||||
if(!$this->event_socket){
|
||||
throw new Exception('Failed to use event socket');
|
||||
}
|
||||
$FS_Version = $this->event_socket_request('api version');
|
||||
preg_match("/FreeSWITCH Version (\d+)\.(\d+)\.(\d+(?:\.\d+)?).*\(.*?(\d+\w+)\s*\)/", $FS_Version, $matches);
|
||||
$this->_major = $matches[1];
|
||||
$this->_minor = $matches[2];
|
||||
$this->_build = $matches[3];
|
||||
$this->_bits = $matches[4];
|
||||
$FS_Vars = $this->event_socket_request('api global_getvar');
|
||||
foreach (explode("\n",$FS_Vars) as $FS_Var){
|
||||
preg_match("/(\w+_dir)=(.*)/", $FS_Var, $matches);
|
||||
if(count($matches) > 0 and property_exists($this, "_" . $matches[1])){
|
||||
$field = "_" . $matches[1];
|
||||
$this->$field = normalize_path($matches[2]);
|
||||
}
|
||||
}
|
||||
$this->_voicemail_vdir = normalize_path($this->_storage_dir . DIRECTORY_SEPARATOR . "voicemail");
|
||||
$this->_phrases_vdir = normalize_path($this->_conf_dir . DIRECTORY_SEPARATOR . "lang");
|
||||
$this->_extensions_vdir = normalize_path($this->_conf_dir . DIRECTORY_SEPARATOR . "directory");
|
||||
$this->_sip_profiles_vdir = normalize_path($this->_conf_dir . DIRECTORY_SEPARATOR . "sip_profiles");
|
||||
$this->_dialplan_vdir = normalize_path($this->_conf_dir . DIRECTORY_SEPARATOR . "dialplan");
|
||||
$this->_backup_vdir = normalize_path(sys_get_temp_dir());
|
||||
}
|
||||
|
||||
protected function connect_event_socket(){
|
||||
$esl = new event_socket;
|
||||
if ($esl->connect($this->event_host, $this->event_port, $this->event_password)) {
|
||||
$this->event_socket = $esl->reset_fp();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function event_socket_request($cmd) {
|
||||
$esl = new event_socket($this->event_socket);
|
||||
$result = $esl->request($cmd);
|
||||
$esl->reset_fp();
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function restart_switch() {
|
||||
$this->connect_event_socket();
|
||||
if(!$this->event_socket){
|
||||
throw new Exception('Failed to use event socket');
|
||||
}
|
||||
$this->event_socket_request('api fsctl shutdown restart elegant');
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Copyright (C) 2010-2015
|
||||
All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Matthew Vale <github@mafoo.org>
|
||||
|
||||
*/
|
||||
require_once "root.php";
|
||||
require_once "resources/classes/event_socket.php";
|
||||
|
||||
//define the install class
|
||||
class detect_switch {
|
||||
|
||||
// cached data
|
||||
protected $_dirs;
|
||||
protected $_vdirs;
|
||||
public function get_dirs() { return $this->_dirs; }
|
||||
public function get_vdirs() { return $this->_vdirs; }
|
||||
|
||||
// version information
|
||||
protected $_major;
|
||||
protected $_minor;
|
||||
protected $_build;
|
||||
protected $_bits;
|
||||
public function major() { return $this->_major; }
|
||||
public function minor() { return $this->_minor; }
|
||||
public function build() { return $this->_build; }
|
||||
public function bits() { return $this->_bits; }
|
||||
public function version() { return $this->_major.".".$this->_minor.".".$this->_build." (".$this->_bits.")"; }
|
||||
|
||||
// dirs - detected by from the switch
|
||||
protected $_base_dir = '';
|
||||
protected $_cache_dir = '';
|
||||
protected $_conf_dir = '';
|
||||
protected $_db_dir = '';
|
||||
protected $_grammar_dir = '';
|
||||
protected $_htdocs_dir = '';
|
||||
protected $_log_dir = '';
|
||||
protected $_mod_dir = '';
|
||||
protected $_recordings_dir = '';
|
||||
protected $_run_dir = '';
|
||||
protected $_script_dir = '';
|
||||
protected $_sounds_dir = '';
|
||||
protected $_storage_dir = '';
|
||||
protected $_temp_dir = '';
|
||||
public function base_dir() { return $this->_base_dir; }
|
||||
public function cache_dir() { return $this->_cache_dir; }
|
||||
public function conf_dir() { return $this->_conf_dir; }
|
||||
public function db_dir() { return $this->_db_dir; }
|
||||
public function grammar_dir() { return $this->_grammar_dir; }
|
||||
public function htdocs_dir() { return $this->_htdocs_dir; }
|
||||
public function log_dir() { return $this->_log_dir; }
|
||||
public function mod_dir() { return $this->_mod_dir; }
|
||||
public function recordings_dir() { return $this->_recordings_dir; }
|
||||
public function run_dir() { return $this->_run_dir; }
|
||||
public function script_dir() { return $this->_script_dir; }
|
||||
public function sounds_dir() { return $this->_sounds_dir; }
|
||||
public function storage_dir() { return $this->_storage_dir; }
|
||||
public function temp_dir() { return $this->_temp_dir; }
|
||||
|
||||
// virtual dirs - assumed based on the detected dirs
|
||||
protected $_voicemail_vdir = '';
|
||||
protected $_phrases_vdir = '';
|
||||
protected $_extensions_vdir = '';
|
||||
protected $_sip_profiles_vdir = '';
|
||||
protected $_dialplan_vdir = '';
|
||||
protected $_backup_vdir = '';
|
||||
public function voicemail_vdir() { return $this->_voicemail_vdir; }
|
||||
public function phrases_vdir() { return $this->_phrases_vdir; }
|
||||
public function extensions_vdir() { return $this->_extensions_vdir; }
|
||||
public function sip_profiles_vdir() { return $this->_sip_profiles_vdir; }
|
||||
public function dialplan_vdir() { return $this->_dialplan_vdir; }
|
||||
public function backup_vdir() { return $this->_backup_vdir; }
|
||||
|
||||
// event socket
|
||||
public $event_host = 'localhost';
|
||||
public $event_port = '8021';
|
||||
public $event_password = 'ClueCon';
|
||||
protected $event_socket;
|
||||
|
||||
public function __construct($event_host, $event_port, $event_password) {
|
||||
//do not take these settings from session as they be detecting a new switch
|
||||
if($event_host){ $this->event_host = $event_host; }
|
||||
if($event_port){ $this->event_port = $event_port; }
|
||||
if($event_password){ $this->event_password = $event_password; }
|
||||
$this->connect_event_socket();
|
||||
if(!$this->event_socket){
|
||||
$this->detect_event_socket();
|
||||
}
|
||||
$this->_dirs = preg_grep ('/.*_dir$/', get_class_methods('detect_switch') );
|
||||
sort( $this->_dirs );
|
||||
$this->_vdirs = preg_grep ('/.*_vdir$/', get_class_methods('detect_switch') );
|
||||
sort( $this->_vdirs );
|
||||
}
|
||||
|
||||
protected function detect_event_socket() {
|
||||
//perform searches for user's config here
|
||||
}
|
||||
|
||||
public function detect() {
|
||||
$this->connect_event_socket();
|
||||
if(!$this->event_socket){
|
||||
throw new Exception('Failed to use event socket');
|
||||
}
|
||||
$FS_Version = $this->event_socket_request('api version');
|
||||
preg_match("/FreeSWITCH Version (\d+)\.(\d+)\.(\d+(?:\.\d+)?).*\(.*?(\d+\w+)\s*\)/", $FS_Version, $matches);
|
||||
$this->_major = $matches[1];
|
||||
$this->_minor = $matches[2];
|
||||
$this->_build = $matches[3];
|
||||
$this->_bits = $matches[4];
|
||||
$FS_Vars = $this->event_socket_request('api global_getvar');
|
||||
foreach (explode("\n",$FS_Vars) as $FS_Var){
|
||||
preg_match("/(\w+_dir)=(.*)/", $FS_Var, $matches);
|
||||
if(count($matches) > 0 and property_exists($this, "_" . $matches[1])){
|
||||
$field = "_" . $matches[1];
|
||||
$this->$field = normalize_path($matches[2]);
|
||||
}
|
||||
}
|
||||
$this->_voicemail_vdir = normalize_path($this->_storage_dir . DIRECTORY_SEPARATOR . "voicemail");
|
||||
$this->_phrases_vdir = normalize_path($this->_conf_dir . DIRECTORY_SEPARATOR . "lang");
|
||||
$this->_extensions_vdir = normalize_path($this->_conf_dir . DIRECTORY_SEPARATOR . "directory");
|
||||
$this->_sip_profiles_vdir = normalize_path($this->_conf_dir . DIRECTORY_SEPARATOR . "sip_profiles");
|
||||
$this->_dialplan_vdir = normalize_path($this->_conf_dir . DIRECTORY_SEPARATOR . "dialplan");
|
||||
$this->_backup_vdir = normalize_path(sys_get_temp_dir());
|
||||
}
|
||||
|
||||
protected function connect_event_socket(){
|
||||
$esl = new event_socket;
|
||||
if ($esl->connect($this->event_host, $this->event_port, $this->event_password)) {
|
||||
$this->event_socket = $esl->reset_fp();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function event_socket_request($cmd) {
|
||||
$esl = new event_socket($this->event_socket);
|
||||
$result = $esl->request($cmd);
|
||||
$esl->reset_fp();
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function restart_switch() {
|
||||
$this->connect_event_socket();
|
||||
if(!$this->event_socket){
|
||||
throw new Exception('Failed to use event socket');
|
||||
}
|
||||
$this->event_socket_request('api fsctl shutdown restart elegant');
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,214 +1,214 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Copyright (C) 2010-2015
|
||||
All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Matthew Vale <github@mafoo.org>
|
||||
|
||||
*/
|
||||
require_once "root.php";
|
||||
|
||||
//define the install class
|
||||
class global_settings {
|
||||
|
||||
// cached data
|
||||
protected $_switch_dirs;
|
||||
protected $_switch_vdirs;
|
||||
public function get_switch_dirs() { return $this->_switch_dirs; }
|
||||
public function get_switch_vdirs() { return $this->_switch_vdirs; }
|
||||
|
||||
// dirs - detected from the switch
|
||||
protected $_switch_base_dir = '';
|
||||
protected $_switch_cache_dir = '';
|
||||
protected $_switch_conf_dir = '';
|
||||
protected $_switch_db_dir = '';
|
||||
protected $_switch_grammar_dir = '';
|
||||
protected $_switch_htdocs_dir = '';
|
||||
protected $_switch_log_dir = '';
|
||||
protected $_switch_mod_dir = '';
|
||||
protected $_switch_recordings_dir = '';
|
||||
protected $_switch_run_dir = '';
|
||||
protected $_switch_script_dir = '';
|
||||
protected $_switch_sounds_dir = '';
|
||||
protected $_switch_storage_dir = '';
|
||||
protected $_switch_temp_dir = '';
|
||||
public function switch_base_dir() { return $this->_switch_base_dir; }
|
||||
public function switch_cache_dir() { return $this->_switch_cache_dir; }
|
||||
public function switch_conf_dir() { return $this->_switch_conf_dir; }
|
||||
public function switch_db_dir() { return $this->_switch_db_dir; }
|
||||
public function switch_grammar_dir() { return $this->_switch_grammar_dir; }
|
||||
public function switch_htdocs_dir() { return $this->_switch_htdocs_dir; }
|
||||
public function switch_log_dir() { return $this->_switch_log_dir; }
|
||||
public function switch_mod_dir() { return $this->_switch_mod_dir; }
|
||||
public function switch_recordings_dir() { return $this->_switch_recordings_dir; }
|
||||
public function switch_run_dir() { return $this->_switch_run_dir; }
|
||||
public function switch_script_dir() { return $this->_switch_script_dir; }
|
||||
public function switch_sounds_dir() { return $this->_switch_sounds_dir; }
|
||||
public function switch_storage_dir() { return $this->_switch_storage_dir; }
|
||||
public function switch_temp_dir() { return $this->_switch_temp_dir; }
|
||||
|
||||
// virtual dirs - assumed based on the detected dirs
|
||||
protected $_switch_voicemail_vdir = '';
|
||||
protected $_switch_phrases_vdir = '';
|
||||
protected $_switch_extensions_vdir = '';
|
||||
protected $_switch_sip_profiles_vdir = '';
|
||||
protected $_switch_dialplan_vdir = '';
|
||||
protected $_switch_backup_vdir = '';
|
||||
public function switch_voicemail_vdir() { return $this->_switch_voicemail_vdir; }
|
||||
public function switch_phrases_vdir() { return $this->_switch_phrases_vdir; }
|
||||
public function switch_extensions_vdir() { return $this->_switch_extensions_vdir; }
|
||||
public function switch_sip_profiles_vdir() { return $this->_switch_sip_profiles_vdir; }
|
||||
public function switch_dialplan_vdir() { return $this->_switch_dialplan_vdir; }
|
||||
public function switch_backup_vdir() { return $this->_switch_backup_vdir; }
|
||||
|
||||
// event socket
|
||||
protected $_switch_event_host;
|
||||
protected $_switch_event_port;
|
||||
protected $_switch_event_password;
|
||||
public function switch_event_host() { return $this->_switch_event_host; }
|
||||
public function switch_event_port() { return $this->_switch_event_port; }
|
||||
public function switch_event_password() { return $this->_switch_event_password; }
|
||||
|
||||
// database information
|
||||
protected $_db_type;
|
||||
protected $_db_path;
|
||||
protected $_db_host;
|
||||
protected $_db_port;
|
||||
protected $_db_name;
|
||||
protected $_db_username;
|
||||
protected $_db_password;
|
||||
protected $_db_create;
|
||||
protected $_db_create_username;
|
||||
protected $_db_create_password;
|
||||
public function db_type() { return $this->_db_type; }
|
||||
public function db_path() { return $this->_db_path; }
|
||||
public function db_host() { return $this->_db_host; }
|
||||
public function db_port() { return $this->_db_port; }
|
||||
public function db_name() { return $this->_db_name; }
|
||||
public function db_username() { return $this->_db_username; }
|
||||
public function db_password() { return $this->_db_password; }
|
||||
public function db_create() { return $this->_db_create; }
|
||||
public function db_create_username() { return $this->_db_create_username; }
|
||||
public function db_create_password() { return $this->_db_create_password; }
|
||||
|
||||
//misc information
|
||||
protected $_domain_uuid;
|
||||
protected $_domain_name;
|
||||
protected $_domain_count;
|
||||
public function domain_uuid() { return $this->_domain_uuid; }
|
||||
public function domain_name() { return $this->_domain_name; }
|
||||
public function domain_count() { return $this->_domain_count; }
|
||||
public function set_domain_uuid($domain_uuid) {
|
||||
$e = new Exception();
|
||||
$trace = $e->getTrace();
|
||||
if($trace[1]['function'] != 'create_domain'){
|
||||
throw new Exception('Only create_domain is allowed to update the domain_uuid');
|
||||
}
|
||||
$this->_domain_uuid = $domain_uuid;
|
||||
}
|
||||
|
||||
public function __construct($detect_switch = null, $domain_name = null, $domain_uuid = null) {
|
||||
$this->_switch_dirs = preg_grep ('/^switch_.*_dir$/', get_class_methods('global_settings') );
|
||||
sort( $this->_switch_dirs );
|
||||
$this->_switch_vdirs = preg_grep ('/^switch_.*_vdir$/', get_class_methods('global_settings') );
|
||||
sort( $this->_switch_vdirs );
|
||||
if(is_null($detect_switch)){
|
||||
//take settings from session
|
||||
foreach ($this->_switch_dirs as $dir){
|
||||
$category = 'switch';
|
||||
$session_var;
|
||||
preg_match( '/^switch_(.*)_dir$/', $dir, $session_var);
|
||||
$dir = "_$dir";
|
||||
if($session_var[1] == 'script'){ $session_var[1] = 'scripts'; }
|
||||
if($session_var[1] == 'temp'){ $category = 'server'; }
|
||||
$this->$dir = $_SESSION[$category][$session_var[1]]['dir'];
|
||||
}
|
||||
foreach ($this->_switch_vdirs as $vdir){
|
||||
$category = 'switch';
|
||||
$session_var;
|
||||
preg_match( '/^switch_(.*)_vdir$/', $vdir, $session_var);
|
||||
$vdir = "_$vdir";
|
||||
if($session_var[1] == 'backup'){ $category = 'server'; }
|
||||
$this->$vdir = $_SESSION[$category][$session_var[1]]['dir'];
|
||||
}
|
||||
$this->_switch_event_host = $_SESSION['event_socket_ip_address'];
|
||||
$this->_switch_event_port = $_SESSION['event_socket_port'];
|
||||
$this->_switch_event_password = $_SESSION['event_socket_password'];
|
||||
|
||||
// domain info
|
||||
$this->_domain_name = $_SESSION['domain_name'];
|
||||
$this->_domain_uuid = $_SESSION['domain_uuid'];
|
||||
|
||||
// collect misc info
|
||||
$this->_domain_count = count($_SESSION["domains"]);
|
||||
|
||||
// collect db_info
|
||||
global $db_type, $db_path, $db_host, $db_port, $db_name, $db_username, $db_password;
|
||||
$this->_db_type = $db_type;
|
||||
$this->_db_path = $db_path;
|
||||
$this->_db_host = $db_host;
|
||||
$this->_db_port = $db_port;
|
||||
$this->_db_name = $db_name;
|
||||
$this->_db_username = $db_username;
|
||||
$this->_db_password = $db_password;
|
||||
|
||||
}elseif(!is_a($detect_switch, 'detect_switch')){
|
||||
throw new Exception('The parameter $detect_switch must be a detect_switch object (or a subclass of)');
|
||||
|
||||
}else{
|
||||
//copy from detect_switch
|
||||
foreach($detect_switch->get_dirs() as $dir){
|
||||
$t_dir = "_switch_$dir";
|
||||
$this->$t_dir = $detect_switch->$dir();
|
||||
}
|
||||
foreach($detect_switch->get_vdirs() as $vdir){
|
||||
$t_vdir = "_switch_$vdir";
|
||||
$this->$t_vdir = $detect_switch->$vdir();
|
||||
}
|
||||
$this->_switch_event_host = $detect_switch->event_host;
|
||||
$this->_switch_event_port = $detect_switch->event_port;
|
||||
$this->_switch_event_password = $detect_switch->event_password;
|
||||
|
||||
//copy from _POST
|
||||
foreach($_POST as $key=>$value){
|
||||
if(substr($key,0,3) == "db_"){
|
||||
$o_key = "_$key";
|
||||
$this->$o_key = $value;
|
||||
}
|
||||
}
|
||||
if($this->_db_create and strlen($this->_db_create_username) == 0)
|
||||
{
|
||||
$this->_db_create_username = $this->_db_username;
|
||||
$this->_db_create_password = $this->_db_password;
|
||||
}
|
||||
if (strlen($this->_db_port) == 0) { $this->_db_port = "5432"; }
|
||||
|
||||
// domain info
|
||||
if(strlen($domain_uuid) == 0){ $domain_uuid = uuid(); }
|
||||
$this->_domain_name = $domain_name;
|
||||
$this->_domain_uuid = $domain_uuid;
|
||||
|
||||
//collect misc info
|
||||
$this->_domain_count = 1; //assumed to be one
|
||||
}
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Copyright (C) 2010-2015
|
||||
All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Matthew Vale <github@mafoo.org>
|
||||
|
||||
*/
|
||||
require_once "root.php";
|
||||
|
||||
//define the install class
|
||||
class global_settings {
|
||||
|
||||
// cached data
|
||||
protected $_switch_dirs;
|
||||
protected $_switch_vdirs;
|
||||
public function get_switch_dirs() { return $this->_switch_dirs; }
|
||||
public function get_switch_vdirs() { return $this->_switch_vdirs; }
|
||||
|
||||
// dirs - detected from the switch
|
||||
protected $_switch_base_dir = '';
|
||||
protected $_switch_cache_dir = '';
|
||||
protected $_switch_conf_dir = '';
|
||||
protected $_switch_db_dir = '';
|
||||
protected $_switch_grammar_dir = '';
|
||||
protected $_switch_htdocs_dir = '';
|
||||
protected $_switch_log_dir = '';
|
||||
protected $_switch_mod_dir = '';
|
||||
protected $_switch_recordings_dir = '';
|
||||
protected $_switch_run_dir = '';
|
||||
protected $_switch_script_dir = '';
|
||||
protected $_switch_sounds_dir = '';
|
||||
protected $_switch_storage_dir = '';
|
||||
protected $_switch_temp_dir = '';
|
||||
public function switch_base_dir() { return $this->_switch_base_dir; }
|
||||
public function switch_cache_dir() { return $this->_switch_cache_dir; }
|
||||
public function switch_conf_dir() { return $this->_switch_conf_dir; }
|
||||
public function switch_db_dir() { return $this->_switch_db_dir; }
|
||||
public function switch_grammar_dir() { return $this->_switch_grammar_dir; }
|
||||
public function switch_htdocs_dir() { return $this->_switch_htdocs_dir; }
|
||||
public function switch_log_dir() { return $this->_switch_log_dir; }
|
||||
public function switch_mod_dir() { return $this->_switch_mod_dir; }
|
||||
public function switch_recordings_dir() { return $this->_switch_recordings_dir; }
|
||||
public function switch_run_dir() { return $this->_switch_run_dir; }
|
||||
public function switch_script_dir() { return $this->_switch_script_dir; }
|
||||
public function switch_sounds_dir() { return $this->_switch_sounds_dir; }
|
||||
public function switch_storage_dir() { return $this->_switch_storage_dir; }
|
||||
public function switch_temp_dir() { return $this->_switch_temp_dir; }
|
||||
|
||||
// virtual dirs - assumed based on the detected dirs
|
||||
protected $_switch_voicemail_vdir = '';
|
||||
protected $_switch_phrases_vdir = '';
|
||||
protected $_switch_extensions_vdir = '';
|
||||
protected $_switch_sip_profiles_vdir = '';
|
||||
protected $_switch_dialplan_vdir = '';
|
||||
protected $_switch_backup_vdir = '';
|
||||
public function switch_voicemail_vdir() { return $this->_switch_voicemail_vdir; }
|
||||
public function switch_phrases_vdir() { return $this->_switch_phrases_vdir; }
|
||||
public function switch_extensions_vdir() { return $this->_switch_extensions_vdir; }
|
||||
public function switch_sip_profiles_vdir() { return $this->_switch_sip_profiles_vdir; }
|
||||
public function switch_dialplan_vdir() { return $this->_switch_dialplan_vdir; }
|
||||
public function switch_backup_vdir() { return $this->_switch_backup_vdir; }
|
||||
|
||||
// event socket
|
||||
protected $_switch_event_host;
|
||||
protected $_switch_event_port;
|
||||
protected $_switch_event_password;
|
||||
public function switch_event_host() { return $this->_switch_event_host; }
|
||||
public function switch_event_port() { return $this->_switch_event_port; }
|
||||
public function switch_event_password() { return $this->_switch_event_password; }
|
||||
|
||||
// database information
|
||||
protected $_db_type;
|
||||
protected $_db_path;
|
||||
protected $_db_host;
|
||||
protected $_db_port;
|
||||
protected $_db_name;
|
||||
protected $_db_username;
|
||||
protected $_db_password;
|
||||
protected $_db_create;
|
||||
protected $_db_create_username;
|
||||
protected $_db_create_password;
|
||||
public function db_type() { return $this->_db_type; }
|
||||
public function db_path() { return $this->_db_path; }
|
||||
public function db_host() { return $this->_db_host; }
|
||||
public function db_port() { return $this->_db_port; }
|
||||
public function db_name() { return $this->_db_name; }
|
||||
public function db_username() { return $this->_db_username; }
|
||||
public function db_password() { return $this->_db_password; }
|
||||
public function db_create() { return $this->_db_create; }
|
||||
public function db_create_username() { return $this->_db_create_username; }
|
||||
public function db_create_password() { return $this->_db_create_password; }
|
||||
|
||||
//misc information
|
||||
protected $_domain_uuid;
|
||||
protected $_domain_name;
|
||||
protected $_domain_count;
|
||||
public function domain_uuid() { return $this->_domain_uuid; }
|
||||
public function domain_name() { return $this->_domain_name; }
|
||||
public function domain_count() { return $this->_domain_count; }
|
||||
public function set_domain_uuid($domain_uuid) {
|
||||
$e = new Exception();
|
||||
$trace = $e->getTrace();
|
||||
if($trace[1]['function'] != 'create_domain'){
|
||||
throw new Exception('Only create_domain is allowed to update the domain_uuid');
|
||||
}
|
||||
$this->_domain_uuid = $domain_uuid;
|
||||
}
|
||||
|
||||
public function __construct($detect_switch = null, $domain_name = null, $domain_uuid = null) {
|
||||
$this->_switch_dirs = preg_grep ('/^switch_.*_dir$/', get_class_methods('global_settings') );
|
||||
sort( $this->_switch_dirs );
|
||||
$this->_switch_vdirs = preg_grep ('/^switch_.*_vdir$/', get_class_methods('global_settings') );
|
||||
sort( $this->_switch_vdirs );
|
||||
if(is_null($detect_switch)){
|
||||
//take settings from session
|
||||
foreach ($this->_switch_dirs as $dir){
|
||||
$category = 'switch';
|
||||
$session_var;
|
||||
preg_match( '/^switch_(.*)_dir$/', $dir, $session_var);
|
||||
$dir = "_$dir";
|
||||
if($session_var[1] == 'script'){ $session_var[1] = 'scripts'; }
|
||||
if($session_var[1] == 'temp'){ $category = 'server'; }
|
||||
$this->$dir = $_SESSION[$category][$session_var[1]]['dir'];
|
||||
}
|
||||
foreach ($this->_switch_vdirs as $vdir){
|
||||
$category = 'switch';
|
||||
$session_var;
|
||||
preg_match( '/^switch_(.*)_vdir$/', $vdir, $session_var);
|
||||
$vdir = "_$vdir";
|
||||
if($session_var[1] == 'backup'){ $category = 'server'; }
|
||||
$this->$vdir = $_SESSION[$category][$session_var[1]]['dir'];
|
||||
}
|
||||
$this->_switch_event_host = $_SESSION['event_socket_ip_address'];
|
||||
$this->_switch_event_port = $_SESSION['event_socket_port'];
|
||||
$this->_switch_event_password = $_SESSION['event_socket_password'];
|
||||
|
||||
// domain info
|
||||
$this->_domain_name = $_SESSION['domain_name'];
|
||||
$this->_domain_uuid = $_SESSION['domain_uuid'];
|
||||
|
||||
// collect misc info
|
||||
$this->_domain_count = count($_SESSION["domains"]);
|
||||
|
||||
// collect db_info
|
||||
global $db_type, $db_path, $db_host, $db_port, $db_name, $db_username, $db_password;
|
||||
$this->_db_type = $db_type;
|
||||
$this->_db_path = $db_path;
|
||||
$this->_db_host = $db_host;
|
||||
$this->_db_port = $db_port;
|
||||
$this->_db_name = $db_name;
|
||||
$this->_db_username = $db_username;
|
||||
$this->_db_password = $db_password;
|
||||
|
||||
}elseif(!is_a($detect_switch, 'detect_switch')){
|
||||
throw new Exception('The parameter $detect_switch must be a detect_switch object (or a subclass of)');
|
||||
|
||||
}else{
|
||||
//copy from detect_switch
|
||||
foreach($detect_switch->get_dirs() as $dir){
|
||||
$t_dir = "_switch_$dir";
|
||||
$this->$t_dir = $detect_switch->$dir();
|
||||
}
|
||||
foreach($detect_switch->get_vdirs() as $vdir){
|
||||
$t_vdir = "_switch_$vdir";
|
||||
$this->$t_vdir = $detect_switch->$vdir();
|
||||
}
|
||||
$this->_switch_event_host = $detect_switch->event_host;
|
||||
$this->_switch_event_port = $detect_switch->event_port;
|
||||
$this->_switch_event_password = $detect_switch->event_password;
|
||||
|
||||
//copy from _POST
|
||||
foreach($_POST as $key=>$value){
|
||||
if(substr($key,0,3) == "db_"){
|
||||
$o_key = "_$key";
|
||||
$this->$o_key = $value;
|
||||
}
|
||||
}
|
||||
if($this->_db_create and strlen($this->_db_create_username) == 0)
|
||||
{
|
||||
$this->_db_create_username = $this->_db_username;
|
||||
$this->_db_create_password = $this->_db_password;
|
||||
}
|
||||
if (strlen($this->_db_port) == 0) { $this->_db_port = "5432"; }
|
||||
|
||||
// domain info
|
||||
if(strlen($domain_uuid) == 0){ $domain_uuid = uuid(); }
|
||||
$this->_domain_name = $domain_name;
|
||||
$this->_domain_uuid = $domain_uuid;
|
||||
|
||||
//collect misc info
|
||||
$this->_domain_count = 1; //assumed to be one
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,146 +1,146 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Copyright (C) 2010-2015
|
||||
All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
include "root.php";
|
||||
|
||||
//define the install class
|
||||
class install_switch {
|
||||
|
||||
protected $global_settings;
|
||||
protected $dbh;
|
||||
|
||||
public $debug = false;
|
||||
public $echo_progress = false;
|
||||
|
||||
function __construct($global_settings) {
|
||||
if(is_null($global_settings)){
|
||||
require_once "core/install/resources/classes/global_settings.php";
|
||||
$global_settings = new global_settings();
|
||||
}elseif(!is_a($global_settings, 'global_settings')){
|
||||
throw new Exception('The parameter $global_settings must be a global_settings object (or a subclass of)');
|
||||
}
|
||||
$this->global_settings = $global_settings;
|
||||
}
|
||||
|
||||
//utility Functions
|
||||
function write_debug($message) {
|
||||
if($this->debug){
|
||||
echo "$message\n";
|
||||
}
|
||||
}
|
||||
|
||||
function write_progress($message) {
|
||||
if($this->echo_progress){
|
||||
echo "$message\n";
|
||||
}
|
||||
}
|
||||
|
||||
protected function backup_dir($dir, $backup_name){
|
||||
if (!is_readable($dir)) {
|
||||
throw new Exception("backup_dir() source directory '".$dir."' does not exist.");
|
||||
}
|
||||
$dst_tar = join( DIRECTORY_SEPARATOR, array(sys_get_temp_dir(), "$backup_name.tar"));
|
||||
//pharData is the correct way to do it, but it keeps creating incomplete archives
|
||||
//$tar = new PharData($dst_tar);
|
||||
//$tar->buildFromDirectory($dir);
|
||||
$this->write_debug("backing up to $dst_tar");
|
||||
if (file_exists('/bin/tar')) {
|
||||
exec('tar -cvf ' .$dst_tar. ' -C '.$dir .' .');
|
||||
}else{
|
||||
$this->write_debug('WARN: old config could not be compressed');
|
||||
$dst_dir = join( DIRECTORY_SEPARATOR, array(sys_get_temp_dir(), "$backup_name"));
|
||||
recursive_copy($dir, $dst_dir);
|
||||
}
|
||||
}
|
||||
|
||||
function install_phase_1() {
|
||||
$this->write_progress("Install phase 1 started for switch");
|
||||
$this->copy_conf();
|
||||
$this->write_progress("Install phase 1 completed for switch");
|
||||
}
|
||||
|
||||
function install_phase_2() {
|
||||
$this->write_progress("Install phase 2 started for switch");
|
||||
$this->restart_switch();
|
||||
$this->write_progress("Install phase 2 completed for switch");
|
||||
}
|
||||
|
||||
protected function copy_conf() {
|
||||
//send a message
|
||||
$this->write_progress("\tCopying Config");
|
||||
|
||||
//make a backup of the config
|
||||
if (file_exists($this->global_settings->switch_conf_dir())) {
|
||||
$this->backup_dir($this->global_settings->switch_conf_dir(), 'fusionpbx_switch_config');
|
||||
recursive_delete($this->global_settings->switch_conf_dir());
|
||||
}
|
||||
|
||||
//make sure the conf directory exists
|
||||
if (!is_dir($this->global_settings->switch_conf_dir())) {
|
||||
if (!mkdir($this->global_settings->switch_conf_dir(), 0774, true)) {
|
||||
throw new Exception("Failed to create the switch conf directory '".$this->global_settings->switch_conf_dir()."'. ");
|
||||
}
|
||||
}
|
||||
|
||||
//copy resources/templates/conf to the freeswitch conf dir
|
||||
if (file_exists('/usr/share/examples/fusionpbx/resources/templates/conf')){
|
||||
$src_dir = "/usr/share/examples/fusionpbx/resources/templates/conf";
|
||||
}
|
||||
else {
|
||||
$src_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/conf";
|
||||
}
|
||||
$dst_dir = $this->global_settings->switch_conf_dir();
|
||||
if (is_readable($dst_dir)) {
|
||||
recursive_copy($src_dir, $dst_dir);
|
||||
unset($src_dir, $dst_dir);
|
||||
}
|
||||
$fax_dir = join( DIRECTORY_SEPARATOR, array($this->global_settings->switch_storage_dir(), 'fax'));
|
||||
if (!is_readable($fax_dir)) { mkdir($fax_dir,0777,true); }
|
||||
$voicemail_dir = join( DIRECTORY_SEPARATOR, array($this->global_settings->switch_storage_dir(), 'voicemail'));
|
||||
if (!is_readable($voicemail_dir)) { mkdir($voicemail_dir,0777,true); }
|
||||
|
||||
//write the xml_cdr.conf.xml file
|
||||
if (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/xml_cdr")) {
|
||||
xml_cdr_conf_xml();
|
||||
}
|
||||
|
||||
//write the switch.conf.xml file
|
||||
if (file_exists($this->global_settings->switch_conf_dir())) {
|
||||
switch_conf_xml();
|
||||
}
|
||||
}
|
||||
|
||||
protected function restart_switch() {
|
||||
$esl = new event_socket;
|
||||
if(!$esl->connect($this->global_settings->switch_event_host(), $this->global_settings->switch_event_port(), $this->global_settings->switch_event_password())) {
|
||||
throw new Exception("Failed to connect to switch");
|
||||
}
|
||||
if (!$esl->request('api fsctl shutdown restart elegant')){
|
||||
throw new Exception("Failed to send switch restart");
|
||||
}
|
||||
$esl->reset_fp();
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Copyright (C) 2010-2015
|
||||
All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
include "root.php";
|
||||
|
||||
//define the install class
|
||||
class install_switch {
|
||||
|
||||
protected $global_settings;
|
||||
protected $dbh;
|
||||
|
||||
public $debug = false;
|
||||
public $echo_progress = false;
|
||||
|
||||
function __construct($global_settings) {
|
||||
if(is_null($global_settings)){
|
||||
require_once "core/install/resources/classes/global_settings.php";
|
||||
$global_settings = new global_settings();
|
||||
}elseif(!is_a($global_settings, 'global_settings')){
|
||||
throw new Exception('The parameter $global_settings must be a global_settings object (or a subclass of)');
|
||||
}
|
||||
$this->global_settings = $global_settings;
|
||||
}
|
||||
|
||||
//utility Functions
|
||||
function write_debug($message) {
|
||||
if($this->debug){
|
||||
echo "$message\n";
|
||||
}
|
||||
}
|
||||
|
||||
function write_progress($message) {
|
||||
if($this->echo_progress){
|
||||
echo "$message\n";
|
||||
}
|
||||
}
|
||||
|
||||
protected function backup_dir($dir, $backup_name){
|
||||
if (!is_readable($dir)) {
|
||||
throw new Exception("backup_dir() source directory '".$dir."' does not exist.");
|
||||
}
|
||||
$dst_tar = join( DIRECTORY_SEPARATOR, array(sys_get_temp_dir(), "$backup_name.tar"));
|
||||
//pharData is the correct way to do it, but it keeps creating incomplete archives
|
||||
//$tar = new PharData($dst_tar);
|
||||
//$tar->buildFromDirectory($dir);
|
||||
$this->write_debug("backing up to $dst_tar");
|
||||
if (file_exists('/bin/tar')) {
|
||||
exec('tar -cvf ' .$dst_tar. ' -C '.$dir .' .');
|
||||
}else{
|
||||
$this->write_debug('WARN: old config could not be compressed');
|
||||
$dst_dir = join( DIRECTORY_SEPARATOR, array(sys_get_temp_dir(), "$backup_name"));
|
||||
recursive_copy($dir, $dst_dir);
|
||||
}
|
||||
}
|
||||
|
||||
function install_phase_1() {
|
||||
$this->write_progress("Install phase 1 started for switch");
|
||||
$this->copy_conf();
|
||||
$this->write_progress("Install phase 1 completed for switch");
|
||||
}
|
||||
|
||||
function install_phase_2() {
|
||||
$this->write_progress("Install phase 2 started for switch");
|
||||
$this->restart_switch();
|
||||
$this->write_progress("Install phase 2 completed for switch");
|
||||
}
|
||||
|
||||
protected function copy_conf() {
|
||||
//send a message
|
||||
$this->write_progress("\tCopying Config");
|
||||
|
||||
//make a backup of the config
|
||||
if (file_exists($this->global_settings->switch_conf_dir())) {
|
||||
$this->backup_dir($this->global_settings->switch_conf_dir(), 'fusionpbx_switch_config');
|
||||
recursive_delete($this->global_settings->switch_conf_dir());
|
||||
}
|
||||
|
||||
//make sure the conf directory exists
|
||||
if (!is_dir($this->global_settings->switch_conf_dir())) {
|
||||
if (!mkdir($this->global_settings->switch_conf_dir(), 0774, true)) {
|
||||
throw new Exception("Failed to create the switch conf directory '".$this->global_settings->switch_conf_dir()."'. ");
|
||||
}
|
||||
}
|
||||
|
||||
//copy resources/templates/conf to the freeswitch conf dir
|
||||
if (file_exists('/usr/share/examples/fusionpbx/resources/templates/conf')){
|
||||
$src_dir = "/usr/share/examples/fusionpbx/resources/templates/conf";
|
||||
}
|
||||
else {
|
||||
$src_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/conf";
|
||||
}
|
||||
$dst_dir = $this->global_settings->switch_conf_dir();
|
||||
if (is_readable($dst_dir)) {
|
||||
recursive_copy($src_dir, $dst_dir);
|
||||
unset($src_dir, $dst_dir);
|
||||
}
|
||||
$fax_dir = join( DIRECTORY_SEPARATOR, array($this->global_settings->switch_storage_dir(), 'fax'));
|
||||
if (!is_readable($fax_dir)) { mkdir($fax_dir,0777,true); }
|
||||
$voicemail_dir = join( DIRECTORY_SEPARATOR, array($this->global_settings->switch_storage_dir(), 'voicemail'));
|
||||
if (!is_readable($voicemail_dir)) { mkdir($voicemail_dir,0777,true); }
|
||||
|
||||
//write the xml_cdr.conf.xml file
|
||||
if (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/xml_cdr")) {
|
||||
xml_cdr_conf_xml();
|
||||
}
|
||||
|
||||
//write the switch.conf.xml file
|
||||
if (file_exists($this->global_settings->switch_conf_dir())) {
|
||||
switch_conf_xml();
|
||||
}
|
||||
}
|
||||
|
||||
protected function restart_switch() {
|
||||
$esl = new event_socket;
|
||||
if(!$esl->connect($this->global_settings->switch_event_host(), $this->global_settings->switch_event_port(), $this->global_settings->switch_event_password())) {
|
||||
throw new Exception("Failed to connect to switch");
|
||||
}
|
||||
if (!$esl->request('api fsctl shutdown restart elegant')){
|
||||
throw new Exception("Failed to send switch restart");
|
||||
}
|
||||
$esl->reset_fp();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,252 +1,252 @@
|
||||
<?php
|
||||
|
||||
$iso_countries = array
|
||||
(
|
||||
'AF' => 'Afghanistan',
|
||||
'AX' => 'Aland Islands',
|
||||
'AL' => 'Albania',
|
||||
'DZ' => 'Algeria',
|
||||
'AS' => 'American Samoa',
|
||||
'AD' => 'Andorra',
|
||||
'AO' => 'Angola',
|
||||
'AI' => 'Anguilla',
|
||||
'AQ' => 'Antarctica',
|
||||
'AG' => 'Antigua And Barbuda',
|
||||
'AR' => 'Argentina',
|
||||
'AM' => 'Armenia',
|
||||
'AW' => 'Aruba',
|
||||
'AU' => 'Australia',
|
||||
'AT' => 'Austria',
|
||||
'AZ' => 'Azerbaijan',
|
||||
'BS' => 'Bahamas',
|
||||
'BH' => 'Bahrain',
|
||||
'BD' => 'Bangladesh',
|
||||
'BB' => 'Barbados',
|
||||
'BY' => 'Belarus',
|
||||
'BE' => 'Belgium',
|
||||
'BZ' => 'Belize',
|
||||
'BJ' => 'Benin',
|
||||
'BM' => 'Bermuda',
|
||||
'BT' => 'Bhutan',
|
||||
'BO' => 'Bolivia',
|
||||
'BA' => 'Bosnia And Herzegovina',
|
||||
'BW' => 'Botswana',
|
||||
'BV' => 'Bouvet Island',
|
||||
'BR' => 'Brazil',
|
||||
'IO' => 'British Indian Ocean Territory',
|
||||
'BN' => 'Brunei Darussalam',
|
||||
'BG' => 'Bulgaria',
|
||||
'BF' => 'Burkina Faso',
|
||||
'BI' => 'Burundi',
|
||||
'KH' => 'Cambodia',
|
||||
'CM' => 'Cameroon',
|
||||
'CA' => 'Canada',
|
||||
'CV' => 'Cape Verde',
|
||||
'KY' => 'Cayman Islands',
|
||||
'CF' => 'Central African Republic',
|
||||
'TD' => 'Chad',
|
||||
'CL' => 'Chile',
|
||||
'CN' => 'China',
|
||||
'CX' => 'Christmas Island',
|
||||
'CC' => 'Cocos (Keeling) Islands',
|
||||
'CO' => 'Colombia',
|
||||
'KM' => 'Comoros',
|
||||
'CG' => 'Congo',
|
||||
'CD' => 'Congo, Democratic Republic',
|
||||
'CK' => 'Cook Islands',
|
||||
'CR' => 'Costa Rica',
|
||||
'CI' => 'Cote D\'Ivoire',
|
||||
'HR' => 'Croatia',
|
||||
'CU' => 'Cuba',
|
||||
'CY' => 'Cyprus',
|
||||
'CZ' => 'Czech Republic',
|
||||
'DK' => 'Denmark',
|
||||
'DJ' => 'Djibouti',
|
||||
'DM' => 'Dominica',
|
||||
'DO' => 'Dominican Republic',
|
||||
'EC' => 'Ecuador',
|
||||
'EG' => 'Egypt',
|
||||
'SV' => 'El Salvador',
|
||||
'GQ' => 'Equatorial Guinea',
|
||||
'ER' => 'Eritrea',
|
||||
'EE' => 'Estonia',
|
||||
'ET' => 'Ethiopia',
|
||||
'FK' => 'Falkland Islands (Malvinas)',
|
||||
'FO' => 'Faroe Islands',
|
||||
'FJ' => 'Fiji',
|
||||
'FI' => 'Finland',
|
||||
'FR' => 'France',
|
||||
'GF' => 'French Guiana',
|
||||
'PF' => 'French Polynesia',
|
||||
'TF' => 'French Southern Territories',
|
||||
'GA' => 'Gabon',
|
||||
'GM' => 'Gambia',
|
||||
'GE' => 'Georgia',
|
||||
'DE' => 'Germany',
|
||||
'GH' => 'Ghana',
|
||||
'GI' => 'Gibraltar',
|
||||
'GR' => 'Greece',
|
||||
'GL' => 'Greenland',
|
||||
'GD' => 'Grenada',
|
||||
'GP' => 'Guadeloupe',
|
||||
'GU' => 'Guam',
|
||||
'GT' => 'Guatemala',
|
||||
'GG' => 'Guernsey',
|
||||
'GN' => 'Guinea',
|
||||
'GW' => 'Guinea-Bissau',
|
||||
'GY' => 'Guyana',
|
||||
'HT' => 'Haiti',
|
||||
'HM' => 'Heard Island & Mcdonald Islands',
|
||||
'VA' => 'Holy See (Vatican City State)',
|
||||
'HN' => 'Honduras',
|
||||
'HK' => 'Hong Kong',
|
||||
'HU' => 'Hungary',
|
||||
'IS' => 'Iceland',
|
||||
'IN' => 'India',
|
||||
'ID' => 'Indonesia',
|
||||
'IR' => 'Iran, Islamic Republic Of',
|
||||
'IQ' => 'Iraq',
|
||||
'IE' => 'Ireland',
|
||||
'IM' => 'Isle Of Man',
|
||||
'IL' => 'Israel',
|
||||
'IT' => 'Italy',
|
||||
'JM' => 'Jamaica',
|
||||
'JP' => 'Japan',
|
||||
'JE' => 'Jersey',
|
||||
'JO' => 'Jordan',
|
||||
'KZ' => 'Kazakhstan',
|
||||
'KE' => 'Kenya',
|
||||
'KI' => 'Kiribati',
|
||||
'KR' => 'Korea',
|
||||
'KW' => 'Kuwait',
|
||||
'KG' => 'Kyrgyzstan',
|
||||
'LA' => 'Lao People\'s Democratic Republic',
|
||||
'LV' => 'Latvia',
|
||||
'LB' => 'Lebanon',
|
||||
'LS' => 'Lesotho',
|
||||
'LR' => 'Liberia',
|
||||
'LY' => 'Libyan Arab Jamahiriya',
|
||||
'LI' => 'Liechtenstein',
|
||||
'LT' => 'Lithuania',
|
||||
'LU' => 'Luxembourg',
|
||||
'MO' => 'Macao',
|
||||
'MK' => 'Macedonia',
|
||||
'MG' => 'Madagascar',
|
||||
'MW' => 'Malawi',
|
||||
'MY' => 'Malaysia',
|
||||
'MV' => 'Maldives',
|
||||
'ML' => 'Mali',
|
||||
'MT' => 'Malta',
|
||||
'MH' => 'Marshall Islands',
|
||||
'MQ' => 'Martinique',
|
||||
'MR' => 'Mauritania',
|
||||
'MU' => 'Mauritius',
|
||||
'YT' => 'Mayotte',
|
||||
'MX' => 'Mexico',
|
||||
'FM' => 'Micronesia, Federated States Of',
|
||||
'MD' => 'Moldova',
|
||||
'MC' => 'Monaco',
|
||||
'MN' => 'Mongolia',
|
||||
'ME' => 'Montenegro',
|
||||
'MS' => 'Montserrat',
|
||||
'MA' => 'Morocco',
|
||||
'MZ' => 'Mozambique',
|
||||
'MM' => 'Myanmar',
|
||||
'NA' => 'Namibia',
|
||||
'NR' => 'Nauru',
|
||||
'NP' => 'Nepal',
|
||||
'NL' => 'Netherlands',
|
||||
'AN' => 'Netherlands Antilles',
|
||||
'NC' => 'New Caledonia',
|
||||
'NZ' => 'New Zealand',
|
||||
'NI' => 'Nicaragua',
|
||||
'NE' => 'Niger',
|
||||
'NG' => 'Nigeria',
|
||||
'NU' => 'Niue',
|
||||
'NF' => 'Norfolk Island',
|
||||
'MP' => 'Northern Mariana Islands',
|
||||
'NO' => 'Norway',
|
||||
'OM' => 'Oman',
|
||||
'PK' => 'Pakistan',
|
||||
'PW' => 'Palau',
|
||||
'PS' => 'Palestinian Territory, Occupied',
|
||||
'PA' => 'Panama',
|
||||
'PG' => 'Papua New Guinea',
|
||||
'PY' => 'Paraguay',
|
||||
'PE' => 'Peru',
|
||||
'PH' => 'Philippines',
|
||||
'PN' => 'Pitcairn',
|
||||
'PL' => 'Poland',
|
||||
'PT' => 'Portugal',
|
||||
'PR' => 'Puerto Rico',
|
||||
'QA' => 'Qatar',
|
||||
'RE' => 'Reunion',
|
||||
'RO' => 'Romania',
|
||||
'RU' => 'Russian Federation',
|
||||
'RW' => 'Rwanda',
|
||||
'BL' => 'Saint Barthelemy',
|
||||
'SH' => 'Saint Helena',
|
||||
'KN' => 'Saint Kitts And Nevis',
|
||||
'LC' => 'Saint Lucia',
|
||||
'MF' => 'Saint Martin',
|
||||
'PM' => 'Saint Pierre And Miquelon',
|
||||
'VC' => 'Saint Vincent And Grenadines',
|
||||
'WS' => 'Samoa',
|
||||
'SM' => 'San Marino',
|
||||
'ST' => 'Sao Tome And Principe',
|
||||
'SA' => 'Saudi Arabia',
|
||||
'SN' => 'Senegal',
|
||||
'RS' => 'Serbia',
|
||||
'SC' => 'Seychelles',
|
||||
'SL' => 'Sierra Leone',
|
||||
'SG' => 'Singapore',
|
||||
'SK' => 'Slovakia',
|
||||
'SI' => 'Slovenia',
|
||||
'SB' => 'Solomon Islands',
|
||||
'SO' => 'Somalia',
|
||||
'ZA' => 'South Africa',
|
||||
'GS' => 'South Georgia And Sandwich Isl.',
|
||||
'ES' => 'Spain',
|
||||
'LK' => 'Sri Lanka',
|
||||
'SD' => 'Sudan',
|
||||
'SR' => 'Suriname',
|
||||
'SJ' => 'Svalbard And Jan Mayen',
|
||||
'SZ' => 'Swaziland',
|
||||
'SE' => 'Sweden',
|
||||
'CH' => 'Switzerland',
|
||||
'SY' => 'Syrian Arab Republic',
|
||||
'TW' => 'Taiwan',
|
||||
'TJ' => 'Tajikistan',
|
||||
'TZ' => 'Tanzania',
|
||||
'TH' => 'Thailand',
|
||||
'TL' => 'Timor-Leste',
|
||||
'TG' => 'Togo',
|
||||
'TK' => 'Tokelau',
|
||||
'TO' => 'Tonga',
|
||||
'TT' => 'Trinidad And Tobago',
|
||||
'TN' => 'Tunisia',
|
||||
'TR' => 'Turkey',
|
||||
'TM' => 'Turkmenistan',
|
||||
'TC' => 'Turks And Caicos Islands',
|
||||
'TV' => 'Tuvalu',
|
||||
'UG' => 'Uganda',
|
||||
'UA' => 'Ukraine',
|
||||
'AE' => 'United Arab Emirates',
|
||||
'GB' => 'United Kingdom',
|
||||
'US' => 'United States',
|
||||
'UM' => 'United States Outlying Islands',
|
||||
'UY' => 'Uruguay',
|
||||
'UZ' => 'Uzbekistan',
|
||||
'VU' => 'Vanuatu',
|
||||
'VE' => 'Venezuela',
|
||||
'VN' => 'Viet Nam',
|
||||
'VG' => 'Virgin Islands, British',
|
||||
'VI' => 'Virgin Islands, U.S.',
|
||||
'WF' => 'Wallis And Futuna',
|
||||
'EH' => 'Western Sahara',
|
||||
'YE' => 'Yemen',
|
||||
'ZM' => 'Zambia',
|
||||
'ZW' => 'Zimbabwe',
|
||||
);
|
||||
|
||||
<?php
|
||||
|
||||
$iso_countries = array
|
||||
(
|
||||
'AF' => 'Afghanistan',
|
||||
'AX' => 'Aland Islands',
|
||||
'AL' => 'Albania',
|
||||
'DZ' => 'Algeria',
|
||||
'AS' => 'American Samoa',
|
||||
'AD' => 'Andorra',
|
||||
'AO' => 'Angola',
|
||||
'AI' => 'Anguilla',
|
||||
'AQ' => 'Antarctica',
|
||||
'AG' => 'Antigua And Barbuda',
|
||||
'AR' => 'Argentina',
|
||||
'AM' => 'Armenia',
|
||||
'AW' => 'Aruba',
|
||||
'AU' => 'Australia',
|
||||
'AT' => 'Austria',
|
||||
'AZ' => 'Azerbaijan',
|
||||
'BS' => 'Bahamas',
|
||||
'BH' => 'Bahrain',
|
||||
'BD' => 'Bangladesh',
|
||||
'BB' => 'Barbados',
|
||||
'BY' => 'Belarus',
|
||||
'BE' => 'Belgium',
|
||||
'BZ' => 'Belize',
|
||||
'BJ' => 'Benin',
|
||||
'BM' => 'Bermuda',
|
||||
'BT' => 'Bhutan',
|
||||
'BO' => 'Bolivia',
|
||||
'BA' => 'Bosnia And Herzegovina',
|
||||
'BW' => 'Botswana',
|
||||
'BV' => 'Bouvet Island',
|
||||
'BR' => 'Brazil',
|
||||
'IO' => 'British Indian Ocean Territory',
|
||||
'BN' => 'Brunei Darussalam',
|
||||
'BG' => 'Bulgaria',
|
||||
'BF' => 'Burkina Faso',
|
||||
'BI' => 'Burundi',
|
||||
'KH' => 'Cambodia',
|
||||
'CM' => 'Cameroon',
|
||||
'CA' => 'Canada',
|
||||
'CV' => 'Cape Verde',
|
||||
'KY' => 'Cayman Islands',
|
||||
'CF' => 'Central African Republic',
|
||||
'TD' => 'Chad',
|
||||
'CL' => 'Chile',
|
||||
'CN' => 'China',
|
||||
'CX' => 'Christmas Island',
|
||||
'CC' => 'Cocos (Keeling) Islands',
|
||||
'CO' => 'Colombia',
|
||||
'KM' => 'Comoros',
|
||||
'CG' => 'Congo',
|
||||
'CD' => 'Congo, Democratic Republic',
|
||||
'CK' => 'Cook Islands',
|
||||
'CR' => 'Costa Rica',
|
||||
'CI' => 'Cote D\'Ivoire',
|
||||
'HR' => 'Croatia',
|
||||
'CU' => 'Cuba',
|
||||
'CY' => 'Cyprus',
|
||||
'CZ' => 'Czech Republic',
|
||||
'DK' => 'Denmark',
|
||||
'DJ' => 'Djibouti',
|
||||
'DM' => 'Dominica',
|
||||
'DO' => 'Dominican Republic',
|
||||
'EC' => 'Ecuador',
|
||||
'EG' => 'Egypt',
|
||||
'SV' => 'El Salvador',
|
||||
'GQ' => 'Equatorial Guinea',
|
||||
'ER' => 'Eritrea',
|
||||
'EE' => 'Estonia',
|
||||
'ET' => 'Ethiopia',
|
||||
'FK' => 'Falkland Islands (Malvinas)',
|
||||
'FO' => 'Faroe Islands',
|
||||
'FJ' => 'Fiji',
|
||||
'FI' => 'Finland',
|
||||
'FR' => 'France',
|
||||
'GF' => 'French Guiana',
|
||||
'PF' => 'French Polynesia',
|
||||
'TF' => 'French Southern Territories',
|
||||
'GA' => 'Gabon',
|
||||
'GM' => 'Gambia',
|
||||
'GE' => 'Georgia',
|
||||
'DE' => 'Germany',
|
||||
'GH' => 'Ghana',
|
||||
'GI' => 'Gibraltar',
|
||||
'GR' => 'Greece',
|
||||
'GL' => 'Greenland',
|
||||
'GD' => 'Grenada',
|
||||
'GP' => 'Guadeloupe',
|
||||
'GU' => 'Guam',
|
||||
'GT' => 'Guatemala',
|
||||
'GG' => 'Guernsey',
|
||||
'GN' => 'Guinea',
|
||||
'GW' => 'Guinea-Bissau',
|
||||
'GY' => 'Guyana',
|
||||
'HT' => 'Haiti',
|
||||
'HM' => 'Heard Island & Mcdonald Islands',
|
||||
'VA' => 'Holy See (Vatican City State)',
|
||||
'HN' => 'Honduras',
|
||||
'HK' => 'Hong Kong',
|
||||
'HU' => 'Hungary',
|
||||
'IS' => 'Iceland',
|
||||
'IN' => 'India',
|
||||
'ID' => 'Indonesia',
|
||||
'IR' => 'Iran, Islamic Republic Of',
|
||||
'IQ' => 'Iraq',
|
||||
'IE' => 'Ireland',
|
||||
'IM' => 'Isle Of Man',
|
||||
'IL' => 'Israel',
|
||||
'IT' => 'Italy',
|
||||
'JM' => 'Jamaica',
|
||||
'JP' => 'Japan',
|
||||
'JE' => 'Jersey',
|
||||
'JO' => 'Jordan',
|
||||
'KZ' => 'Kazakhstan',
|
||||
'KE' => 'Kenya',
|
||||
'KI' => 'Kiribati',
|
||||
'KR' => 'Korea',
|
||||
'KW' => 'Kuwait',
|
||||
'KG' => 'Kyrgyzstan',
|
||||
'LA' => 'Lao People\'s Democratic Republic',
|
||||
'LV' => 'Latvia',
|
||||
'LB' => 'Lebanon',
|
||||
'LS' => 'Lesotho',
|
||||
'LR' => 'Liberia',
|
||||
'LY' => 'Libyan Arab Jamahiriya',
|
||||
'LI' => 'Liechtenstein',
|
||||
'LT' => 'Lithuania',
|
||||
'LU' => 'Luxembourg',
|
||||
'MO' => 'Macao',
|
||||
'MK' => 'Macedonia',
|
||||
'MG' => 'Madagascar',
|
||||
'MW' => 'Malawi',
|
||||
'MY' => 'Malaysia',
|
||||
'MV' => 'Maldives',
|
||||
'ML' => 'Mali',
|
||||
'MT' => 'Malta',
|
||||
'MH' => 'Marshall Islands',
|
||||
'MQ' => 'Martinique',
|
||||
'MR' => 'Mauritania',
|
||||
'MU' => 'Mauritius',
|
||||
'YT' => 'Mayotte',
|
||||
'MX' => 'Mexico',
|
||||
'FM' => 'Micronesia, Federated States Of',
|
||||
'MD' => 'Moldova',
|
||||
'MC' => 'Monaco',
|
||||
'MN' => 'Mongolia',
|
||||
'ME' => 'Montenegro',
|
||||
'MS' => 'Montserrat',
|
||||
'MA' => 'Morocco',
|
||||
'MZ' => 'Mozambique',
|
||||
'MM' => 'Myanmar',
|
||||
'NA' => 'Namibia',
|
||||
'NR' => 'Nauru',
|
||||
'NP' => 'Nepal',
|
||||
'NL' => 'Netherlands',
|
||||
'AN' => 'Netherlands Antilles',
|
||||
'NC' => 'New Caledonia',
|
||||
'NZ' => 'New Zealand',
|
||||
'NI' => 'Nicaragua',
|
||||
'NE' => 'Niger',
|
||||
'NG' => 'Nigeria',
|
||||
'NU' => 'Niue',
|
||||
'NF' => 'Norfolk Island',
|
||||
'MP' => 'Northern Mariana Islands',
|
||||
'NO' => 'Norway',
|
||||
'OM' => 'Oman',
|
||||
'PK' => 'Pakistan',
|
||||
'PW' => 'Palau',
|
||||
'PS' => 'Palestinian Territory, Occupied',
|
||||
'PA' => 'Panama',
|
||||
'PG' => 'Papua New Guinea',
|
||||
'PY' => 'Paraguay',
|
||||
'PE' => 'Peru',
|
||||
'PH' => 'Philippines',
|
||||
'PN' => 'Pitcairn',
|
||||
'PL' => 'Poland',
|
||||
'PT' => 'Portugal',
|
||||
'PR' => 'Puerto Rico',
|
||||
'QA' => 'Qatar',
|
||||
'RE' => 'Reunion',
|
||||
'RO' => 'Romania',
|
||||
'RU' => 'Russian Federation',
|
||||
'RW' => 'Rwanda',
|
||||
'BL' => 'Saint Barthelemy',
|
||||
'SH' => 'Saint Helena',
|
||||
'KN' => 'Saint Kitts And Nevis',
|
||||
'LC' => 'Saint Lucia',
|
||||
'MF' => 'Saint Martin',
|
||||
'PM' => 'Saint Pierre And Miquelon',
|
||||
'VC' => 'Saint Vincent And Grenadines',
|
||||
'WS' => 'Samoa',
|
||||
'SM' => 'San Marino',
|
||||
'ST' => 'Sao Tome And Principe',
|
||||
'SA' => 'Saudi Arabia',
|
||||
'SN' => 'Senegal',
|
||||
'RS' => 'Serbia',
|
||||
'SC' => 'Seychelles',
|
||||
'SL' => 'Sierra Leone',
|
||||
'SG' => 'Singapore',
|
||||
'SK' => 'Slovakia',
|
||||
'SI' => 'Slovenia',
|
||||
'SB' => 'Solomon Islands',
|
||||
'SO' => 'Somalia',
|
||||
'ZA' => 'South Africa',
|
||||
'GS' => 'South Georgia And Sandwich Isl.',
|
||||
'ES' => 'Spain',
|
||||
'LK' => 'Sri Lanka',
|
||||
'SD' => 'Sudan',
|
||||
'SR' => 'Suriname',
|
||||
'SJ' => 'Svalbard And Jan Mayen',
|
||||
'SZ' => 'Swaziland',
|
||||
'SE' => 'Sweden',
|
||||
'CH' => 'Switzerland',
|
||||
'SY' => 'Syrian Arab Republic',
|
||||
'TW' => 'Taiwan',
|
||||
'TJ' => 'Tajikistan',
|
||||
'TZ' => 'Tanzania',
|
||||
'TH' => 'Thailand',
|
||||
'TL' => 'Timor-Leste',
|
||||
'TG' => 'Togo',
|
||||
'TK' => 'Tokelau',
|
||||
'TO' => 'Tonga',
|
||||
'TT' => 'Trinidad And Tobago',
|
||||
'TN' => 'Tunisia',
|
||||
'TR' => 'Turkey',
|
||||
'TM' => 'Turkmenistan',
|
||||
'TC' => 'Turks And Caicos Islands',
|
||||
'TV' => 'Tuvalu',
|
||||
'UG' => 'Uganda',
|
||||
'UA' => 'Ukraine',
|
||||
'AE' => 'United Arab Emirates',
|
||||
'GB' => 'United Kingdom',
|
||||
'US' => 'United States',
|
||||
'UM' => 'United States Outlying Islands',
|
||||
'UY' => 'Uruguay',
|
||||
'UZ' => 'Uzbekistan',
|
||||
'VU' => 'Vanuatu',
|
||||
'VE' => 'Venezuela',
|
||||
'VN' => 'Viet Nam',
|
||||
'VG' => 'Virgin Islands, British',
|
||||
'VI' => 'Virgin Islands, U.S.',
|
||||
'WF' => 'Wallis And Futuna',
|
||||
'EH' => 'Western Sahara',
|
||||
'YE' => 'Yemen',
|
||||
'ZM' => 'Zambia',
|
||||
'ZW' => 'Zimbabwe',
|
||||
);
|
||||
|
||||
?>
|
||||
@@ -1,276 +1,276 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Matthew Vale <github@mafoo.org>
|
||||
*/
|
||||
|
||||
echo "<form method='post' name='frm' action=''>\n";
|
||||
echo "<input type='hidden' name='install_language' value='".$_SESSION['domain']['language']['code']."'/>\n";
|
||||
echo "<input type='hidden' name='return_install_step' value='config_database'/>\n";
|
||||
echo "<input type='hidden' name='install_step' value='execute'/>\n";
|
||||
|
||||
echo "<input type='hidden' name='event_host' value='$event_host'/>\n";
|
||||
echo "<input type='hidden' name='event_port' value='$event_port'/>\n";
|
||||
echo "<input type='hidden' name='event_password' value='$event_password'/>\n";
|
||||
echo "<input type='hidden' name='db_type' value='$db_type'/>\n";
|
||||
echo "<input type='hidden' name='admin_username' value='$admin_username'/>\n";
|
||||
echo "<input type='hidden' name='admin_password' value='$admin_password'/>\n";
|
||||
echo "<input type='hidden' name='install_default_country' value='$install_default_country'/>\n";
|
||||
echo "<input type='hidden' name='install_template_name' value='$install_template_name'/>\n";
|
||||
echo "<input type='hidden' name='domain_name' value='$domain_name'/>\n";
|
||||
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td align='left' width='30%' nowrap><b>".$text['header-config_database']."</b></td>\n";
|
||||
echo "<td width='70%' align='right'>\n";
|
||||
echo " <input type='button' name='back' class='btn' onclick=\"history.go(-1);\" value='".$text['button-back']."'/>\n";
|
||||
echo " <input type='submit' name='next' class='btn' value='".$text['button-next']."'/>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
if ($db_type == "sqlite") {
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' 'valign='top' align='left' nowrap>\n";
|
||||
echo " Database Filename\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_name' maxlength='255' value=\"$db_name\"><br />\n";
|
||||
echo " Set the database filename. The file extension should be '.db'.\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' 'valign='top' align='left' nowrap>\n";
|
||||
echo " Database Directory\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_path' maxlength='255' value=\"$db_path\"><br />\n";
|
||||
echo " Set the path to the database directory.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
}
|
||||
|
||||
if ($db_type == "mysql") {
|
||||
|
||||
//set defaults
|
||||
if (strlen($db_host) == 0) { $db_host = 'localhost'; }
|
||||
if (strlen($db_port) == 0) { $db_port = '3306'; }
|
||||
//if (strlen($db_name) == 0) { $db_name = 'fusionpbx'; }
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Database Host\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_host' maxlength='255' value=\"$db_host\"><br />\n";
|
||||
echo " Enter the host address for the database server.\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Database Port\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_port' maxlength='255' value=\"$db_port\"><br />\n";
|
||||
echo " Enter the port number. It is optional if the database is using the default port.\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Database Name\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_name' maxlength='255' value=\"$db_name\"><br />\n";
|
||||
echo " Enter the name of the database.\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Database Username\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_username' maxlength='255' value=\"$db_username\"><br />\n";
|
||||
echo " Enter the database username. \n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Database Password\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_password' maxlength='255' value=\"$db_password\"><br />\n";
|
||||
echo " Enter the database password.\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Create Database Options\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
if($db_create=='1') { $checked = "checked='checked'"; } else { $checked = ''; }
|
||||
echo " <label><input type='checkbox' name='db_create' value='1' $checked /> Create the database</label>\n";
|
||||
echo "<br />\n";
|
||||
echo "Choose whether to create the database\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Create Database Username\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_create_username' maxlength='255' value=\"$db_create_username\"><br />\n";
|
||||
echo " Optional, this username is used to create the database, a database user and set the permissions. \n";
|
||||
echo " By default this username is 'root' however it can be any account with permission to add a database, user, and grant permissions. \n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Create Database Password\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_create_password' maxlength='255' value=\"$db_create_password\"><br />\n";
|
||||
echo " Enter the create database password.\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
}
|
||||
|
||||
if ($db_type == "pgsql") {
|
||||
if (strlen($db_host) == 0) { $db_host = 'localhost'; }
|
||||
if (strlen($db_port) == 0) { $db_port = '5432'; }
|
||||
if (strlen($db_name) == 0) { $db_name = 'fusionpbx'; }
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Database Host\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_host' maxlength='255' value=\"$db_host\"><br />\n";
|
||||
echo " Enter the host address for the database server.\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Database Port\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_port' maxlength='255' value=\"$db_port\"><br />\n";
|
||||
echo " Enter the port number. It is optional if the database is using the default port.\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Database Name\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_name' maxlength='255' value=\"$db_name\"><br />\n";
|
||||
echo " Enter the name of the database.\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Database Username\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_username' maxlength='255' value=\"$db_username\"><br />\n";
|
||||
echo " Enter the database username.\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Database Password\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_password' maxlength='255' value=\"$db_password\"><br />\n";
|
||||
echo " Enter the database password.\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Create Database Options\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
if($db_create=='1') { $checked = "checked='checked'"; } else { $checked = ''; }
|
||||
echo " <label><input type='checkbox' name='db_create' value='1' $checked /> Create the database</label>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Create Database Username\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_create_username' maxlength='255' value=\"$db_create_username\"><br />\n";
|
||||
echo " Optional, this username is used to create the database, a database user and set the permissions. \n";
|
||||
echo " By default this username is 'pgsql' however it can be any account with permission to add a database, user, and grant permissions. \n";
|
||||
echo " Leave blank to use the details above. \n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Create Database Password\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_create_password' maxlength='255' value=\"$db_create_password\"><br />\n";
|
||||
echo " Enter the create database password.\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
||||
echo "</table>";
|
||||
//echo " <div style='text-align:right'>\n";
|
||||
//echo " <input type='button' name='back' class='btn' onclick=\"history.go(-1);\" value='".$text['button-back']."'/>\n";
|
||||
//echo " <input type='submit' name='execute' class='btn' name='".$text['button-execute']."'>\n";
|
||||
//echo " </div>\n";
|
||||
echo "</form>\n";
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Matthew Vale <github@mafoo.org>
|
||||
*/
|
||||
|
||||
echo "<form method='post' name='frm' action=''>\n";
|
||||
echo "<input type='hidden' name='install_language' value='".$_SESSION['domain']['language']['code']."'/>\n";
|
||||
echo "<input type='hidden' name='return_install_step' value='config_database'/>\n";
|
||||
echo "<input type='hidden' name='install_step' value='execute'/>\n";
|
||||
|
||||
echo "<input type='hidden' name='event_host' value='$event_host'/>\n";
|
||||
echo "<input type='hidden' name='event_port' value='$event_port'/>\n";
|
||||
echo "<input type='hidden' name='event_password' value='$event_password'/>\n";
|
||||
echo "<input type='hidden' name='db_type' value='$db_type'/>\n";
|
||||
echo "<input type='hidden' name='admin_username' value='$admin_username'/>\n";
|
||||
echo "<input type='hidden' name='admin_password' value='$admin_password'/>\n";
|
||||
echo "<input type='hidden' name='install_default_country' value='$install_default_country'/>\n";
|
||||
echo "<input type='hidden' name='install_template_name' value='$install_template_name'/>\n";
|
||||
echo "<input type='hidden' name='domain_name' value='$domain_name'/>\n";
|
||||
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td align='left' width='30%' nowrap><b>".$text['header-config_database']."</b></td>\n";
|
||||
echo "<td width='70%' align='right'>\n";
|
||||
echo " <input type='button' name='back' class='btn' onclick=\"history.go(-1);\" value='".$text['button-back']."'/>\n";
|
||||
echo " <input type='submit' name='next' class='btn' value='".$text['button-next']."'/>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
if ($db_type == "sqlite") {
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' 'valign='top' align='left' nowrap>\n";
|
||||
echo " Database Filename\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_name' maxlength='255' value=\"$db_name\"><br />\n";
|
||||
echo " Set the database filename. The file extension should be '.db'.\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' 'valign='top' align='left' nowrap>\n";
|
||||
echo " Database Directory\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_path' maxlength='255' value=\"$db_path\"><br />\n";
|
||||
echo " Set the path to the database directory.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
}
|
||||
|
||||
if ($db_type == "mysql") {
|
||||
|
||||
//set defaults
|
||||
if (strlen($db_host) == 0) { $db_host = 'localhost'; }
|
||||
if (strlen($db_port) == 0) { $db_port = '3306'; }
|
||||
//if (strlen($db_name) == 0) { $db_name = 'fusionpbx'; }
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Database Host\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_host' maxlength='255' value=\"$db_host\"><br />\n";
|
||||
echo " Enter the host address for the database server.\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Database Port\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_port' maxlength='255' value=\"$db_port\"><br />\n";
|
||||
echo " Enter the port number. It is optional if the database is using the default port.\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Database Name\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_name' maxlength='255' value=\"$db_name\"><br />\n";
|
||||
echo " Enter the name of the database.\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Database Username\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_username' maxlength='255' value=\"$db_username\"><br />\n";
|
||||
echo " Enter the database username. \n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Database Password\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_password' maxlength='255' value=\"$db_password\"><br />\n";
|
||||
echo " Enter the database password.\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Create Database Options\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
if($db_create=='1') { $checked = "checked='checked'"; } else { $checked = ''; }
|
||||
echo " <label><input type='checkbox' name='db_create' value='1' $checked /> Create the database</label>\n";
|
||||
echo "<br />\n";
|
||||
echo "Choose whether to create the database\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Create Database Username\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_create_username' maxlength='255' value=\"$db_create_username\"><br />\n";
|
||||
echo " Optional, this username is used to create the database, a database user and set the permissions. \n";
|
||||
echo " By default this username is 'root' however it can be any account with permission to add a database, user, and grant permissions. \n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Create Database Password\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_create_password' maxlength='255' value=\"$db_create_password\"><br />\n";
|
||||
echo " Enter the create database password.\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
}
|
||||
|
||||
if ($db_type == "pgsql") {
|
||||
if (strlen($db_host) == 0) { $db_host = 'localhost'; }
|
||||
if (strlen($db_port) == 0) { $db_port = '5432'; }
|
||||
if (strlen($db_name) == 0) { $db_name = 'fusionpbx'; }
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Database Host\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_host' maxlength='255' value=\"$db_host\"><br />\n";
|
||||
echo " Enter the host address for the database server.\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Database Port\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_port' maxlength='255' value=\"$db_port\"><br />\n";
|
||||
echo " Enter the port number. It is optional if the database is using the default port.\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Database Name\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_name' maxlength='255' value=\"$db_name\"><br />\n";
|
||||
echo " Enter the name of the database.\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Database Username\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_username' maxlength='255' value=\"$db_username\"><br />\n";
|
||||
echo " Enter the database username.\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Database Password\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_password' maxlength='255' value=\"$db_password\"><br />\n";
|
||||
echo " Enter the database password.\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Create Database Options\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
if($db_create=='1') { $checked = "checked='checked'"; } else { $checked = ''; }
|
||||
echo " <label><input type='checkbox' name='db_create' value='1' $checked /> Create the database</label>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Create Database Username\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_create_username' maxlength='255' value=\"$db_create_username\"><br />\n";
|
||||
echo " Optional, this username is used to create the database, a database user and set the permissions. \n";
|
||||
echo " By default this username is 'pgsql' however it can be any account with permission to add a database, user, and grant permissions. \n";
|
||||
echo " Leave blank to use the details above. \n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Create Database Password\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='db_create_password' maxlength='255' value=\"$db_create_password\"><br />\n";
|
||||
echo " Enter the create database password.\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
||||
echo "</table>";
|
||||
//echo " <div style='text-align:right'>\n";
|
||||
//echo " <input type='button' name='back' class='btn' onclick=\"history.go(-1);\" value='".$text['button-back']."'/>\n";
|
||||
//echo " <input type='submit' name='execute' class='btn' name='".$text['button-execute']."'>\n";
|
||||
//echo " </div>\n";
|
||||
echo "</form>\n";
|
||||
?>
|
||||
@@ -1,150 +1,150 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Matthew Vale <github@mafoo.org>
|
||||
*/
|
||||
|
||||
echo "<form method='post' name='frm' action=''>\n";
|
||||
echo "<input type='hidden' name='install_language' value='".$_SESSION['domain']['language']['code']."'/>\n";
|
||||
echo "<input type='hidden' name='return_install_step' value='config_detail'/>\n";
|
||||
echo "<input type='hidden' name='install_step' value='config_database'/>\n";
|
||||
|
||||
echo "<input type='hidden' name='event_host' value='$event_host'/>\n";
|
||||
echo "<input type='hidden' name='event_port' value='$event_port'/>\n";
|
||||
echo "<input type='hidden' name='event_password' value='$event_password'/>\n";
|
||||
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td align='left' width='30%' nowrap><b>".$text['header-config_detail']."</b></td>\n";
|
||||
echo "<td width='70%' align='right'>\n";
|
||||
echo " <input type='button' name='back' class='btn' onclick=\"history.go(-1);\" value='".$text['button-back']."'/>\n";
|
||||
echo " <input type='submit' name='next' class='btn' value='".$text['button-next']."'/>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " Username\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='admin_username' maxlength='255' value=\"$admin_username\"><br />\n";
|
||||
echo " Enter the username to use when logging in with the browser.<br />\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " Password\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='admin_password' maxlength='255' value=\"$admin_password\"><br />\n";
|
||||
echo " Enter the password to use when logging in with the browser.<br />\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " Country\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <select id='install_default_country' name='install_default_country' class='formfld' style=''>\n";
|
||||
require "resources/countries.php";
|
||||
|
||||
foreach ($countries as $iso_code => $country ){
|
||||
if($iso_code == $install_default_country){
|
||||
echo " <option value='$iso_code' selected='selected'>".$country['country']."</option>\n";
|
||||
}else{
|
||||
echo " <option value='$iso_code'>".$country['country']."</option>\n";
|
||||
}
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo " <br />\n";
|
||||
echo " Select ISO country code used to initialize calling contry code variables.<br />\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo " <tr>\n";
|
||||
echo " <td width='20%' class=\"vncellreq\" align='left' nowrap='nowrap'>\n";
|
||||
echo " Theme: \n";
|
||||
echo " </td>\n";
|
||||
echo " <td class=\"vtable\" align='left'>\n";
|
||||
echo " <select id='install_template_name' name='install_template_name' class='formfld' style=''>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
//add all the themes to the list
|
||||
$theme_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/themes';
|
||||
if ($handle = opendir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/themes')) {
|
||||
while (false !== ($dir_name = readdir($handle))) {
|
||||
if ($dir_name != "." && $dir_name != ".." && $dir_name != ".svn" && $dir_name != ".git" && $dir_name != "flags" && is_readable($theme_dir.'/'.$dir_name)) {
|
||||
$dir_label = str_replace('_', ' ', $dir_name);
|
||||
$dir_label = str_replace('-', ' ', $dir_label);
|
||||
if ($dir_name == 'enhanced') {
|
||||
echo " <option value='$dir_name' selected='selected'>$dir_label</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='$dir_name'>$dir_label</option>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo " <br />\n";
|
||||
echo " Select a theme to set as the default.<br />\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Domain name\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='domain_name' maxlength='255' value=\"$domain_name\"><br />\n";
|
||||
echo " Enter the default domain name. \n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Database Type\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <select name='db_type' id='db_type' class='formfld' id='form_tag' onchange='db_type_onchange();'>\n";
|
||||
if (extension_loaded('pdo_pgsql')) { echo " <option value='pgsql'>postgresql</option>\n"; }
|
||||
if (extension_loaded('pdo_mysql')) { echo " <option value='mysql'>mysql</option>\n"; }
|
||||
if (extension_loaded('pdo_sqlite')) { echo " <option value='sqlite' selected='selected'>sqlite</option>\n"; } //set sqlite as the default
|
||||
echo " </select><br />\n";
|
||||
echo " Select the database type.\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "</table>";
|
||||
//echo " <div style='text-align:right'>\n";
|
||||
//echo " <input type='button' name='back' class='btn' onclick=\"history.go(-1);\" value='".$text['button-back']."'/>\n";
|
||||
//echo " <input type='submit' class='btn' name='execute' name='".$text['button-next']."'>\n";
|
||||
//echo " </div>\n";
|
||||
echo "</form>\n";
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Matthew Vale <github@mafoo.org>
|
||||
*/
|
||||
|
||||
echo "<form method='post' name='frm' action=''>\n";
|
||||
echo "<input type='hidden' name='install_language' value='".$_SESSION['domain']['language']['code']."'/>\n";
|
||||
echo "<input type='hidden' name='return_install_step' value='config_detail'/>\n";
|
||||
echo "<input type='hidden' name='install_step' value='config_database'/>\n";
|
||||
|
||||
echo "<input type='hidden' name='event_host' value='$event_host'/>\n";
|
||||
echo "<input type='hidden' name='event_port' value='$event_port'/>\n";
|
||||
echo "<input type='hidden' name='event_password' value='$event_password'/>\n";
|
||||
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td align='left' width='30%' nowrap><b>".$text['header-config_detail']."</b></td>\n";
|
||||
echo "<td width='70%' align='right'>\n";
|
||||
echo " <input type='button' name='back' class='btn' onclick=\"history.go(-1);\" value='".$text['button-back']."'/>\n";
|
||||
echo " <input type='submit' name='next' class='btn' value='".$text['button-next']."'/>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " Username\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='admin_username' maxlength='255' value=\"$admin_username\"><br />\n";
|
||||
echo " Enter the username to use when logging in with the browser.<br />\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " Password\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='admin_password' maxlength='255' value=\"$admin_password\"><br />\n";
|
||||
echo " Enter the password to use when logging in with the browser.<br />\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " Country\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <select id='install_default_country' name='install_default_country' class='formfld' style=''>\n";
|
||||
require "resources/countries.php";
|
||||
|
||||
foreach ($countries as $iso_code => $country ){
|
||||
if($iso_code == $install_default_country){
|
||||
echo " <option value='$iso_code' selected='selected'>".$country['country']."</option>\n";
|
||||
}else{
|
||||
echo " <option value='$iso_code'>".$country['country']."</option>\n";
|
||||
}
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo " <br />\n";
|
||||
echo " Select ISO country code used to initialize calling contry code variables.<br />\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo " <tr>\n";
|
||||
echo " <td width='20%' class=\"vncellreq\" align='left' nowrap='nowrap'>\n";
|
||||
echo " Theme: \n";
|
||||
echo " </td>\n";
|
||||
echo " <td class=\"vtable\" align='left'>\n";
|
||||
echo " <select id='install_template_name' name='install_template_name' class='formfld' style=''>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
//add all the themes to the list
|
||||
$theme_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/themes';
|
||||
if ($handle = opendir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/themes')) {
|
||||
while (false !== ($dir_name = readdir($handle))) {
|
||||
if ($dir_name != "." && $dir_name != ".." && $dir_name != ".svn" && $dir_name != ".git" && $dir_name != "flags" && is_readable($theme_dir.'/'.$dir_name)) {
|
||||
$dir_label = str_replace('_', ' ', $dir_name);
|
||||
$dir_label = str_replace('-', ' ', $dir_label);
|
||||
if ($dir_name == 'enhanced') {
|
||||
echo " <option value='$dir_name' selected='selected'>$dir_label</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='$dir_name'>$dir_label</option>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo " <br />\n";
|
||||
echo " Select a theme to set as the default.<br />\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Domain name\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='domain_name' maxlength='255' value=\"$domain_name\"><br />\n";
|
||||
echo " Enter the default domain name. \n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " Database Type\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <select name='db_type' id='db_type' class='formfld' id='form_tag' onchange='db_type_onchange();'>\n";
|
||||
if (extension_loaded('pdo_pgsql')) { echo " <option value='pgsql'>postgresql</option>\n"; }
|
||||
if (extension_loaded('pdo_mysql')) { echo " <option value='mysql'>mysql</option>\n"; }
|
||||
if (extension_loaded('pdo_sqlite')) { echo " <option value='sqlite' selected='selected'>sqlite</option>\n"; } //set sqlite as the default
|
||||
echo " </select><br />\n";
|
||||
echo " Select the database type.\n";
|
||||
echo "\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "</table>";
|
||||
//echo " <div style='text-align:right'>\n";
|
||||
//echo " <input type='button' name='back' class='btn' onclick=\"history.go(-1);\" value='".$text['button-back']."'/>\n";
|
||||
//echo " <input type='submit' class='btn' name='execute' name='".$text['button-next']."'>\n";
|
||||
//echo " </div>\n";
|
||||
echo "</form>\n";
|
||||
?>
|
||||
@@ -1,137 +1,137 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Matthew Vale <github@mafoo.org>
|
||||
*/
|
||||
//fetch the values
|
||||
require_once "core/install/resources/classes/detect_switch.php";
|
||||
$switch_detect = new detect_switch($event_host, $event_port, $event_password);
|
||||
//$switch_detect->event_port = 2021;
|
||||
$detect_ok = true;
|
||||
try {
|
||||
$switch_detect->detect();
|
||||
} catch(Exception $e){
|
||||
//echo "<p><b>Failed to detect configuration</b> detect_switch reported: " . $e->getMessage() ."</p>\n";
|
||||
//$detect_ok = false;
|
||||
}
|
||||
echo "<input type='hidden' name='install_language' value='".$_SESSION['domain']['language']['code']."'/>\n";
|
||||
echo "<input type='hidden' name='install_step' value='detect_config'/>\n";
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td width='30%' align='left' nowrap><b>".$text['header-event_socket']."</b><br><br></td>\n";
|
||||
echo "<td width='70%' align='right'>";
|
||||
//echo " <input type='button' name='detect' class='btn' onclick=\"location.reload();\" value='".$text['button-detect']."'/>\n";
|
||||
echo " <input type='button' name='back' class='btn' onclick=\"history.go(-1);\" value='".$text['button-back']."'/>\n";
|
||||
echo " <input type='submit' name='next' class='btn' value='".$text['button-next']."'/>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " ".$text['label-event_host']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='event_host' maxlength='255' value=\"".$switch_detect->event_host."\" />\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-event_host']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " ".$text['label-event_port']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='event_port' maxlength='255' value=\"".$switch_detect->event_port."\"/>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-event_port']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " ".$text['label-event_password']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='password' name='event_password' maxlength='255' value=\"".$switch_detect->event_password."\"/>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-event_password']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo " <tr>\n";
|
||||
echo " <td colspan='2' align='right'>\n";
|
||||
echo " <br>";
|
||||
echo " </td>\n";
|
||||
echo " </tr>";
|
||||
|
||||
echo "</table>";
|
||||
if($detect_ok){
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td colspan='4' align='left' nowrap><b>".$text['title-detected_configuration']."</b></td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
$id = 1;
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap' width='15%'>\n";
|
||||
echo "Switch version\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' width='35%' align='left'>\n";
|
||||
echo " ".$switch_detect->version()."\n";
|
||||
echo "</td>\n";
|
||||
|
||||
foreach ($switch_detect->get_dirs() as $folder)
|
||||
{
|
||||
if($id % 2 == 0){ echo "<tr>\n"; }
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap' width='15%'>\n";
|
||||
echo $folder."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' width='35%' align='left'>\n";
|
||||
echo " ".$switch_detect->$folder()."\n";
|
||||
echo "</td>\n";
|
||||
if($id % 2 == 1){ echo "</tr>\n"; }
|
||||
$id++;
|
||||
}
|
||||
if($id % 2 == 1){ echo "</tr>\n"; }
|
||||
echo "<tr>\n";
|
||||
echo "<td colspan='4' align='left' nowrap><br/><b>".$text['title-assumed_configuration']."</b></td>\n";
|
||||
echo "</tr>\n";
|
||||
$id=0;
|
||||
foreach ($switch_detect->get_vdirs() as $folder) {
|
||||
if($id % 2 == 0){ echo "<tr>\n"; }
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap' width='15%'>\n";
|
||||
echo $folder."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' width='35%' align='left'>\n";
|
||||
echo " ".$switch_detect->$folder()."\n";
|
||||
echo "</td>\n";
|
||||
if($id % 2 == 1){ echo "</tr>\n"; }
|
||||
$id++;
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Matthew Vale <github@mafoo.org>
|
||||
*/
|
||||
//fetch the values
|
||||
require_once "core/install/resources/classes/detect_switch.php";
|
||||
$switch_detect = new detect_switch($event_host, $event_port, $event_password);
|
||||
//$switch_detect->event_port = 2021;
|
||||
$detect_ok = true;
|
||||
try {
|
||||
$switch_detect->detect();
|
||||
} catch(Exception $e){
|
||||
//echo "<p><b>Failed to detect configuration</b> detect_switch reported: " . $e->getMessage() ."</p>\n";
|
||||
//$detect_ok = false;
|
||||
}
|
||||
echo "<input type='hidden' name='install_language' value='".$_SESSION['domain']['language']['code']."'/>\n";
|
||||
echo "<input type='hidden' name='install_step' value='detect_config'/>\n";
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td width='30%' align='left' nowrap><b>".$text['header-event_socket']."</b><br><br></td>\n";
|
||||
echo "<td width='70%' align='right'>";
|
||||
//echo " <input type='button' name='detect' class='btn' onclick=\"location.reload();\" value='".$text['button-detect']."'/>\n";
|
||||
echo " <input type='button' name='back' class='btn' onclick=\"history.go(-1);\" value='".$text['button-back']."'/>\n";
|
||||
echo " <input type='submit' name='next' class='btn' value='".$text['button-next']."'/>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " ".$text['label-event_host']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='event_host' maxlength='255' value=\"".$switch_detect->event_host."\" />\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-event_host']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " ".$text['label-event_port']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='event_port' maxlength='255' value=\"".$switch_detect->event_port."\"/>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-event_port']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " ".$text['label-event_password']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='password' name='event_password' maxlength='255' value=\"".$switch_detect->event_password."\"/>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-event_password']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo " <tr>\n";
|
||||
echo " <td colspan='2' align='right'>\n";
|
||||
echo " <br>";
|
||||
echo " </td>\n";
|
||||
echo " </tr>";
|
||||
|
||||
echo "</table>";
|
||||
if($detect_ok){
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td colspan='4' align='left' nowrap><b>".$text['title-detected_configuration']."</b></td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
$id = 1;
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap' width='15%'>\n";
|
||||
echo "Switch version\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' width='35%' align='left'>\n";
|
||||
echo " ".$switch_detect->version()."\n";
|
||||
echo "</td>\n";
|
||||
|
||||
foreach ($switch_detect->get_dirs() as $folder)
|
||||
{
|
||||
if($id % 2 == 0){ echo "<tr>\n"; }
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap' width='15%'>\n";
|
||||
echo $folder."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' width='35%' align='left'>\n";
|
||||
echo " ".$switch_detect->$folder()."\n";
|
||||
echo "</td>\n";
|
||||
if($id % 2 == 1){ echo "</tr>\n"; }
|
||||
$id++;
|
||||
}
|
||||
if($id % 2 == 1){ echo "</tr>\n"; }
|
||||
echo "<tr>\n";
|
||||
echo "<td colspan='4' align='left' nowrap><br/><b>".$text['title-assumed_configuration']."</b></td>\n";
|
||||
echo "</tr>\n";
|
||||
$id=0;
|
||||
foreach ($switch_detect->get_vdirs() as $folder) {
|
||||
if($id % 2 == 0){ echo "<tr>\n"; }
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap' width='15%'>\n";
|
||||
echo $folder."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' width='35%' align='left'>\n";
|
||||
echo " ".$switch_detect->$folder()."\n";
|
||||
echo "</td>\n";
|
||||
if($id % 2 == 1){ echo "</tr>\n"; }
|
||||
$id++;
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,65 +1,65 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2015-2016
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Matthew Vale <github@mafoo.org>
|
||||
*/
|
||||
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='30%' align='left' nowrap='nowrap'><b>".$text['header-select_language']."</b><br><br></td>\n";
|
||||
echo " <td width='70%' align='right'>";
|
||||
echo " <input type='submit' name='submit' class='btn' value='".$text['button-next']."'/>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " ".$text['label-select_language']."\n";
|
||||
echo " </td>\n";
|
||||
echo " <td class='vtable' align='left'>\n";
|
||||
echo " <table cellpadding='0' cellspacing='0'>";
|
||||
foreach($_SESSION['app']['languages'] as $lang_code){
|
||||
echo " <tr>";
|
||||
echo " <td width='15' class='vtable' valign='top' nowrap='nowrap'>\n";
|
||||
echo " <input type='radio' name='install_language' value='$lang_code' id='lang_$lang_code' ";
|
||||
if($lang_code == $_SESSION['domain']['language']['code']) {
|
||||
echo " checked='checked'";
|
||||
}
|
||||
echo "/>";
|
||||
echo " </td>";
|
||||
echo " <td class='vtable' align='left' valign='top' nowrap='nowrap'>\n";
|
||||
echo " <img src='<!--{project_path}-->/core/install/resources/images/flags/$lang_code.png' alt='$lang_code'/> ".$text["language-$lang_code"];
|
||||
echo " </td>";
|
||||
echo " <td width='100%' class='vtable' valign='top'>\n";
|
||||
echo " \n";
|
||||
echo " </td>";
|
||||
echo " </tr>";
|
||||
}
|
||||
echo " </table>";
|
||||
echo " <br />\n";
|
||||
echo " ".$text['description-select_language']."\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo "</table>";
|
||||
echo "<br><br>";
|
||||
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2015-2016
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Matthew Vale <github@mafoo.org>
|
||||
*/
|
||||
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='30%' align='left' nowrap='nowrap'><b>".$text['header-select_language']."</b><br><br></td>\n";
|
||||
echo " <td width='70%' align='right'>";
|
||||
echo " <input type='submit' name='submit' class='btn' value='".$text['button-next']."'/>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " ".$text['label-select_language']."\n";
|
||||
echo " </td>\n";
|
||||
echo " <td class='vtable' align='left'>\n";
|
||||
echo " <table cellpadding='0' cellspacing='0'>";
|
||||
foreach($_SESSION['app']['languages'] as $lang_code){
|
||||
echo " <tr>";
|
||||
echo " <td width='15' class='vtable' valign='top' nowrap='nowrap'>\n";
|
||||
echo " <input type='radio' name='install_language' value='$lang_code' id='lang_$lang_code' ";
|
||||
if($lang_code == $_SESSION['domain']['language']['code']) {
|
||||
echo " checked='checked'";
|
||||
}
|
||||
echo "/>";
|
||||
echo " </td>";
|
||||
echo " <td class='vtable' align='left' valign='top' nowrap='nowrap'>\n";
|
||||
echo " <img src='<!--{project_path}-->/core/install/resources/images/flags/$lang_code.png' alt='$lang_code'/> ".$text["language-$lang_code"];
|
||||
echo " </td>";
|
||||
echo " <td width='100%' class='vtable' valign='top'>\n";
|
||||
echo " \n";
|
||||
echo " </td>";
|
||||
echo " </tr>";
|
||||
}
|
||||
echo " </table>";
|
||||
echo " <br />\n";
|
||||
echo " ".$text['description-select_language']."\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo "</table>";
|
||||
echo "<br><br>";
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user