浏览代码

Update install freeswitch commented out copy scripts and create config lua as they handled in other code. Update install fusionpbx adding switch directories and creating groups handled in other code. When testing is completed will be removed from the code.

markjcrane 9 年之前
父节点
当前提交
198654e7c1
共有 2 个文件被更改,包括 50 次插入44 次删除
  1. 41 38
      core/install/resources/classes/install_fusionpbx.php
  2. 9 6
      core/install/resources/classes/install_switch.php

+ 41 - 38
core/install/resources/classes/install_fusionpbx.php

@@ -663,7 +663,7 @@ include "root.php";
 				$tmp[$x]['subcategory'] = 'template';
 				$tmp[$x]['subcategory'] = 'template';
 				$tmp[$x]['enabled'] = 'true';
 				$tmp[$x]['enabled'] = 'true';
 				$x++;
 				$x++;
-
+/*
 				//switch settings
 				//switch settings
 				$tmp[$x]['name'] = 'dir';
 				$tmp[$x]['name'] = 'dir';
 				$tmp[$x]['value'] = $switch_bin_dir;
 				$tmp[$x]['value'] = $switch_bin_dir;
@@ -767,7 +767,7 @@ include "root.php";
 				$tmp[$x]['subcategory'] = 'dialplan';
 				$tmp[$x]['subcategory'] = 'dialplan';
 				$tmp[$x]['enabled'] = 'false';
 				$tmp[$x]['enabled'] = 'false';
 				$x++;
 				$x++;
-
+*/
 				//server settings
 				//server settings
 				$tmp[$x]['name'] = 'dir';
 				$tmp[$x]['name'] = 'dir';
 				$tmp[$x]['value'] = $this->global_settings->switch_temp_dir();
 				$tmp[$x]['value'] = $this->global_settings->switch_temp_dir();
@@ -824,6 +824,7 @@ include "root.php";
 					$x++;
 					$x++;
 				}
 				}
 
 
+/*
 			//add the groups
 			//add the groups
 				$x = 0;
 				$x = 0;
 				$tmp[$x]['group_name'] = 'superadmin';
 				$tmp[$x]['group_name'] = 'superadmin';
@@ -895,6 +896,7 @@ include "root.php";
 					}
 					}
 				}
 				}
 				$this->dbh->commit();
 				$this->dbh->commit();
+*/
 			}
 			}
 		}
 		}
 
 
@@ -919,41 +921,42 @@ include "root.php";
 				$sql .= "where USER_uuid = '".$this->admin_uuid."' ";
 				$sql .= "where USER_uuid = '".$this->admin_uuid."' ";
 				$this->write_debug($sql);
 				$this->write_debug($sql);
 				$this->dbh->exec(check_sql($sql));
 				$this->dbh->exec(check_sql($sql));
-			}else{
-				$this->write_progress("\t... creating super user");
-			//add a user and then add the user to the superadmin group
-			//prepare the values
-				$this->admin_uuid = uuid();
-				$contact_uuid = uuid();
-			//set a sessiong variable
-				$_SESSION["user_uuid"] = $user_uuid;
-			//salt used with the password to create a one way hash
-			//add the user account
-				$sql = "insert into v_users ";
-				$sql .= "(";
-				$sql .= "domain_uuid, ";
-				$sql .= "user_uuid, ";
-				$sql .= "contact_uuid, ";
-				$sql .= "username, ";
-				$sql .= "password, ";
-				$sql .= "salt, ";
-				$sql .= "add_date, ";
-				$sql .= "add_user ";
-				$sql .= ") ";
-				$sql .= "values ";
-				$sql .= "(";
-				$sql .= "'".$this->global_settings->domain_uuid()."', ";
-				$sql .= "'".$this->admin_uuid."', ";
-				$sql .= "'$contact_uuid', ";
-				$sql .= "'".$this->admin_username."', ";
-				$sql .= "'".md5($salt.$this->admin_password)."', ";
-				$sql .= "'$salt', ";
-				$sql .= "now(), ";
-				$sql .= "'".$this->admin_username."' ";
-				$sql .= ");";
-				$this->write_debug( $sql."\n");
-				$this->dbh->exec(check_sql($sql));
-				unset($sql);
+			} else {
+				//message
+					$this->write_progress("\t... creating super user");
+				//add a user and then add the user to the superadmin group
+				//prepare the values
+					$this->admin_uuid = uuid();
+					$contact_uuid = uuid();
+				//set a sessiong variable
+					$_SESSION["user_uuid"] = $user_uuid;
+				//salt used with the password to create a one way hash
+				//add the user account
+					$sql = "insert into v_users ";
+					$sql .= "(";
+					$sql .= "domain_uuid, ";
+					$sql .= "user_uuid, ";
+					$sql .= "contact_uuid, ";
+					$sql .= "username, ";
+					$sql .= "password, ";
+					$sql .= "salt, ";
+					$sql .= "add_date, ";
+					$sql .= "add_user ";
+					$sql .= ") ";
+					$sql .= "values ";
+					$sql .= "(";
+					$sql .= "'".$this->global_settings->domain_uuid()."', ";
+					$sql .= "'".$this->admin_uuid."', ";
+					$sql .= "'$contact_uuid', ";
+					$sql .= "'".$this->admin_username."', ";
+					$sql .= "'".md5($salt.$this->admin_password)."', ";
+					$sql .= "'$salt', ";
+					$sql .= "now(), ";
+					$sql .= "'".$this->admin_username."' ";
+					$sql .= ");";
+					$this->write_debug( $sql."\n");
+					$this->dbh->exec(check_sql($sql));
+					unset($sql);
 			}
 			}
 			$this->write_progress("\tChecking if superuser contact exists");
 			$this->write_progress("\tChecking if superuser contact exists");
 			$sql = "select count(*) from v_contacts ";
 			$sql = "select count(*) from v_contacts ";
