diff --git a/install/froxlor.sql b/install/froxlor.sql index 09d3449e..5477286e 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -466,7 +466,7 @@ INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) V INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (18, 'system', 'vmail_homedir', '/var/customers/mail/'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (19, 'system', 'bindconf_directory', '/etc/bind/'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (20, 'system', 'bindreload_command', '/etc/init.d/bind9 reload'); -INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (22, 'panel', 'version', '0.9.14-svn7'); +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (22, 'panel', 'version', '0.9.14-svn8'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (23, 'system', 'hostname', 'SERVERNAME'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (24, 'login', 'maxloginattempts', '3'); INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (25, 'login', 'deactivatetime', '900'); @@ -1004,13 +1004,12 @@ CREATE TABLE IF NOT EXISTS `cronjobs_run` ( # INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (1, 'froxlor/core', 'cron_tasks.php', '5 MINUTE', '1', 'cron_tasks'); -INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (2, 'froxlor/core', 'cron_legacy.php', '5 MINUTE', '1', 'cron_legacy'); -INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (3, 'froxlor/aps', 'cron_apsinstaller.php', '5 MINUTE', '0', 'cron_apsinstaller'); -INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (4, 'froxlor/autoresponder', 'cron_autoresponder.php', '5 MINUTE', '0', 'cron_autoresponder'); -INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (5, 'froxlor/aps', 'cron_apsupdater.php', '1 HOUR', '0', 'cron_apsupdater'); -INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (6, 'froxlor/core', 'cron_traffic.php', '1 DAY', '1', 'cron_traffic'); -INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (7, 'froxlor/ticket', 'cron_used_tickets_reset.php', '1 DAY', '1', 'cron_ticketsreset'); -INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (8, 'froxlor/ticket', 'cron_ticketarchive.php', '1 MONTH', '1', 'cron_ticketarchive'); +INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (2, 'froxlor/aps', 'cron_apsinstaller.php', '5 MINUTE', '0', 'cron_apsinstaller'); +INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (3, 'froxlor/autoresponder', 'cron_autoresponder.php', '5 MINUTE', '0', 'cron_autoresponder'); +INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (4, 'froxlor/aps', 'cron_apsupdater.php', '1 HOUR', '0', 'cron_apsupdater'); +INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (5, 'froxlor/core', 'cron_traffic.php', '1 DAY', '1', 'cron_traffic'); +INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (6, 'froxlor/ticket', 'cron_used_tickets_reset.php', '1 DAY', '1', 'cron_ticketsreset'); +INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES (7, 'froxlor/ticket', 'cron_ticketarchive.php', '1 MONTH', '1', 'cron_ticketarchive'); # -------------------------------------------------------- diff --git a/install/updates/froxlor/0.9/update_0.9.inc.php b/install/updates/froxlor/0.9/update_0.9.inc.php index 09239397..9a0396f1 100644 --- a/install/updates/froxlor/0.9/update_0.9.inc.php +++ b/install/updates/froxlor/0.9/update_0.9.inc.php @@ -1274,3 +1274,14 @@ if(isFroxlorVersion('0.9.14-svn6')) updateToVersion('0.9.14-svn7'); } + +if(isFroxlorVersion('0.9.14-svn7')) +{ + showUpdateStep("Updating from 0.9.14-svn7 to 0.9.14-svn8", false); + + showUpdateStep("Removing deprecated legacy-cronjob from database"); + $db->query("DELETE FROM `".TABLE_PANEL_CRONRUNS."` WHERE `cronfile` ='cron_legacy.php';"); + lastStepStatus(0); + + updateToVersion('0.9.14-svn8'); +} diff --git a/lib/classes/froxlorclient/class.froxlorclient.php b/lib/classes/froxlorclient/class.froxlorclient.php index 8a254394..02bae35b 100644 --- a/lib/classes/froxlorclient/class.froxlorclient.php +++ b/lib/classes/froxlorclient/class.froxlorclient.php @@ -107,26 +107,41 @@ class froxlorclient public function Deploy() { // get FroxlorSshTransport-object - if($this->_getSetting('client', 'deploy_mode') !== null - && $this->_getSetting('client', 'deploy_mode') == 'pubkey' - ) { - $ssh = FroxlorSshTransport::usePublicKey( - $this->_getSetting('client', 'hostname'), - $this->_getSetting('client', 'ssh_port'), - $this->_getSetting('client', 'ssh_user'), - $this->_getSetting('client', 'ssh_pubkey'), - $this->_getSetting('client', 'ssh_privkey'), - $this->_getSetting('client', 'ssh_passphrase') - ); - } else if($this->_getSetting('client', 'deploy_mode') !== null) { - $ssh = FroxlorSshTransport::usePlainPassword( - $this->_getSetting('client', 'hostname'), - $this->_getSetting('client', 'ssh_port'), - $this->_getSetting('client', 'ssh_user'), - $this->_getSetting('client', 'ssh_passphrase') - ); - } else { - throw new Exception('NO_DEPLOY_METHOD_GIVEN'); + $ssh = null; + try { + if($this->_getSetting('client', 'deploy_mode') !== null + && $this->_getSetting('client', 'deploy_mode') == 'pubkey' + ) { + $ssh = FroxlorSshTransport::usePublicKey( + $this->_getSetting('client', 'hostname'), + $this->_getSetting('client', 'ssh_port'), + $this->_getSetting('client', 'ssh_user'), + $this->_getSetting('client', 'ssh_pubkey'), + $this->_getSetting('client', 'ssh_privkey'), + $this->_getSetting('client', 'ssh_passphrase') + ); + } else if($this->_getSetting('client', 'deploy_mode') !== null) { + $ssh = FroxlorSshTransport::usePlainPassword( + $this->_getSetting('client', 'hostname'), + $this->_getSetting('client', 'ssh_port'), + $this->_getSetting('client', 'ssh_user'), + $this->_getSetting('client', 'ssh_passphrase') + ); + } else { + throw new Exception('NO_DEPLOY_METHOD_GIVEN'); + } + } catch (Exception $e) { + return $e->getMessage(); + } + + if($ssh instanceof FroxlorSshTransport) + { + /** + * @TODO implement me + */ + + // close the session + $ssh->close(); } } @@ -353,6 +368,10 @@ class froxlorclient { $this->Set($field, $value, true, true); } + + // after we have details about the client, + // we need its settings too + $this->_readSettings(); } } } diff --git a/lib/classes/sshtransport/class.FroxlorSshTransport.php b/lib/classes/sshtransport/class.FroxlorSshTransport.php index 3e3899b9..f3a74b2c 100644 --- a/lib/classes/sshtransport/class.FroxlorSshTransport.php +++ b/lib/classes/sshtransport/class.FroxlorSshTransport.php @@ -309,4 +309,4 @@ class FroxlorSshTransport } } } -?> \ No newline at end of file + diff --git a/lib/tables.inc.php b/lib/tables.inc.php index 58f19e4a..edfa0c8c 100644 --- a/lib/tables.inc.php +++ b/lib/tables.inc.php @@ -72,7 +72,7 @@ define('PACKAGE_ENABLED', 2); // VERSION INFO -$version = '0.9.14-svn7'; +$version = '0.9.14-svn8'; $dbversion = '2'; $branding = '';