Commit 7cf3e980 authored by Marius Cramer's avatar Marius Cramer

Merge remote-tracking branch 'origin/stable-3.0.5'

Conflicts:
	install/install.php
	install/tpl/server.ini.master
	interface/lib/classes/aps_guicontroller.inc.php
	interface/lib/classes/tform.inc.php
	interface/lib/lang/de.lng
	interface/web/admin/form/server_config.tform.php
	interface/web/admin/lib/lang/de.lng
	interface/web/admin/lib/lang/de_directive_snippets.lng
	interface/web/admin/lib/lang/de_directive_snippets_list.lng
	interface/web/admin/lib/lang/de_firewall.lng
	interface/web/admin/lib/lang/de_firewall_list.lng
	interface/web/admin/lib/lang/de_groups.lng
	interface/web/admin/lib/lang/de_groups_list.lng
	interface/web/admin/lib/lang/de_iptables.lng
	interface/web/admin/lib/lang/de_iptables_list.lng
	interface/web/admin/lib/lang/de_language_add.lng
	interface/web/admin/lib/lang/de_language_complete.lng
	interface/web/admin/lib/lang/de_language_edit.lng
	interface/web/admin/lib/lang/de_language_export.lng
	interface/web/admin/lib/lang/de_language_import.lng
	interface/web/admin/lib/lang/de_language_list.lng
	interface/web/admin/lib/lang/de_login_as.lng
	interface/web/admin/lib/lang/de_package_install.lng
	interface/web/admin/lib/lang/de_remote_action.lng
	interface/web/admin/lib/lang/de_remote_user.lng
	interface/web/admin/lib/lang/de_remote_user_list.lng
	interface/web/admin/lib/lang/de_server.lng
	interface/web/admin/lib/lang/de_server_config.lng
	interface/web/admin/lib/lang/de_server_config_list.lng
	interface/web/admin/lib/lang/de_server_ip.lng
	interface/web/admin/lib/lang/de_server_ip_list.lng
	interface/web/admin/lib/lang/de_server_list.lng
	interface/web/admin/lib/lang/de_server_php.lng
	interface/web/admin/lib/lang/de_server_php_list.lng
	interface/web/admin/lib/lang/de_software_package.lng
	interface/web/admin/lib/lang/de_software_package_install.lng
	interface/web/admin/lib/lang/de_software_package_list.lng
	interface/web/admin/lib/lang/de_software_repo.lng
	interface/web/admin/lib/lang/de_software_repo_list.lng
	interface/web/admin/lib/lang/de_software_update_list.lng
	interface/web/admin/lib/lang/de_system_config.lng
	interface/web/admin/lib/lang/de_tpl_default_admin.lng
	interface/web/admin/lib/lang/de_users.lng
	interface/web/admin/lib/lang/de_users_list.lng
	interface/web/admin/templates/server_config_server_edit.htm
	interface/web/client/lib/lang/de.lng
	interface/web/client/lib/lang/de_client.lng
	interface/web/client/lib/lang/de_client_circle.lng
	interface/web/client/lib/lang/de_client_circle_list.lng
	interface/web/client/lib/lang/de_client_del.lng
	interface/web/client/lib/lang/de_client_message.lng
	interface/web/client/lib/lang/de_client_template.lng
	interface/web/client/lib/lang/de_client_template_list.lng
	interface/web/client/lib/lang/de_clients_list.lng
	interface/web/client/lib/lang/de_domain.lng
	interface/web/client/lib/lang/de_domain_list.lng
	interface/web/client/lib/lang/de_reseller.lng
	interface/web/client/lib/lang/de_resellers_list.lng
	interface/web/dashboard/dashlets/quota.php
	interface/web/dashboard/lib/lang/de.lng
	interface/web/dashboard/lib/lang/de_dashlet_limits.lng
	interface/web/dashboard/lib/lang/de_dashlet_mailquota.lng
	interface/web/dashboard/lib/lang/de_dashlet_modules.lng
	interface/web/dashboard/lib/lang/de_dashlet_quota.lng
	interface/web/designer/lib/lang/de.lng
	interface/web/designer/lib/lang/de_form_edit.lng
	interface/web/designer/lib/lang/de_form_list.lng
	interface/web/designer/lib/lang/de_module_edit.lng
	interface/web/designer/lib/lang/de_module_list.lng
	interface/web/designer/lib/lang/de_module_nav_edit.lng
	interface/web/designer/lib/lang/de_module_nav_item_edit.lng
	interface/web/designer/lib/lang/de_module_show.lng
	interface/web/dns/lib/lang/de.lng
	interface/web/dns/lib/lang/de_dns_a.lng
	interface/web/dns/lib/lang/de_dns_a_list.lng
	interface/web/dns/lib/lang/de_dns_aaaa.lng
	interface/web/dns/lib/lang/de_dns_alias.lng
	interface/web/dns/lib/lang/de_dns_cname.lng
	interface/web/dns/lib/lang/de_dns_hinfo.lng
	interface/web/dns/lib/lang/de_dns_import.lng
	interface/web/dns/lib/lang/de_dns_mx.lng
	interface/web/dns/lib/lang/de_dns_ns.lng
	interface/web/dns/lib/lang/de_dns_ptr.lng
	interface/web/dns/lib/lang/de_dns_rp.lng
	interface/web/dns/lib/lang/de_dns_slave.lng
	interface/web/dns/lib/lang/de_dns_slave_list.lng
	interface/web/dns/lib/lang/de_dns_soa.lng
	interface/web/dns/lib/lang/de_dns_soa_list.lng
	interface/web/dns/lib/lang/de_dns_srv.lng
	interface/web/dns/lib/lang/de_dns_template.lng
	interface/web/dns/lib/lang/de_dns_template_list.lng
	interface/web/dns/lib/lang/de_dns_txt.lng
	interface/web/help/lib/lang/de.lng
	interface/web/help/lib/lang/de_faq_form.lng
	interface/web/help/lib/lang/de_faq_manage_questions_list.lng
	interface/web/help/lib/lang/de_faq_sections_form.lng
	interface/web/help/lib/lang/de_help_faq_list.lng
	interface/web/help/lib/lang/de_help_faq_sections_list.lng
	interface/web/help/lib/lang/de_support_message.lng
	interface/web/help/lib/lang/de_support_message_list.lng
	interface/web/login/lib/lang/de.lng
	interface/web/mail/lib/lang/de.lng
	interface/web/mail/lib/lang/de_mail_alias.lng
	interface/web/mail/lib/lang/de_mail_alias_list.lng
	interface/web/mail/lib/lang/de_mail_aliasdomain.lng
	interface/web/mail/lib/lang/de_mail_aliasdomain_list.lng
	interface/web/mail/lib/lang/de_mail_blacklist.lng
	interface/web/mail/lib/lang/de_mail_blacklist_list.lng
	interface/web/mail/lib/lang/de_mail_content_filter.lng
	interface/web/mail/lib/lang/de_mail_content_filter_list.lng
	interface/web/mail/lib/lang/de_mail_domain.lng
	interface/web/mail/lib/lang/de_mail_domain_admin_list.lng
	interface/web/mail/lib/lang/de_mail_domain_catchall.lng
	interface/web/mail/lib/lang/de_mail_domain_catchall_list.lng
	interface/web/mail/lib/lang/de_mail_domain_list.lng
	interface/web/mail/lib/lang/de_mail_forward.lng
	interface/web/mail/lib/lang/de_mail_forward_list.lng
	interface/web/mail/lib/lang/de_mail_get.lng
	interface/web/mail/lib/lang/de_mail_get_list.lng
	interface/web/mail/lib/lang/de_mail_mailinglist.lng
	interface/web/mail/lib/lang/de_mail_mailinglist_list.lng
	interface/web/mail/lib/lang/de_mail_relay_recipient.lng
	interface/web/mail/lib/lang/de_mail_relay_recipient_list.lng
	interface/web/mail/lib/lang/de_mail_spamfilter.lng
	interface/web/mail/lib/lang/de_mail_spamfilter_list.lng
	interface/web/mail/lib/lang/de_mail_transport.lng
	interface/web/mail/lib/lang/de_mail_transport_list.lng
	interface/web/mail/lib/lang/de_mail_user.lng
	interface/web/mail/lib/lang/de_mail_user_filter.lng
	interface/web/mail/lib/lang/de_mail_user_filter_list.lng
	interface/web/mail/lib/lang/de_mail_user_list.lng
	interface/web/mail/lib/lang/de_mail_user_stats_list.lng
	interface/web/mail/lib/lang/de_mail_whitelist.lng
	interface/web/mail/lib/lang/de_mail_whitelist_list.lng
	interface/web/mail/lib/lang/de_spamfilter_blacklist.lng
	interface/web/mail/lib/lang/de_spamfilter_blacklist_list.lng
	interface/web/mail/lib/lang/de_spamfilter_config.lng
	interface/web/mail/lib/lang/de_spamfilter_config_list.lng
	interface/web/mail/lib/lang/de_spamfilter_policy.lng
	interface/web/mail/lib/lang/de_spamfilter_policy_list.lng
	interface/web/mail/lib/lang/de_spamfilter_users.lng
	interface/web/mail/lib/lang/de_spamfilter_users_list.lng
	interface/web/mail/lib/lang/de_spamfilter_whitelist.lng
	interface/web/mail/lib/lang/de_spamfilter_whitelist_list.lng
	interface/web/mail/lib/lang/de_user_quota_stats_list.lng
	interface/web/mailuser/lib/lang/de.lng
	interface/web/mailuser/lib/lang/de_index.lng
	interface/web/mailuser/lib/lang/de_mail_user_autoresponder.lng
	interface/web/mailuser/lib/lang/de_mail_user_cc.lng
	interface/web/mailuser/lib/lang/de_mail_user_filter.lng
	interface/web/mailuser/lib/lang/de_mail_user_filter_list.lng
	interface/web/mailuser/lib/lang/de_mail_user_password.lng
	interface/web/mailuser/lib/lang/de_mail_user_spamfilter.lng
	interface/web/monitor/lib/lang/de.lng
	interface/web/monitor/lib/lang/de_datalog_list.lng
	interface/web/sites/aps_installedpackages_list.php
	interface/web/sites/lib/lang/de.lng
	interface/web/sites/lib/lang/de_aps.lng
	interface/web/sites/lib/lang/de_aps_instances_list.lng
	interface/web/sites/lib/lang/de_aps_packages_list.lng
	interface/web/sites/lib/lang/de_aps_update_packagelist.lng
	interface/web/sites/lib/lang/de_cron.lng
	interface/web/sites/lib/lang/de_cron_list.lng
	interface/web/sites/lib/lang/de_database.lng
	interface/web/sites/lib/lang/de_database_admin_list.lng
	interface/web/sites/lib/lang/de_database_list.lng
	interface/web/sites/lib/lang/de_database_user.lng
	interface/web/sites/lib/lang/de_database_user_admin_list.lng
	interface/web/sites/lib/lang/de_database_user_list.lng
	interface/web/sites/lib/lang/de_ftp_user.lng
	interface/web/sites/lib/lang/de_ftp_user_list.lng
	interface/web/sites/lib/lang/de_shell_user.lng
	interface/web/sites/lib/lang/de_shell_user_list.lng
	interface/web/sites/lib/lang/de_user_quota_stats_list.lng
	interface/web/sites/lib/lang/de_web_aliasdomain.lng
	interface/web/sites/lib/lang/de_web_aliasdomain_list.lng
	interface/web/sites/lib/lang/de_web_backup_list.lng
	interface/web/sites/lib/lang/de_web_domain.lng
	interface/web/sites/lib/lang/de_web_domain_admin_list.lng
	interface/web/sites/lib/lang/de_web_domain_list.lng
	interface/web/sites/lib/lang/de_web_folder.lng
	interface/web/sites/lib/lang/de_web_folder_list.lng
	interface/web/sites/lib/lang/de_web_folder_user.lng
	interface/web/sites/lib/lang/de_web_folder_user_list.lng
	interface/web/sites/lib/lang/de_web_sites_stats_list.lng
	interface/web/sites/lib/lang/de_web_subdomain.lng
	interface/web/sites/lib/lang/de_web_subdomain_list.lng
	interface/web/sites/lib/lang/de_web_vhost_subdomain.lng
	interface/web/sites/lib/lang/de_web_vhost_subdomain_list.lng
	interface/web/sites/lib/lang/de_webdav_user.lng
	interface/web/sites/lib/lang/de_webdav_user_list.lng
	interface/web/sites/templates/aps_install_package.htm
	interface/web/strengthmeter/lib/lang/de_strengthmeter.lng
	interface/web/themes/default/css/styles.css
	interface/web/tools/lib/lang/de.lng
	interface/web/tools/lib/lang/de_import_ispconfig.lng
	interface/web/tools/lib/lang/de_index.lng
	interface/web/tools/lib/lang/de_interface.lng
	interface/web/tools/lib/lang/de_resync.lng
	interface/web/tools/lib/lang/de_tpl_default.lng
	interface/web/tools/lib/lang/de_usersettings.lng
	interface/web/vm/lib/lang/de.lng
	interface/web/vm/lib/lang/de_openvz_action.lng
	interface/web/vm/lib/lang/de_openvz_ip.lng
	interface/web/vm/lib/lang/de_openvz_ip_list.lng
	interface/web/vm/lib/lang/de_openvz_ostemplate.lng
	interface/web/vm/lib/lang/de_openvz_ostemplate_list.lng
	interface/web/vm/lib/lang/de_openvz_template.lng
	interface/web/vm/lib/lang/de_openvz_template_list.lng
	interface/web/vm/lib/lang/de_openvz_vm.lng
	interface/web/vm/lib/lang/de_openvz_vm_list.lng
	server/cron_daily.php
	server/lib/classes/aps_installer.inc.php
	server/mods-available/rescue_core_module.inc.php
