From a56667e440224604ddf4e9302f62000fbce0a34c Mon Sep 17 00:00:00 2001 From: PhantomVl Date: Wed, 24 Apr 2019 20:31:38 +0300 Subject: [PATCH] - Installation procedure, detect chan_sccp --- install.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/install.php b/install.php index f542c8b..04f5320 100644 --- a/install.php +++ b/install.php @@ -805,12 +805,12 @@ function CreateBackUpConfig() { global $amp_conf; outn("
  • " . _("Create Config BackUp") . "
  • "); $cnf_int = \FreePBX::Config(); - $backup_files = array('extconfig','extconfig','res_mysql', 'res_config_mysql','sccp'); + $backup_files = array('extensions','extconfig','res_mysql', 'res_config_mysql','sccp'); $backup_ext = array('_custom.conf', '.conf'); $dir = $cnf_int->get('ASTETCDIR'); - $filename = $dir.'/sccp_backup_'.date("Ymd").'.sql'; - $result = exec('mysqldump '.$amp_conf['AMPDBNAME'].' --password='.$amp_conf['AMPDBPASS'].' --user='.$amp_conf['AMPDBUSER'].' --single-transaction >'.$filename ,$output); + $fsql = $dir.'/sccp_backup_'.date("Ymd").'.sql'; + $result = exec('mysqldump '.$amp_conf['AMPDBNAME'].' --password='.$amp_conf['AMPDBPASS'].' --user='.$amp_conf['AMPDBUSER'].' --single-transaction >'.$fsql ,$output); $zip = new \ZipArchive(); $filename = $dir . "/sccp_instal_backup" . date("Ymd"). ".zip"; @@ -822,10 +822,14 @@ function CreateBackUpConfig() { } } } + if (file_exists($fsql)) { + $zip->addFile($fsql); + } $zip->close(); } else { outn("
  • " . _("Error Create BackUp: ") . $filename ."
  • "); } + unlink($fsql); outn("
  • " . _("Create Config BackUp: ") . $filename ."
  • "); } @@ -919,9 +923,10 @@ $sccp_db_ver = CheckSCCPManagerDBVersion(); // BackUp Old config CreateBackUpConfig(); - -InstallDB_sccpuser(); -InstallDB_Buttons(); +if ($sccp_compatible > 431) { + InstallDB_sccpuser(); + InstallDB_Buttons(); +} InstallDB_sccpsettings(); InstallDB_sccpdevmodel();