@@ -996,7 +999,7 @@ include "root.php";
 			$prep_statement->execute();
 			$prep_statement->execute();
 			$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
 			$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
 			if ($row['count'] == 0) {
 			if ($row['count'] == 0) {
-			//add the user to the superadmin group
+				//add the user to the superadmin group
 				$sql = "insert into v_group_users ";
 				$sql = "insert into v_group_users ";
 				$sql .= "(";
 				$sql .= "(";
 				$sql .= "group_user_uuid, ";
 				$sql .= "group_user_uuid, ";

+ 9 - 6
core/install/resources/classes/install_switch.php

@@ -29,7 +29,7 @@ include "root.php";
 	class install_switch {
 	class install_switch {
 
 
 		protected $global_settings;
 		protected $global_settings;
-		protected $config_lua;
+		//protected $config_lua;
 		protected $dbh;
 		protected $dbh;
 
 
 		public $debug = false;
 		public $debug = false;
@@ -43,6 +43,7 @@ include "root.php";
 				throw new Exception('The parameter $global_settings must be a global_settings object (or a subclass of)');
 				throw new Exception('The parameter $global_settings must be a global_settings object (or a subclass of)');
 			}
 			}
 			$this->global_settings = $global_settings;
 			$this->global_settings = $global_settings;
+/*
 			if (is_dir("/etc/fusionpbx")){
 			if (is_dir("/etc/fusionpbx")){
 				$this->config_lua = "/etc/fusionpbx/config.lua";
 				$this->config_lua = "/etc/fusionpbx/config.lua";
 			}elseif (is_dir("/usr/local/etc/fusionpbx")){
 			}elseif (is_dir("/usr/local/etc/fusionpbx")){
@@ -53,6 +54,7 @@ include "root.php";
 				throw new Exception("Could not work out where to put the config.lua");
 				throw new Exception("Could not work out where to put the config.lua");
 			}
 			}
 			$this->config_lua = normalize_path($this->config_lua);
 			$this->config_lua = normalize_path($this->config_lua);
+*/
 		}
 		}
 
 
 		//utility Functions
 		//utility Functions
@@ -89,20 +91,20 @@ include "root.php";
 		function install_phase_1() {
 		function install_phase_1() {
 			$this->write_progress("Install phase 1 started for switch");
 			$this->write_progress("Install phase 1 started for switch");
 			$this->copy_conf();
 			$this->copy_conf();
-			$this->copy_scripts();
+			//$this->copy_scripts();
 			$this->write_progress("Install phase 1 completed for switch");
 			$this->write_progress("Install phase 1 completed for switch");
 		}
 		}
 
 
 		function install_phase_2() {
 		function install_phase_2() {
 			$this->write_progress("Install phase 2 started for switch");
 			$this->write_progress("Install phase 2 started for switch");
-			$this->create_config_lua();
+			//$this->create_config_lua();
 			$this->restart_switch();
 			$this->restart_switch();
 			$this->write_progress("Install phase 2 completed for switch");
 			$this->write_progress("Install phase 2 completed for switch");
 		}
 		}
 
 
 		function upgrade() {
 		function upgrade() {
-			$this->copy_scripts();
-			$this->create_config_lua();
+			//$this->copy_scripts();
+			//$this->create_config_lua();
 		}
 		}
 
 
 		protected function copy_conf() {
 		protected function copy_conf() {
@@ -190,6 +192,7 @@ include "root.php";
 			}
 			}
 		}
 		}
 
 
+/*
 		public function create_config_lua() {
 		public function create_config_lua() {
 			//define the database connection as global
 			//define the database connection as global
 				global $db;
 				global $db;
@@ -346,7 +349,7 @@ include "root.php";
 				unset($tmp);
 				unset($tmp);
 				fclose($fout);
 				fclose($fout);
 		}
 		}
-
+*/
 		protected function restart_switch() {
 		protected function restart_switch() {
 			$esl = new event_socket;
 			$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())) {
 			if(!$esl->connect($this->global_settings->switch_event_host(), $this->global_settings->switch_event_port(), $this->global_settings->switch_event_password())) {