parents 78fc9a64 7d52e00a
......@@ -303,30 +303,32 @@ $inst->install_crontab();
//** Restart services:
swriteln('Restarting services ...');
if($conf['mysql']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mysql']['init_script'])) system($conf['init_scripts'].'/'.$conf['mysql']['init_script'].' reload');
if($conf['mysql']['installed'] == true && $conf['mysql']['init_script'] != '') system($inst->getinitcommand($conf['mysql']['init_script'], 'reload'));
if($conf['services']['mail']) {
if($conf['postfix']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['postfix']['init_script'])) system($conf['init_scripts'].'/'.$conf['postfix']['init_script'].' restart');
if($conf['saslauthd']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'])) system($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'].' restart');
if($conf['amavis']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['amavis']['init_script'])) system($conf['init_scripts'].'/'.$conf['amavis']['init_script'].' restart');
if($conf['clamav']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['clamav']['init_script'])) system($conf['init_scripts'].'/'.$conf['clamav']['init_script'].' restart');
if($conf['courier']['courier-authdaemon'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'].' restart');
if($conf['courier']['courier-imap'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-imap'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap'].' restart');
if($conf['courier']['courier-imap-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'].' restart');
if($conf['courier']['courier-pop'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop'].' restart');
if($conf['courier']['courier-pop-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'].' restart');
if($conf['dovecot']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['dovecot']['init_script'])) system($conf['init_scripts'].'/'.$conf['dovecot']['init_script'].' restart');
if($conf['mailman']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mailman']['init_script'])) system($conf['init_scripts'].'/'.$conf['mailman']['init_script'].' restart');
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'));
if($conf['clamav']['installed'] == true && $conf['clamav']['init_script'] != '') system($inst->getinitcommand($conf['clamav']['init_script'], 'restart'));
if($conf['courier']['installed'] == true){
if($conf['courier']['courier-authdaemon'] != '') system($inst->getinitcommand($conf['courier']['courier-authdaemon'], 'restart'));
if($conf['courier']['courier-imap'] != '') system($inst->getinitcommand($conf['courier']['courier-imap'], 'restart'));
if($conf['courier']['courier-imap-ssl'] != '') system($inst->getinitcommand($conf['courier']['courier-imap-ssl'], 'restart'));
if($conf['courier']['courier-pop'] != '') system($inst->getinitcommand($conf['courier']['courier-pop'], 'restart'));
if($conf['courier']['courier-pop-ssl'] != '') system($inst->getinitcommand($conf['courier']['courier-pop-ssl'], 'restart'));
}
if($conf['dovecot']['installed'] == true && $conf['dovecot']['init_script'] != '') system($inst->getinitcommand($conf['dovecot']['init_script'], 'restart'));
if($conf['mailman']['installed'] == true && $conf['mailman']['init_script'] != '') system($inst->getinitcommand($conf['mailman']['init_script'], 'restart'));
}
if($conf['services']['web']) {
if($conf['webserver']['server_type'] == 'apache' && $conf['apache']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['apache']['init_script'])) system($conf['init_scripts'].'/'.$conf['apache']['init_script'].' restart');
if($conf['webserver']['server_type'] == 'apache' && $conf['apache']['init_script'] != '') system($inst->getinitcommand($conf['apache']['init_script'], 'restart'));
//* Reload is enough for nginx
if($conf['webserver']['server_type'] == 'nginx' && $conf['nginx']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['nginx']['init_script'])) system($conf['init_scripts'].'/'.$conf['nginx']['init_script'].' reload');
if($conf['pureftpd']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'])) system($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'].' restart');
if($conf['webserver']['server_type'] == 'nginx' && $conf['nginx']['init_script'] != '') system($inst->getinitcommand($conf['nginx']['init_script'], 'reload'));
if($conf['pureftpd']['installed'] == true && $conf['pureftpd']['init_script'] != '') system($inst->getinitcommand($conf['pureftpd']['init_script'], 'restart'));
}
if($conf['services']['dns']) {
if($conf['mydns']['installed'] == true && $conf['mydns']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mydns']['init_script'])) system($conf['init_scripts'].'/'.$conf['mydns']['init_script'].' restart &> /dev/null');
if($conf['powerdns']['installed'] == true && $conf['powerdns']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['powerdns']['init_script'])) system($conf['init_scripts'].'/'.$conf['powerdns']['init_script'].' restart &> /dev/null');
if($conf['bind']['installed'] == true && $conf['bind']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['bind']['init_script'])) system($conf['init_scripts'].'/'.$conf['bind']['init_script'].' restart &> /dev/null');
if($conf['mydns']['installed'] == true && $conf['mydns']['init_script'] != '') system($inst->getinitcommand($conf['mydns']['init_script'], 'restart').' &> /dev/null');
if($conf['powerdns']['installed'] == true && $conf['powerdns']['init_script'] != '') system($inst->getinitcommand($conf['powerdns']['init_script'], 'restart').' &> /dev/null');
if($conf['bind']['installed'] == true && $conf['bind']['init_script'] != '') system($inst->getinitcommand($conf['bind']['init_script'], 'restart').' &> /dev/null');
}
echo "Update finished.\n";
......
......@@ -314,32 +314,33 @@ if($install_mode == 'standard') {
$inst->install_crontab();
swriteln('Restarting services ...');
if($conf['mysql']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mysql']['init_script'])) system($conf['init_scripts'].'/'.$conf['mysql']['init_script'].' restart');
if($conf['postfix']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['postfix']['init_script'])) system($conf['init_scripts'].'/'.$conf['postfix']['init_script'].' restart');
if($conf['saslauthd']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'])) system($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'].' restart');
if($conf['amavis']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['amavis']['init_script'])) system($conf['init_scripts'].'/'.$conf['amavis']['init_script'].' restart');
if($conf['clamav']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['clamav']['init_script'])) system($conf['init_scripts'].'/'.$conf['clamav']['init_script'].' restart');
if($conf['courier']['courier-authdaemon'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'].' restart');
if($conf['courier']['courier-imap'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-imap'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap'].' restart');
if($conf['courier']['courier-imap-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'].' restart');
if($conf['courier']['courier-pop'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop'].' restart');
if($conf['courier']['courier-pop-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'].' restart');
if($conf['dovecot']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['dovecot']['init_script'])) system($conf['init_scripts'].'/'.$conf['dovecot']['init_script'].' restart');
if($conf['mailman']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mailman']['init_script'])) system('nohup '.$conf['init_scripts'].'/'.$conf['mailman']['init_script'].' restart >/dev/null 2>&1 &');
if($conf['apache']['installed'] == true && $conf['apache']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['apache']['init_script'])) system($conf['init_scripts'].'/'.$conf['apache']['init_script'].' restart');
if($conf['mysql']['installed'] == true && $conf['mysql']['init_script'] != '') system($inst->getinitcommand($conf['mysql']['init_script'], 'restart'));
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'));
if($conf['clamav']['installed'] == true && $conf['clamav']['init_script'] != '') system($inst->getinitcommand($conf['clamav']['init_script'], 'restart'));
if($conf['courier']['installed'] == true){
if($conf['courier']['courier-authdaemon'] != '') system($inst->getinitcommand($conf['courier']['courier-authdaemon'], 'restart'));
if($conf['courier']['courier-imap'] != '') system($inst->getinitcommand($conf['courier']['courier-imap'], 'restart'));
if($conf['courier']['courier-imap-ssl'] != '') system($inst->getinitcommand($conf['courier']['courier-imap-ssl'], 'restart'));
if($conf['courier']['courier-pop'] != '') system($inst->getinitcommand($conf['courier']['courier-pop'], 'restart'));
if($conf['courier']['courier-pop-ssl'] != '') system($inst->getinitcommand($conf['courier']['courier-pop-ssl'], 'restart'));
}
if($conf['dovecot']['installed'] == true && $conf['dovecot']['init_script'] != '') system($inst->getinitcommand($conf['dovecot']['init_script'], 'restart'));
if($conf['mailman']['installed'] == true && $conf['mailman']['init_script'] != '') system('nohup '.$inst->getinitcommand($conf['mailman']['init_script'], 'restart').' >/dev/null 2>&1 &');
if($conf['apache']['installed'] == true && $conf['apache']['init_script'] != '') system($inst->getinitcommand($conf['apache']['init_script'], 'restart'));
//* Reload is enough for nginx
if($conf['nginx']['installed'] == true){
if($conf['nginx']['php_fpm_init_script'] != '' && @is_file($conf['init_scripts'].'/'.$conf['nginx']['php_fpm_init_script'])) system($conf['init_scripts'].'/'.$conf['nginx']['php_fpm_init_script'].' reload');
if($conf['nginx']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['nginx']['init_script'])) system($conf['init_scripts'].'/'.$conf['nginx']['init_script'].' reload');
if($conf['nginx']['php_fpm_init_script'] != '') system($inst->getinitcommand($conf['nginx']['php_fpm_init_script'], 'reload'));
if($conf['nginx']['init_script'] != '') system($inst->getinitcommand($conf['nginx']['init_script'], 'reload'));
}
if($conf['pureftpd']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'])) system($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'].' restart');
if($conf['mydns']['installed'] == true && $conf['mydns']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mydns']['init_script'])) system($conf['init_scripts'].'/'.$conf['mydns']['init_script'].' restart &> /dev/null');
if($conf['powerdns']['installed'] == true && $conf['powerdns']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['powerdns']['init_script'])) system($conf['init_scripts'].'/'.$conf['powerdns']['init_script'].' restart &> /dev/null');
if($conf['bind']['installed'] == true && $conf['bind']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['bind']['init_script'])) system($conf['init_scripts'].'/'.$conf['bind']['init_script'].' restart &> /dev/null');
if($conf['pureftpd']['installed'] == true && $conf['pureftpd']['init_script'] != '') system($inst->getinitcommand($conf['pureftpd']['init_script'], 'restart'));
if($conf['mydns']['installed'] == true && $conf['mydns']['init_script'] != '') system($inst->getinitcommand($conf['mydns']['init_script'], 'restart').' &> /dev/null');
if($conf['powerdns']['installed'] == true && $conf['powerdns']['init_script'] != '') system($inst->getinitcommand($conf['powerdns']['init_script'], 'restart').' &> /dev/null');
if($conf['bind']['installed'] == true && $conf['bind']['init_script'] != '') system($inst->getinitcommand($conf['bind']['init_script'], 'restart').' &> /dev/null');
//if($conf['squid']['installed'] == true && $conf['squid']['init_script'] != '' && is_file($conf['init_scripts'].'/'.$conf['squid']['init_script'])) system($conf['init_scripts'].'/'.$conf['squid']['init_script'].' restart &> /dev/null');
if($conf['nginx']['installed'] == true && $conf['nginx']['init_script'] != '' && is_file($conf['init_scripts'].'/'.$conf['nginx']['init_script'])) system($conf['init_scripts'].'/'.$conf['nginx']['init_script'].' restart &> /dev/null');
if($conf['ufw']['installed'] == true && $conf['ufw']['init_script'] != '' && is_file($conf['init_scripts'].'/'.$conf['ufw']['init_script'])) system($conf['init_scripts'].'/'.$conf['ufw']['init_script'].' restart &> /dev/null');
}else{
if($conf['nginx']['installed'] == true && $conf['nginx']['init_script'] != '') system($inst->getinitcommand($conf['nginx']['init_script'], 'restart').' &> /dev/null');
if($conf['ufw']['installed'] == true && $conf['ufw']['init_script'] != '') system($inst->getinitcommand($conf['ufw']['init_script'], 'restart').' &> /dev/null');
//* In expert mode, we select the services in the following steps, only db is always available
$conf['services']['mail'] = false;
......@@ -453,17 +454,19 @@ if($install_mode == 'standard') {
swriteln('Configuring Getmail');
$inst->configure_getmail();
if($conf['postfix']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['postfix']['init_script'])) system($conf['init_scripts'].'/'.$conf['postfix']['init_script'].' restart');
if($conf['saslauthd']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'])) system($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'].' restart');
if($conf['amavis']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['amavis']['init_script'])) system($conf['init_scripts'].'/'.$conf['amavis']['init_script'].' restart');
if($conf['clamav']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['clamav']['init_script'])) system($conf['init_scripts'].'/'.$conf['clamav']['init_script'].' restart');
if($conf['courier']['courier-authdaemon'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'].' restart');
if($conf['courier']['courier-imap'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-imap'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap'].' restart');
if($conf['courier']['courier-imap-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'].' restart');
if($conf['courier']['courier-pop'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop'].' restart');
if($conf['courier']['courier-pop-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'].' restart');
if($conf['dovecot']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['dovecot']['init_script'])) system($conf['init_scripts'].'/'.$conf['dovecot']['init_script'].' restart');
if($conf['mailman']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mailman']['init_script'])) system('nohup '.$conf['init_scripts'].'/'.$conf['mailman']['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'));
if($conf['clamav']['installed'] == true && $conf['clamav']['init_script'] != '') system($inst->getinitcommand($conf['clamav']['init_script'], 'restart'));
if($conf['courier']['installed'] == true){
if($conf['courier']['courier-authdaemon'] != '') system($inst->getinitcommand($conf['courier']['courier-authdaemon'], 'restart'));
if($conf['courier']['courier-imap'] != '') system($inst->getinitcommand($conf['courier']['courier-imap'], 'restart'));
if($conf['courier']['courier-imap-ssl'] != '') system($inst->getinitcommand($conf['courier']['courier-imap-ssl'], 'restart'));
if($conf['courier']['courier-pop'] != '') system($inst->getinitcommand($conf['courier']['courier-pop'], 'restart'));
if($conf['courier']['courier-pop-ssl'] != '') system($inst->getinitcommand($conf['courier']['courier-pop-ssl'], 'restart'));
}
if($conf['dovecot']['installed'] == true && $conf['dovecot']['init_script'] != '') system($inst->getinitcommand($conf['dovecot']['init_script'], 'restart'));
if($conf['mailman']['installed'] == true && $conf['mailman']['init_script'] != '') system('nohup '.$inst->getinitcommand($conf['mailman']['init_script'], 'restart').' >/dev/null 2>&1 &');
}
//** Configure Jailkit
......@@ -476,7 +479,7 @@ if($install_mode == 'standard') {
if(strtolower($inst->simple_query('Configure FTP Server', array('y','n'),'y') ) == 'y') {
swriteln('Configuring Pureftpd');
$inst->configure_pureftpd();
if($conf['pureftpd']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'])) system($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'].' restart');
if($conf['pureftpd']['installed'] == true && $conf['pureftpd']['init_script'] != '') system($inst->getinitcommand($conf['pureftpd']['init_script'], 'restart'));
}
//** Configure DNS
......@@ -486,15 +489,15 @@ if($install_mode == 'standard') {
if($conf['powerdns']['installed'] == true) {
swriteln('Configuring PowerDNS');
$inst->configure_powerdns();
if($conf['powerdns']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['powerdns']['init_script'])) system($conf['init_scripts'].'/'.$conf['powerdns']['init_script'].' restart &> /dev/null');
if($conf['powerdns']['init_script'] != '') system($inst->getinitcommand($conf['powerdns']['init_script'], 'restart').' &> /dev/null');
} elseif($conf['bind']['installed'] == true) {
swriteln('Configuring BIND');
$inst->configure_bind();
if($conf['bind']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['bind']['init_script'])) system($conf['init_scripts'].'/'.$conf['bind']['init_script'].' restart &> /dev/null');
if($conf['bind']['init_script'] != '') system($inst->getinitcommand($conf['bind']['init_script'], 'restart').' &> /dev/null');
} else {
swriteln('Configuring MyDNS');
$inst->configure_mydns();
if($conf['mydns']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mydns']['init_script'])) system($conf['init_scripts'].'/'.$conf['mydns']['init_script'].' restart &> /dev/null');
if($conf['mydns']['init_script'] != '') system($inst->getinitcommand($conf['mydns']['init_script'], 'restart').' &> /dev/null');
}
}
......@@ -617,11 +620,11 @@ if($install_mode == 'standard') {
//* Configure ISPConfig
swriteln('Installing ISPConfig crontab');
$inst->install_crontab();
if($conf['apache']['installed'] == true && $conf['apache']['init_script'] != '' && @is_file($conf['init_scripts'].'/'.$conf['apache']['init_script'])) system($conf['init_scripts'].'/'.$conf['apache']['init_script'].' restart');
if($conf['apache']['installed'] == true && $conf['apache']['init_script'] != '') system($inst->getinitcommand($conf['apache']['init_script'], 'restart'));
//* Reload is enough for nginx
if($conf['nginx']['installed'] == true){
if($conf['nginx']['php_fpm_init_script'] != '' && @is_file($conf['init_scripts'].'/'.$conf['nginx']['php_fpm_init_script'])) system($conf['init_scripts'].'/'.$conf['nginx']['php_fpm_init_script'].' reload');
if($conf['nginx']['init_script'] != '' && @is_file($conf['init_scripts'].'/'.$conf['nginx']['init_script'])) system($conf['init_scripts'].'/'.$conf['nginx']['init_script'].' reload');
if($conf['nginx']['php_fpm_init_script'] != '') system($inst->getinitcommand($conf['nginx']['php_fpm_init_script'], 'reload'));
if($conf['nginx']['init_script'] != '') system($inst->getinitcommand($conf['nginx']['init_script'], 'reload'));
}
......
......@@ -1131,7 +1131,8 @@ class installer_base {
if(is_file('/etc/inetd.conf')) {
replaceLine('/etc/inetd.conf','/usr/sbin/pure-ftpd-wrapper','#ftp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/pure-ftpd-wrapper',0,0);
if(is_file($conf['init_scripts'].'/'.'openbsd-inetd')) exec($conf['init_scripts'].'/'.'openbsd-inetd restart');
exec($this->getinitcommand('openbsd-inetd', 'restart'));
//if(is_file($conf['init_scripts'].'/'.'openbsd-inetd')) exec($conf['init_scripts'].'/'.'openbsd-inetd restart');
}
if(!is_file('/etc/pure-ftpd/conf/DontResolve')) exec('echo "yes" > /etc/pure-ftpd/conf/DontResolve');
......@@ -2164,6 +2165,23 @@ class installer_base {
chmod($conf['ispconfig_log_dir'].'/cron.log', 0660);
}
public function getinitcommand($servicename, $action, $init_script_directory = ''){
global $conf;
// systemd
if(is_executable('/bin/systemd')){
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;
}
// 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);
return $init_script_directory.'/'.$servicename.' '.$action;
}
/**
* Helper function - get the path to a template file based on
......
ALTER TABLE `client` CHANGE `company_id` `company_id` VARCHAR( 255 ) NULL DEFAULT NULL ;
\ No newline at end of file
......@@ -144,7 +144,7 @@ CREATE TABLE `client` (
`sys_perm_group` varchar(5) DEFAULT NULL,
`sys_perm_other` varchar(5) DEFAULT NULL,
`company_name` varchar(64) DEFAULT NULL,
`company_id` varchar(30) DEFAULT NULL,
`company_id` varchar(255) DEFAULT NULL,
`gender` enum('','m','f') NOT NULL DEFAULT '',
`contact_name` varchar(64) DEFAULT NULL,
`customer_no` varchar(64) DEFAULT NULL,
......
......@@ -369,7 +369,12 @@ if($reconfigure_services_answer == 'yes') {
//** Configure ISPConfig
swriteln('Updating ISPConfig');
if($conf['apache']['installed'] == true){
if(!is_file($conf['apache']['vhost_conf_dir'].'/ispconfig.vhost')) $inst->install_ispconfig_interface = false;
}
if($conf['nginx']['installed'] == true){
if(!is_file($conf['nginx']['vhost_conf_dir'].'/ispconfig.vhost')) $inst->install_ispconfig_interface = false;
}
if ($conf['services']['web'] && $inst->install_ispconfig_interface) {
//** Customise the port ISPConfig runs on
......@@ -399,38 +404,40 @@ if($update_crontab_answer == 'yes') {
//** Restart services:
if($reconfigure_services_answer == 'yes') {
swriteln('Restarting services ...');
if($conf['mysql']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mysql']['init_script'])) system($conf['init_scripts'].'/'.$conf['mysql']['init_script'].' restart');
if($conf['mysql']['installed'] == true && $conf['mysql']['init_script'] != '') system($inst->getinitcommand($conf['mysql']['init_script'], 'restart'));
if($conf['services']['mail']) {
if($conf['postfix']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['postfix']['init_script'])) system($conf['init_scripts'].'/'.$conf['postfix']['init_script'].' restart');
if($conf['saslauthd']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'])) system($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'].' restart');
if($conf['amavis']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['amavis']['init_script'])) system($conf['init_scripts'].'/'.$conf['amavis']['init_script'].' restart');
if($conf['clamav']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['clamav']['init_script'])) system($conf['init_scripts'].'/'.$conf['clamav']['init_script'].' restart');
if($conf['courier']['courier-authdaemon'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'].' restart');
if($conf['courier']['courier-imap'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-imap'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap'].' restart');
if($conf['courier']['courier-imap-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'].' restart');
if($conf['courier']['courier-pop'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop'].' restart');
if($conf['courier']['courier-pop-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'].' restart');
if($conf['dovecot']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['dovecot']['init_script'])) system($conf['init_scripts'].'/'.$conf['dovecot']['init_script'].' restart');
if($conf['mailman']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mailman']['init_script'])) system('nohup '.$conf['init_scripts'].'/'.$conf['mailman']['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'));
if($conf['clamav']['installed'] == true && $conf['clamav']['init_script'] != '') system($inst->getinitcommand($conf['clamav']['init_script'], 'restart'));
if($conf['courier']['installed'] == true){
if($conf['courier']['courier-authdaemon'] != '') system($inst->getinitcommand($conf['courier']['courier-authdaemon'], 'restart'));
if($conf['courier']['courier-imap'] != '') system($inst->getinitcommand($conf['courier']['courier-imap'], 'restart'));
if($conf['courier']['courier-imap-ssl'] != '') system($inst->getinitcommand($conf['courier']['courier-imap-ssl'], 'restart'));
if($conf['courier']['courier-pop'] != '') system($inst->getinitcommand($conf['courier']['courier-pop'], 'restart'));
if($conf['courier']['courier-pop-ssl'] != '') system($inst->getinitcommand($conf['courier']['courier-pop-ssl'], 'restart'));
}
if($conf['dovecot']['installed'] == true && $conf['dovecot']['init_script'] != '') system($inst->getinitcommand($conf['dovecot']['init_script'], 'restart'));
if($conf['mailman']['installed'] == true && $conf['mailman']['init_script'] != '') system('nohup '.$inst->getinitcommand($conf['mailman']['init_script'], 'restart').' >/dev/null 2>&1 &');
}
if($conf['services']['web']) {
if($conf['webserver']['server_type'] == 'apache' && $conf['apache']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['apache']['init_script'])) system($conf['init_scripts'].'/'.$conf['apache']['init_script'].' restart');
if($conf['webserver']['server_type'] == 'apache' && $conf['apache']['init_script'] != '') system($inst->getinitcommand($conf['apache']['init_script'], 'restart'));
//* Reload is enough for nginx
if($conf['webserver']['server_type'] == 'nginx'){
if($conf['nginx']['php_fpm_init_script'] != '' && @is_file($conf['init_scripts'].'/'.$conf['nginx']['php_fpm_init_script'])) system($conf['init_scripts'].'/'.$conf['nginx']['php_fpm_init_script'].' reload');
if($conf['nginx']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['nginx']['init_script'])) system($conf['init_scripts'].'/'.$conf['nginx']['init_script'].' reload');
if($conf['nginx']['php_fpm_init_script'] != '') system($inst->getinitcommand($conf['nginx']['php_fpm_init_script'], 'reload'));
if($conf['nginx']['init_script'] != '') system($inst->getinitcommand($conf['nginx']['init_script'], 'reload'));
}
if($conf['pureftpd']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'])) system($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'].' restart');
if($conf['pureftpd']['installed'] == true && $conf['pureftpd']['init_script'] != '') system($inst->getinitcommand($conf['pureftpd']['init_script'], 'restart'));
}
if($conf['services']['dns']) {
if($conf['mydns']['installed'] == true && $conf['mydns']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mydns']['init_script'])) system($conf['init_scripts'].'/'.$conf['mydns']['init_script'].' restart &> /dev/null');
if($conf['powerdns']['installed'] == true && $conf['powerdns']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['powerdns']['init_script'])) system($conf['init_scripts'].'/'.$conf['powerdns']['init_script'].' restart &> /dev/null');
if($conf['bind']['installed'] == true && $conf['bind']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['bind']['init_script'])) system($conf['init_scripts'].'/'.$conf['bind']['init_script'].' restart &> /dev/null');
if($conf['mydns']['installed'] == true && $conf['mydns']['init_script'] != '') system($inst->getinitcommand($conf['mydns']['init_script'], 'restart').' &> /dev/null');
if($conf['powerdns']['installed'] == true && $conf['powerdns']['init_script'] != '') system($inst->getinitcommand($conf['powerdns']['init_script'], 'restart').' &> /dev/null');
if($conf['bind']['installed'] == true && $conf['bind']['init_script'] != '') system($inst->getinitcommand($conf['bind']['init_script'], 'restart').' &> /dev/null');
}
if($conf['services']['proxy']) {
// if($conf['squid']['installed'] == true && $conf['squid']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['squid']['init_script'])) system($conf['init_scripts'].'/'.$conf['squid']['init_script'].' restart &> /dev/null');
if($conf['nginx']['installed'] == true && $conf['nginx']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['nginx']['init_script'])) system($conf['init_scripts'].'/'.$conf['nginx']['init_script'].' restart &> /dev/null');
if($conf['nginx']['installed'] == true && $conf['nginx']['init_script'] != '') system($inst->getinitcommand($conf['nginx']['init_script'], 'restart').' &> /dev/null');
}
if($conf['services']['firewall']) {
......
......@@ -728,9 +728,8 @@ class ApsGUIController extends ApsBase
// Using parse_url() to filter malformed URLs
$path = dirname(parse_url($_SERVER['PHP_SELF'], PHP_URL_PATH)).'/'.
basename($this->interface_pkg_dir).'/'.$pkg['path'].'/'.basename((string)$icon);
// nginx: if $_SERVER['PHP_SELF'] is doubled, remove /sites/aps_packagedetails_show.php from beginning of path
$path = preg_replace('@^/sites/aps_packagedetails_show.php(.*)@', '$1', $path);
// nginx: if $_SERVER['PHP_SELF'] is doubled, remove /sites/aps_packagedetails_show.php from beginning of path
$path = preg_replace('@^/sites/aps_packagedetails_show.php(.*)@', '$1', $path);
$pkg['Icon'] = $path;
}
else $pkg['Icon'] = '';
......@@ -744,8 +743,8 @@ class ApsGUIController extends ApsBase
// Using parse_url() to filter malformed URLs
$path = dirname(parse_url($_SERVER['PHP_SELF'], PHP_URL_PATH)).'/'.
basename($this->interface_pkg_dir).'/'.$pkg['path'].'/'.basename((string)$screen['path']);
// nginx: if $_SERVER['PHP_SELF'] is doubled, remove /sites/aps_packagedetails_show.php from beginning of path
$path = preg_replace('@^/sites/aps_packagedetails_show.php(.*)@', '$1', $path);
// nginx: if $_SERVER['PHP_SELF'] is doubled, remove /sites/aps_packagedetails_show.php from beginning of path
$path = preg_replace('@^/sites/aps_packagedetails_show.php(.*)@', '$1', $path);
$pkg['Screenshots'][] = array('ScreenPath' => $path,
'ScreenDescription' => htmlspecialchars(trim((string)$screen->description)));
......
......@@ -63,6 +63,28 @@ class custom_datasource {
return $records_new;
}
function slave_dns_servers($field, $record) {
global $app, $conf;
if($_SESSION["s"]["user"]["typ"] == 'user') {
// Get the limits of the client
$client_group_id = $_SESSION["s"]["user"]["default_group"];
$client = $app->db->queryOneRecord("SELECT default_slave_dnsserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
$sql = "SELECT server_id,server_name FROM server WHERE server_id = ".$client['default_slave_dnsserver'];
} else {
$sql = "SELECT server_id,server_name FROM server WHERE dns_server = 1 ORDER BY server_name";
}
$records = $app->db->queryAllRecords($sql);
$records_new = array();
if(is_array($records)) {
foreach($records as $rec) {
$key = $rec['server_id'];
$records_new[$key] = $rec['server_name'];
}
}
return $records_new;
}
function webdav_domains($field, $record) {
global $app, $conf;
......@@ -77,13 +99,13 @@ class custom_datasource {
}
if(count($server_ids) == 0) return array();
$server_ids = implode(',', $server_ids);
$records = $app->db->queryAllRecords("SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND server_id IN (".$server_ids.") AND ".$app->tform->getAuthSQL('r')." ORDER BY domain");
$records = $app->db->queryAllRecords("SELECT web_domain.domain_id, CONCAT(web_domain.domain, ' :: ', server.server_name) AS parent_domain FROM web_domain, server WHERE web_domain.type = 'vhost' AND web_domain.server_id IN (".$server_ids.") AND web_domain.server_id = server.server_id AND ".$app->tform->getAuthSQL('r', 'web_domain')." ORDER BY web_domain.domain");
$records_new = array();
if(is_array($records)) {
foreach($records as $rec) {
$key = $rec['domain_id'];
$records_new[$key] = $rec['domain'];
$records_new[$key] = $rec['parent_domain'];
}
}
return $records_new;
......
......@@ -83,6 +83,20 @@ class functions {
return number_format((double)$number, $number_format_decimals, $number_format_dec_point, $number_format_thousands_sep);
}
//* convert currency formatted number back to floating number
public function currency_unformat($number) {
global $app;
$number_format_dec_point = $app->lng('number_format_dec_point');
$number_format_thousands_sep = $app->lng('number_format_thousands_sep');
if($number_format_thousands_sep == 'number_format_thousands_sep') $number_format_thousands_sep = '';
if($number_format_thousands_sep != '') $number = str_replace($number_format_thousands_sep, '', $number);
if($number_format_dec_point != '.' && $number_format_dec_point != '') $number = str_replace($number_format_dec_point, '.', $number);
return (double)$number;
}
public function get_ispconfig_url() {
global $app;
......@@ -177,12 +191,24 @@ class functions {
// IPv6
$regex = "/^(\:\:([a-f0-9]{1,4}\:){0,6}?[a-f0-9]{0,4}|[a-f0-9]{1,4}(\:[a-f0-9]{1,4}){0,6}?\:\:|[a-f0-9]{1,4}(\:[a-f0-9]{1,4}){1,6}?\:\:([a-f0-9]{1,4}\:){1,6}?[a-f0-9]{1,4})(\/\d{1,3})?$/i";
}
$server_by_id = array();
$server_by_ip = array();
$servers = $app->db->queryAllRecords("SELECT * FROM server");
if(is_array($servers) && !empty($servers)){
foreach($servers as $server){
$server_by_id[$server['server_id']] = $server['server_name'];
}
}
$ips = array();
$results = $app->db->queryAllRecords("SELECT ip_address AS ip FROM server_ip WHERE ip_type = '".$type."'");
$results = $app->db->queryAllRecords("SELECT ip_address AS ip, server_id FROM server_ip WHERE ip_type = '".$type."'");
if(!empty($results) && is_array($results)){
foreach($results as $result){
if(preg_match($regex, $result['ip'])) $ips[] = $result['ip'];
if(preg_match($regex, $result['ip'])){
$ips[] = $result['ip'];
$server_by_ip[$result['ip']] = $server_by_id[$result['server_id']];
}
}
}
$results = $app->db->queryAllRecords("SELECT ip_address AS ip FROM openvz_ip");
......@@ -257,7 +283,7 @@ class functions {
foreach($ips as $ip){
$result_array['cdata'][] = array( 'title' => $ip,
'description' => $type,
'description' => $type.($server_by_ip[$ip] != ''? ' > '.$server_by_ip[$ip] : ''),
'onclick' => '',
'fill_text' => $ip
);
......
......@@ -181,15 +181,68 @@ class listform {
foreach($this->listDef['item'] as $i) {
$field = $i['field'];
$table = $i['table'];
$searchval = $_SESSION['search'][$list_name][$search_prefix.$field];
// format user date format to MySQL date format 0000-00-00
if($i['datatype'] == 'DATE' && $this->lng('conf_format_dateshort') != 'Y-m-d'){
$dateformat = preg_replace("@[^Ymd]@", "", $this->lng('conf_format_dateshort'));
$yearpos = strpos($dateformat, 'Y') + 1;
$monthpos = strpos($dateformat, 'm') + 1;
$daypos = strpos($dateformat, 'd') + 1;
$full_date_trans = array ('Y' => '((?:19|20)\d\d)',
'm' => '(0[1-9]|1[012])',
'd' => '(0[1-9]|[12][0-9]|3[01])'
);
// d.m.Y Y/m/d
$full_date_regex = strtr(preg_replace("@[^Ymd]@", "[^0-9]", $this->lng('conf_format_dateshort')), $full_date_trans);
//echo $full_date_regex;
if (preg_match("@^\d+$@", $_SESSION['search'][$list_name][$search_prefix.$field])) { // we just have digits