Merge branch 'master' of http://git.ispconfig.org/ispconfig/ispconfig3
| | |
| | | $inst->install_crontab(); |
| | | |
| | | swriteln('Restarting services ...'); |
| | | if($conf['mysql']['installed'] == true && $conf['mysql']['init_script'] != '') system($inst->getinitcommand($conf['mysql']['init_script'], 'restart')); |
| | | if($conf['mysql']['installed'] == true && $conf['mysql']['init_script'] != '') system($inst->getinitcommand($conf['mysql']['init_script'], 'restart').' >/dev/null 2>&1'); |
| | | if($conf['postfix']['installed'] == true && $conf['postfix']['init_script'] != '') system($inst->getinitcommand($conf['postfix']['init_script'], 'restart')); |
| | | if($conf['saslauthd']['installed'] == true && $conf['saslauthd']['init_script'] != '') system($inst->getinitcommand($conf['saslauthd']['init_script'], 'restart')); |
| | | if($conf['amavis']['installed'] == true && $conf['amavis']['init_script'] != '') system($inst->getinitcommand($conf['amavis']['init_script'], 'restart')); |
| | |
| | | $mainver = array_filter($mainver); |
| | | $mainver = current($mainver).'.'.next($mainver); |
| | | switch ($mainver){ |
| | | case "14.10": |
| | | $relname = "(Utopic Unicorn)"; |
| | | break; |
| | | case "14.04": |
| | | $relname = "(Trusty Tahr)"; |
| | | break; |
| | |
| | | |
| | | public function getinitcommand($servicename, $action, $init_script_directory = ''){ |
| | | global $conf; |
| | | // systemd |
| | | if(is_executable('/bin/systemd') || is_executable('/usr/bin/systemctl')){ |
| | | return 'systemctl '.$action.' '.$servicename.'.service'; |
| | | } |
| | | // upstart |
| | | if(is_executable('/sbin/initctl')){ |
| | | exec('/sbin/initctl version 2>/dev/null | /bin/grep -q upstart', $retval['output'], $retval['retval']); |
| | | if(intval($retval['retval']) == 0) return 'service '.$servicename.' '.$action; |
| | | } |
| | | // systemd |
| | | if(is_executable('/bin/systemd') || is_executable('/usr/bin/systemctl')){ |
| | | return 'systemctl '.$action.' '.$servicename.'.service'; |
| | | } |
| | | // sysvinit |
| | | if($init_script_directory == '') $init_script_directory = $conf['init_scripts']; |
| | | if(substr($init_script_directory, -1) === '/') $init_script_directory = substr($init_script_directory, 0, -1); |
| | |
| | | //** Restart services: |
| | | if($reconfigure_services_answer == 'yes') { |
| | | swriteln('Restarting services ...'); |
| | | if($conf['mysql']['installed'] == true && $conf['mysql']['init_script'] != '') system($inst->getinitcommand($conf['mysql']['init_script'], 'restart')); |
| | | if($conf['mysql']['installed'] == true && $conf['mysql']['init_script'] != '') system($inst->getinitcommand($conf['mysql']['init_script'], 'restart').' >/dev/null 2>&1'); |
| | | if($conf['services']['mail']) { |
| | | if($conf['postfix']['installed'] == true && $conf['postfix']['init_script'] != '') system($inst->getinitcommand($conf['postfix']['init_script'], 'restart')); |
| | | if($conf['saslauthd']['installed'] == true && $conf['saslauthd']['init_script'] != '') system($inst->getinitcommand($conf['saslauthd']['init_script'], 'restart')); |
| | |
| | | |
| | | if($ids_config['sql_scan_enabled'] == 'yes') { |
| | | |
| | | // Remove whitespace |
| | | $string = trim($string); |
| | | if(substr($string,-1) == ';') $string = substr($string,0,-1); |
| | | |
| | | // Save original string |
| | | $string_orig = $string; |
| | | |
| | | //echo $string; |
| | |
| | | $sql = $app->tform->getSQL($this->dataRecord, $app->tform->getCurrentTab(), 'UPDATE', $this->id, $ext_where); |
| | | if($app->tform->errorMessage == '') { |
| | | |
| | | if($app->tform->formDef['db_history'] == 'yes') { |
| | | $this->oldDataRecord = $app->tform->getDataRecord($this->id); |
| | | } |
| | | $this->oldDataRecord = $app->tform->getDataRecord($this->id); |
| | | |
| | | // Save record in database |
| | | $this->onUpdateSave($sql); |
| | |
| | | $mainver = array_filter($mainver); |
| | | $mainver = current($mainver).'.'.next($mainver); |
| | | switch ($mainver){ |
| | | case "14.10": |
| | | $relname = "(Utopic Unicorn)"; |
| | | break; |
| | | case "14.04": |
| | | $relname = "(Trusty Tahr)"; |
| | | break; |
| | |
| | | |
| | | function getinitcommand($servicename, $action, $init_script_directory = ''){ |
| | | global $conf; |
| | | // systemd |
| | | if(is_executable('/bin/systemd') || is_executable('/usr/bin/systemctl')){ |
| | | return 'systemctl '.$action.' '.$servicename.'.service'; |
| | | } |
| | | // upstart |
| | | if(is_executable('/sbin/initctl')){ |
| | | exec('/sbin/initctl version 2>/dev/null | /bin/grep -q upstart', $retval['output'], $retval['retval']); |
| | | if(intval($retval['retval']) == 0) return 'service '.$servicename.' '.$action; |
| | | } |
| | | // systemd |
| | | if(is_executable('/bin/systemd') || is_executable('/usr/bin/systemctl')){ |
| | | return 'systemctl '.$action.' '.$servicename.'.service'; |
| | | } |
| | | // sysvinit |
| | | if($init_script_directory == '') $init_script_directory = $conf['init_scripts']; |
| | |
| | | global $app; |
| | | |
| | | $cmd = ''; |
| | | if(is_installed('apache2ctl')) $cmd = 'apache2ctl -t -D DUMP_MODULES'; |
| | | elseif(is_installed('apachectl')) $cmd = 'apachectl -t -D DUMP_MODULES'; |
| | | if($this->is_installed('apache2ctl')) $cmd = 'apache2ctl -t -D DUMP_MODULES'; |
| | | elseif($this->is_installed('apachectl')) $cmd = 'apachectl -t -D DUMP_MODULES'; |
| | | else { |
| | | $app->log("Could not check apache modules, apachectl not found.", LOGLEVEL_WARN); |
| | | return array(); |
| | |
| | | $socket_dir = escapeshellcmd($web_config['php_fpm_socket_dir']); |
| | | if(substr($socket_dir, -1) != '/') $socket_dir .= '/'; |
| | | |
| | | // User sockets, but not with apache 2.4 as socket support is buggy in that version |
| | | if($data['new']['php_fpm_use_socket'] == 'y' && $app->system->getapacheversion() < 2.4){ |
| | | $apache_modules = $app->system->getapachemodules(); |
| | | |
| | | // Use sockets, but not with apache 2.4 on centos (mod_proxy_fcgi) as socket support is buggy in that version |
| | | if($data['new']['php_fpm_use_socket'] == 'y' && in_array('fastcgi_module',$apache_modules)){ |
| | | $use_tcp = 0; |
| | | $use_socket = 1; |
| | | } else { |
| | |
| | | $tpl->newTemplate('php_fpm_pool.conf.master'); |
| | | $tpl->setVar('apache_version', $app->system->getapacheversion()); |
| | | |
| | | if($data['new']['php_fpm_use_socket'] == 'y'){ |
| | | $apache_modules = $app->system->getapachemodules(); |
| | | |
| | | // Use sockets, but not with apache 2.4 on centos (mod_proxy_fcgi) as socket support is buggy in that version |
| | | if($data['new']['php_fpm_use_socket'] == 'y' && in_array('fastcgi_module',$apache_modules)){ |
| | | $use_tcp = 0; |
| | | $use_socket = 1; |
| | | if(!is_dir($socket_dir)) $app->system->mkdirpath($socket_dir); |