From 181529089411d6f55333b22d169e87d3f5137eb5 Mon Sep 17 00:00:00 2001 From: latham Date: Thu, 30 Jun 2011 16:03:31 +0000 Subject: [PATCH] Remove Microsoft Line endings. Some files have mixed line endings that make Subverison unhappy http://lathama.net/Recursively_deleting_Microsoft_end_of_line_characters --- install/setrights.php | 270 ++--- install/sql/incremental/upd_0009.sql | 132 +-- install/tpl/nginx_cache.conf.master | 12 +- install/tpl/nginx_proxy.conf.master | 68 +- install/tpl/squid.conf.master | 448 ++++---- install/tpl/ufw.conf.master | 16 +- interface/lib/lang/fr.lng | 84 +- interface/web/admin/lib/lang/fr.lng | 88 +- interface/web/admin/lib/lang/fr_firewall.lng | 24 +- .../web/admin/lib/lang/fr_firewall_list.lng | 18 +- interface/web/admin/lib/lang/fr_groups.lng | 12 +- .../web/admin/lib/lang/fr_groups_list.lng | 16 +- .../web/admin/lib/lang/fr_language_add.lng | 18 +- .../admin/lib/lang/fr_language_complete.lng | 16 +- .../web/admin/lib/lang/fr_language_edit.lng | 18 +- .../web/admin/lib/lang/fr_language_export.lng | 14 +- .../web/admin/lib/lang/fr_language_import.lng | 18 +- .../web/admin/lib/lang/fr_language_list.lng | 16 +- .../web/admin/lib/lang/fr_package_install.lng | 16 +- .../web/admin/lib/lang/fr_remote_action.lng | 22 +- .../web/admin/lib/lang/fr_remote_user.lng | 86 +- .../admin/lib/lang/fr_remote_user_list.lng | 16 +- interface/web/admin/lib/lang/fr_server.lng | 28 +- .../web/admin/lib/lang/fr_server_config.lng | 156 +-- .../admin/lib/lang/fr_server_config_list.lng | 10 +- interface/web/admin/lib/lang/fr_server_ip.lng | 16 +- .../web/admin/lib/lang/fr_server_ip_list.lng | 14 +- .../web/admin/lib/lang/fr_server_list.lng | 24 +- .../lib/lang/fr_software_package_install.lng | 14 +- .../lib/lang/fr_software_package_list.lng | 22 +- .../web/admin/lib/lang/fr_software_repo.lng | 16 +- .../admin/lib/lang/fr_software_repo_list.lng | 14 +- .../lib/lang/fr_software_update_list.lng | 18 +- .../web/admin/lib/lang/fr_system_config.lng | 48 +- interface/web/admin/lib/lang/fr_users.lng | 58 +- .../web/admin/lib/lang/fr_users_list.lng | 20 +- interface/web/client/lib/lang/fr.lng | 28 +- interface/web/client/lib/lang/fr_client.lng | 204 ++-- .../web/client/lib/lang/fr_client_del.lng | 14 +- .../client/lib/lang/fr_client_template.lng | 128 +-- .../lib/lang/fr_client_template_list.lng | 12 +- .../web/client/lib/lang/fr_clients_list.lng | 20 +- interface/web/client/lib/lang/fr_reseller.lng | 206 ++-- .../web/client/lib/lang/fr_resellers_list.lng | 20 +- interface/web/dashboard/lib/lang/fr.lng | 10 +- .../dashboard/lib/lang/fr_dashlet_limits.lng | 60 +- .../dashboard/lib/lang/fr_dashlet_modules.lng | 8 +- interface/web/designer/lib/lang/fr.lng | 6 +- .../web/designer/lib/lang/fr_form_edit.lng | 50 +- .../web/designer/lib/lang/fr_form_list.lng | 16 +- .../web/designer/lib/lang/fr_form_show.lng | 38 +- .../web/designer/lib/lang/fr_module_edit.lng | 26 +- .../web/designer/lib/lang/fr_module_list.lng | 12 +- .../designer/lib/lang/fr_module_nav_edit.lng | 14 +- .../lib/lang/fr_module_nav_item_edit.lng | 18 +- .../web/designer/lib/lang/fr_module_show.lng | 34 +- interface/web/dns/lib/lang/fr.lng | 42 +- interface/web/dns/lib/lang/fr_dns_a.lng | 34 +- interface/web/dns/lib/lang/fr_dns_a_list.lng | 30 +- interface/web/dns/lib/lang/fr_dns_aaaa.lng | 32 +- interface/web/dns/lib/lang/fr_dns_alias.lng | 32 +- interface/web/dns/lib/lang/fr_dns_cname.lng | 34 +- interface/web/dns/lib/lang/fr_dns_hinfo.lng | 32 +- interface/web/dns/lib/lang/fr_dns_mx.lng | 34 +- interface/web/dns/lib/lang/fr_dns_ns.lng | 32 +- interface/web/dns/lib/lang/fr_dns_ptr.lng | 32 +- interface/web/dns/lib/lang/fr_dns_rp.lng | 32 +- interface/web/dns/lib/lang/fr_dns_slave.lng | 30 +- .../web/dns/lib/lang/fr_dns_slave_list.lng | 18 +- interface/web/dns/lib/lang/fr_dns_soa.lng | 54 +- .../web/dns/lib/lang/fr_dns_soa_list.lng | 22 +- interface/web/dns/lib/lang/fr_dns_srv.lng | 36 +- .../web/dns/lib/lang/fr_dns_template.lng | 14 +- .../web/dns/lib/lang/fr_dns_template_list.lng | 14 +- interface/web/dns/lib/lang/fr_dns_txt.lng | 32 +- interface/web/dns/lib/lang/fr_dns_wizard.lng | 60 +- interface/web/domain/lib/lang/fr.lng | 20 +- interface/web/domain/lib/lang/fr_domain.lng | 14 +- .../web/domain/lib/lang/fr_domain_list.lng | 12 +- interface/web/help/lib/lang/fr.lng | 20 +- .../web/help/lib/lang/fr_support_message.lng | 16 +- .../help/lib/lang/fr_support_message_list.lng | 14 +- interface/web/mail/lib/lang/fr.lng | 96 +- interface/web/mail/lib/lang/fr_mail_alias.lng | 24 +- .../web/mail/lib/lang/fr_mail_alias_list.lng | 18 +- .../web/mail/lib/lang/fr_mail_aliasdomain.lng | 24 +- .../lib/lang/fr_mail_aliasdomain_list.lng | 16 +- .../web/mail/lib/lang/fr_mail_blacklist.lng | 20 +- .../mail/lib/lang/fr_mail_blacklist_list.lng | 22 +- .../mail/lib/lang/fr_mail_content_filter.lng | 20 +- .../lib/lang/fr_mail_content_filter_list.lng | 18 +- .../web/mail/lib/lang/fr_mail_domain.lng | 28 +- .../lib/lang/fr_mail_domain_admin_list.lng | 18 +- .../mail/lib/lang/fr_mail_domain_catchall.lng | 20 +- .../lib/lang/fr_mail_domain_catchall_list.lng | 20 +- .../web/mail/lib/lang/fr_mail_domain_list.lng | 16 +- .../web/mail/lib/lang/fr_mail_forward.lng | 16 +- .../mail/lib/lang/fr_mail_forward_list.lng | 18 +- interface/web/mail/lib/lang/fr_mail_get.lng | 34 +- .../web/mail/lib/lang/fr_mail_get_list.lng | 20 +- .../mail/lib/lang/fr_mail_relay_recipient.lng | 20 +- .../lib/lang/fr_mail_relay_recipient_list.lng | 20 +- .../web/mail/lib/lang/fr_mail_spamfilter.lng | 36 +- .../mail/lib/lang/fr_mail_spamfilter_list.lng | 18 +- .../web/mail/lib/lang/fr_mail_transport.lng | 22 +- .../mail/lib/lang/fr_mail_transport_list.lng | 20 +- interface/web/mail/lib/lang/fr_mail_user.lng | 86 +- .../web/mail/lib/lang/fr_mail_user_filter.lng | 24 +- .../lib/lang/fr_mail_user_filter_list.lng | 16 +- .../web/mail/lib/lang/fr_mail_user_list.lng | 16 +- .../mail/lib/lang/fr_mail_user_stats_list.lng | 18 +- .../web/mail/lib/lang/fr_mail_whitelist.lng | 20 +- .../mail/lib/lang/fr_mail_whitelist_list.lng | 22 +- .../mail/lib/lang/fr_spamfilter_blacklist.lng | 20 +- .../lib/lang/fr_spamfilter_blacklist_list.lng | 20 +- .../mail/lib/lang/fr_spamfilter_config.lng | 42 +- .../lib/lang/fr_spamfilter_config_list.lng | 12 +- .../mail/lib/lang/fr_spamfilter_policy.lng | 78 +- .../lib/lang/fr_spamfilter_policy_list.lng | 20 +- .../web/mail/lib/lang/fr_spamfilter_users.lng | 18 +- .../lib/lang/fr_spamfilter_users_list.lng | 22 +- .../mail/lib/lang/fr_spamfilter_whitelist.lng | 20 +- .../lib/lang/fr_spamfilter_whitelist_list.lng | 20 +- interface/web/monitor/lib/lang/fr.lng | 292 ++--- .../web/monitor/lib/lang/fr_datalog_list.lng | 18 +- .../web/monitor/lib/lang/fr_syslog_list.lng | 16 +- interface/web/remote/monitor.php | 250 ++-- interface/web/sites/lib/lang/fr.lng | 52 +- interface/web/sites/lib/lang/fr_cron.lng | 44 +- interface/web/sites/lib/lang/fr_cron_list.lng | 26 +- interface/web/sites/lib/lang/fr_database.lng | 52 +- .../sites/lib/lang/fr_database_admin_list.lng | 22 +- .../web/sites/lib/lang/fr_database_list.lng | 20 +- interface/web/sites/lib/lang/fr_ftp_user.lng | 58 +- .../web/sites/lib/lang/fr_ftp_user_list.lng | 18 +- .../web/sites/lib/lang/fr_shell_user.lng | 46 +- .../web/sites/lib/lang/fr_shell_user_list.lng | 18 +- .../lib/lang/fr_user_quota_stats_list.lng | 18 +- .../lib/lang/fr_web_aliasdomain_list.lng | 24 +- .../web/sites/lib/lang/fr_web_domain.lng | 142 +-- .../lib/lang/fr_web_domain_admin_list.lng | 20 +- .../web/sites/lib/lang/fr_web_domain_list.lng | 18 +- .../lib/lang/fr_web_sites_stats_list.lng | 18 +- .../web/sites/lib/lang/fr_web_subdomain.lng | 82 +- .../sites/lib/lang/fr_web_subdomain_list.lng | 18 +- .../web/sites/lib/lang/fr_webdav_user.lng | 32 +- .../sites/lib/lang/fr_webdav_user_list.lng | 18 +- .../lib/lang/fr_strengthmeter.lng | 18 +- interface/web/tools/lib/lang/fr.lng | 14 +- .../web/tools/lib/lang/fr_usersettings.lng | 18 +- server/conf/nginx_rewrites.conf.master | 18 +- server/conf/nginx_vhost.conf.master | 138 +-- server/conf/squidRewriteRules.py.master | 392 +++---- server/conf/ufw.before.rules.master | 156 +-- server/conf/ufw.conf.master | 16 +- server/conf/ufw.default.master | 78 +- .../remoteaction_core_module.inc.php | 412 +++---- server/plugins-available/nginx_plugin.inc.php | 736 ++++++------ server/plugins-available/squid_plugin.inc.php | 342 +++--- .../ufw_firewall_plugin.inc.php | 1008 ++++++++--------- 160 files changed, 4639 insertions(+), 4639 deletions(-) diff --git a/install/setrights.php b/install/setrights.php index 89e2077a3..1124136ba 100644 --- a/install/setrights.php +++ b/install/setrights.php @@ -1,135 +1,135 @@ ->This script tries to repair the client rights \n\n"; - -//** Include the library with the basic installer functions -require_once('lib/install.lib.php'); - -//** Include the library with the basic updater functions -require_once('lib/update.lib.php'); - -//** Include the base class of the installer class -require_once('lib/installer_base.lib.php'); - -//** Ensure that current working directory is install directory -$cur_dir = getcwd(); -if(realpath(dirname(__FILE__)) != $cur_dir) die("Please run installation/update from _inside_ the install directory!\n"); - -//** Get distribution identifier -$dist = get_distname(); - -include_once("/usr/local/ispconfig/server/lib/config.inc.php"); -$conf_old = $conf; -unset($conf); - -if($dist['id'] == '') die('Linux distribution or version not recognized.'); - -//** Include the distribution-specific installer class library and configuration -if(is_file('dist/lib/'.$dist['baseid'].'.lib.php')) include_once('dist/lib/'.$dist['baseid'].'.lib.php'); -include_once('dist/lib/'.$dist['id'].'.lib.php'); -include_once('dist/conf/'.$dist['id'].'.conf.php'); - -//** Get hostname -exec('hostname -f', $tmp_out); -$conf['hostname'] = $tmp_out[0]; -unset($tmp_out); - -//* Check if this is a master / slave setup -$conf['mysql']['master_slave_setup'] = 'n'; -if($conf["mysql"]["master_host"] != '' && $conf["mysql"]["host"] != $conf["mysql"]["master_host"]) { - $conf['mysql']['master_slave_setup'] = 'y'; -} - -/* - * Try to read the DB-admin settings - */ -$clientdb_host = ''; -$clientdb_user = ''; -$clientdb_password = ''; -include_once("/usr/local/ispconfig/server/lib/mysql_clientdb.conf"); -$conf["mysql"]["admin_user"] = $clientdb_user; -$conf["mysql"]["admin_password"] = $clientdb_password; -$clientdb_host = ''; -$clientdb_user = ''; -$clientdb_password = ''; - -//** There is a error if user for mysql admin_password if empty -if( empty($conf["mysql"]["admin_password"]) ) { - die("internal error - MYSQL-Root passord not known"); -} - -$inst = new installer(); - -//** Initialize the MySQL server connection -include_once('lib/mysql.lib.php'); - -//* initialize the database -$inst->db = new db(); - -/* - * The next line is a bit tricky! - * At the automated update we have no connection to the master-db (we don't need it, because - * there are only TWO points, where this is needed) - * 1) update the rights --> the autoupdater sets the rights of all clients when the server is - * autoupdated) - * 2) update the server-settings (is web installed, is mail installed) --> the autoupdates - * doesn't change any of this settings, so there ist no need to update this. - * This means, the autoupdater did not need any connection to the master-db (only to the local bd - * of the master-server). To avoid any problems, we set the master-db to the local one. - */ -$inst->dbmaster = $inst->db; - -/* - * If it is NOT a master-slave - Setup then we are at the Master-DB. So set all rights -*/ -if($conf['mysql']['master_slave_setup'] != 'y') { - $inst->grant_master_database_rights(true); -} - -echo "finished.\n"; - -?> +>This script tries to repair the client rights \n\n"; + +//** Include the library with the basic installer functions +require_once('lib/install.lib.php'); + +//** Include the library with the basic updater functions +require_once('lib/update.lib.php'); + +//** Include the base class of the installer class +require_once('lib/installer_base.lib.php'); + +//** Ensure that current working directory is install directory +$cur_dir = getcwd(); +if(realpath(dirname(__FILE__)) != $cur_dir) die("Please run installation/update from _inside_ the install directory!\n"); + +//** Get distribution identifier +$dist = get_distname(); + +include_once("/usr/local/ispconfig/server/lib/config.inc.php"); +$conf_old = $conf; +unset($conf); + +if($dist['id'] == '') die('Linux distribution or version not recognized.'); + +//** Include the distribution-specific installer class library and configuration +if(is_file('dist/lib/'.$dist['baseid'].'.lib.php')) include_once('dist/lib/'.$dist['baseid'].'.lib.php'); +include_once('dist/lib/'.$dist['id'].'.lib.php'); +include_once('dist/conf/'.$dist['id'].'.conf.php'); + +//** Get hostname +exec('hostname -f', $tmp_out); +$conf['hostname'] = $tmp_out[0]; +unset($tmp_out); + +//* Check if this is a master / slave setup +$conf['mysql']['master_slave_setup'] = 'n'; +if($conf["mysql"]["master_host"] != '' && $conf["mysql"]["host"] != $conf["mysql"]["master_host"]) { + $conf['mysql']['master_slave_setup'] = 'y'; +} + +/* + * Try to read the DB-admin settings + */ +$clientdb_host = ''; +$clientdb_user = ''; +$clientdb_password = ''; +include_once("/usr/local/ispconfig/server/lib/mysql_clientdb.conf"); +$conf["mysql"]["admin_user"] = $clientdb_user; +$conf["mysql"]["admin_password"] = $clientdb_password; +$clientdb_host = ''; +$clientdb_user = ''; +$clientdb_password = ''; + +//** There is a error if user for mysql admin_password if empty +if( empty($conf["mysql"]["admin_password"]) ) { + die("internal error - MYSQL-Root passord not known"); +} + +$inst = new installer(); + +//** Initialize the MySQL server connection +include_once('lib/mysql.lib.php'); + +//* initialize the database +$inst->db = new db(); + +/* + * The next line is a bit tricky! + * At the automated update we have no connection to the master-db (we don't need it, because + * there are only TWO points, where this is needed) + * 1) update the rights --> the autoupdater sets the rights of all clients when the server is + * autoupdated) + * 2) update the server-settings (is web installed, is mail installed) --> the autoupdates + * doesn't change any of this settings, so there ist no need to update this. + * This means, the autoupdater did not need any connection to the master-db (only to the local bd + * of the master-server). To avoid any problems, we set the master-db to the local one. + */ +$inst->dbmaster = $inst->db; + +/* + * If it is NOT a master-slave - Setup then we are at the Master-DB. So set all rights +*/ +if($conf['mysql']['master_slave_setup'] != 'y') { + $inst->grant_master_database_rights(true); +} + +echo "finished.\n"; + +?> diff --git a/install/sql/incremental/upd_0009.sql b/install/sql/incremental/upd_0009.sql index 9da60c134..ba20b6baf 100644 --- a/install/sql/incremental/upd_0009.sql +++ b/install/sql/incremental/upd_0009.sql @@ -1,66 +1,66 @@ -CREATE TABLE IF NOT EXISTS `proxy_reverse` ( - `rewrite_id` int(11) NOT NULL auto_increment, - `sys_userid` int(11) unsigned NOT NULL default '0', - `sys_groupid` int(11) unsigned NOT NULL default '0', - `sys_perm_user` varchar(5) default NULL, - `sys_perm_group` varchar(5) default NULL, - `sys_perm_other` varchar(5) default NULL, - `server_id` int(11) unsigned NOT NULL default '0', - `rewrite_url_src` varchar(100) NOT NULL, - `rewrite_url_dst` varchar(100) NOT NULL, - `active` enum('n','y') NOT NULL default 'y', - PRIMARY KEY (`rewrite_id`) -) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; - - -CREATE TABLE IF NOT EXISTS `firewall_filter` ( - `firewall_id` int(11) unsigned NOT NULL auto_increment, - `sys_userid` int(11) unsigned NOT NULL default '0', - `domain_id` int(11) NOT NULL, - `sys_groupid` int(11) unsigned NOT NULL default '0', - `sys_perm_user` varchar(5) default NULL, - `sys_perm_group` varchar(5) default NULL, - `sys_perm_other` varchar(5) default NULL, - `server_id` int(11) unsigned NOT NULL default '0', - `rule_name` varchar(100) default NULL, - `rule_id` int(11) default 1, - `src_ip` varchar(20) NOT NULL, - `src_netmask` varchar(20) NOT NULL, - `dst_ip` varchar(20) NOT NULL, - `dst_netmask` varchar(20) NOT NULL, - `src_from_port` varchar(10) NOT NULL, - `src_to_port` varchar(10) NOT NULL, - `dst_to_port` varchar(10) NOT NULL, - `dst_from_port` varchar(10) NOT NULL, - `protocol` varchar(10) default 'tcp', - `inbound_policy` enum('allow','deny','reject','limit') default 'allow', - `outbound_policy` enum('allow','deny','reject','limit') default 'allow', - `active` enum('n','y') NOT NULL default 'y', - `client_id` int(11) NOT NULL, - PRIMARY KEY (`firewall_id`) -) ENGINE=MyISAM AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `firewall_forward` ( - `firewall_id` int(11) unsigned NOT NULL auto_increment, - `sys_userid` int(11) unsigned NOT NULL default '0', - `domain_id` int(11) NOT NULL, - `sys_groupid` int(11) unsigned NOT NULL default '0', - `sys_perm_user` varchar(5) default NULL, - `sys_perm_group` varchar(5) default NULL, - `sys_perm_other` varchar(5) default NULL, - `server_id` int(11) unsigned NOT NULL default '0', - `application_name` varchar(100) default NULL, - `dst_ip` varchar(20) NOT NULL, - `src_from_port` varchar(10) NOT NULL, - `src_to_port` varchar(10) NOT NULL, - `dst_to_port` varchar(10) NOT NULL, - `dst_from_port` varchar(10) NOT NULL, - `protocol` int(3) default 0, - `active` enum('n','y') NOT NULL default 'y', - `client_id` int(11) NOT NULL, - PRIMARY KEY (`firewall_id`) -) ENGINE=MyISAM AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; - -alter table `server` add column `proxy_server` tinyint(1) not null after `vserver_server`; -alter table `server` add column `firewall_server` tinyint(1) not null after `proxy_server`; -alter table `web_domain` add column `nginx_directives` mediumtext not null after `apache_directives`; +CREATE TABLE IF NOT EXISTS `proxy_reverse` ( + `rewrite_id` int(11) NOT NULL auto_increment, + `sys_userid` int(11) unsigned NOT NULL default '0', + `sys_groupid` int(11) unsigned NOT NULL default '0', + `sys_perm_user` varchar(5) default NULL, + `sys_perm_group` varchar(5) default NULL, + `sys_perm_other` varchar(5) default NULL, + `server_id` int(11) unsigned NOT NULL default '0', + `rewrite_url_src` varchar(100) NOT NULL, + `rewrite_url_dst` varchar(100) NOT NULL, + `active` enum('n','y') NOT NULL default 'y', + PRIMARY KEY (`rewrite_id`) +) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; + + +CREATE TABLE IF NOT EXISTS `firewall_filter` ( + `firewall_id` int(11) unsigned NOT NULL auto_increment, + `sys_userid` int(11) unsigned NOT NULL default '0', + `domain_id` int(11) NOT NULL, + `sys_groupid` int(11) unsigned NOT NULL default '0', + `sys_perm_user` varchar(5) default NULL, + `sys_perm_group` varchar(5) default NULL, + `sys_perm_other` varchar(5) default NULL, + `server_id` int(11) unsigned NOT NULL default '0', + `rule_name` varchar(100) default NULL, + `rule_id` int(11) default 1, + `src_ip` varchar(20) NOT NULL, + `src_netmask` varchar(20) NOT NULL, + `dst_ip` varchar(20) NOT NULL, + `dst_netmask` varchar(20) NOT NULL, + `src_from_port` varchar(10) NOT NULL, + `src_to_port` varchar(10) NOT NULL, + `dst_to_port` varchar(10) NOT NULL, + `dst_from_port` varchar(10) NOT NULL, + `protocol` varchar(10) default 'tcp', + `inbound_policy` enum('allow','deny','reject','limit') default 'allow', + `outbound_policy` enum('allow','deny','reject','limit') default 'allow', + `active` enum('n','y') NOT NULL default 'y', + `client_id` int(11) NOT NULL, + PRIMARY KEY (`firewall_id`) +) ENGINE=MyISAM AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `firewall_forward` ( + `firewall_id` int(11) unsigned NOT NULL auto_increment, + `sys_userid` int(11) unsigned NOT NULL default '0', + `domain_id` int(11) NOT NULL, + `sys_groupid` int(11) unsigned NOT NULL default '0', + `sys_perm_user` varchar(5) default NULL, + `sys_perm_group` varchar(5) default NULL, + `sys_perm_other` varchar(5) default NULL, + `server_id` int(11) unsigned NOT NULL default '0', + `application_name` varchar(100) default NULL, + `dst_ip` varchar(20) NOT NULL, + `src_from_port` varchar(10) NOT NULL, + `src_to_port` varchar(10) NOT NULL, + `dst_to_port` varchar(10) NOT NULL, + `dst_from_port` varchar(10) NOT NULL, + `protocol` int(3) default 0, + `active` enum('n','y') NOT NULL default 'y', + `client_id` int(11) NOT NULL, + PRIMARY KEY (`firewall_id`) +) ENGINE=MyISAM AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; + +alter table `server` add column `proxy_server` tinyint(1) not null after `vserver_server`; +alter table `server` add column `firewall_server` tinyint(1) not null after `proxy_server`; +alter table `web_domain` add column `nginx_directives` mediumtext not null after `apache_directives`; diff --git a/install/tpl/nginx_cache.conf.master b/install/tpl/nginx_cache.conf.master index 1cd286382..bd51da61c 100644 --- a/install/tpl/nginx_cache.conf.master +++ b/install/tpl/nginx_cache.conf.master @@ -1,6 +1,6 @@ -proxy_temp_path /var/cache/nginx/temp; -proxy_cache_path /var/cache/nginx/cache levels=1:2 keys_zone=global:60m inactive=15m max_size=1G; -proxy_cache_valid 200 302 10m; -proxy_cache_valid 301 1h; -proxy_cache_valid 404 3m; -proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; +proxy_temp_path /var/cache/nginx/temp; +proxy_cache_path /var/cache/nginx/cache levels=1:2 keys_zone=global:60m inactive=15m max_size=1G; +proxy_cache_valid 200 302 10m; +proxy_cache_valid 301 1h; +proxy_cache_valid 404 3m; +proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; diff --git a/install/tpl/nginx_proxy.conf.master b/install/tpl/nginx_proxy.conf.master index d8711d046..bb1964702 100644 --- a/install/tpl/nginx_proxy.conf.master +++ b/install/tpl/nginx_proxy.conf.master @@ -1,34 +1,34 @@ -proxy_cache global; -proxy_redirect off; -proxy_set_header Host $host; -proxy_set_header X-Real-IP $remote_addr; -proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -proxy_pass_header Set-Cookie; -client_max_body_size 10m; -client_body_buffer_size 128k; -proxy_connect_timeout 90; -proxy_send_timeout 90; -proxy_read_timeout 90; -proxy_buffers 32 4k; - -set $cache_key $scheme$host$uri$is_args$args$cookie_user; -proxy_cache_key $cache_key; -proxy_cache_valid 200 10h; -expires 3d; - -### force timeouts if one of backend is died ## -proxy_next_upstream error timeout invalid_header http_500 http_502 http_503; - -location = /status { - stub_status on; - allow 127.0.0.1; - allow 192.168.1.0; - deny all; -} - -location ~ /purge(/.*) { - allow 127.0.0.1; - allow 192.168.1.0; - deny all; - proxy_cache_purge global $cache_key; -} +proxy_cache global; +proxy_redirect off; +proxy_set_header Host $host; +proxy_set_header X-Real-IP $remote_addr; +proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +proxy_pass_header Set-Cookie; +client_max_body_size 10m; +client_body_buffer_size 128k; +proxy_connect_timeout 90; +proxy_send_timeout 90; +proxy_read_timeout 90; +proxy_buffers 32 4k; + +set $cache_key $scheme$host$uri$is_args$args$cookie_user; +proxy_cache_key $cache_key; +proxy_cache_valid 200 10h; +expires 3d; + +### force timeouts if one of backend is died ## +proxy_next_upstream error timeout invalid_header http_500 http_502 http_503; + +location = /status { + stub_status on; + allow 127.0.0.1; + allow 192.168.1.0; + deny all; +} + +location ~ /purge(/.*) { + allow 127.0.0.1; + allow 192.168.1.0; + deny all; + proxy_cache_purge global $cache_key; +} diff --git a/install/tpl/squid.conf.master b/install/tpl/squid.conf.master index 2ae00d24d..c168fd095 100644 --- a/install/tpl/squid.conf.master +++ b/install/tpl/squid.conf.master @@ -1,224 +1,224 @@ - -# This configuration file requires squid 2.5+. It is untested with squid 3.x. - -# BASIC CONFIGURATION -# ------------------------------------------------------------------------------ - -visible_hostname {server_name} - - - -# port on which to listen - -http_port {ip_address}:80 vhost defaultsite={server_name} - - -# set cache directory and size (1000 MB) - be sure to set the cache size to -# about 10% less than the physical space available to leave room for squid's -# swap files and other temp files -cache_dir ufs /var/spool/squid 100 16 256 -cache_mgr webmaster@{server_name} - - - - -# LOGS -# ------------------------------------------------------------------------------ -log_icp_queries off -cache_access_log /var/log/squid/access.log -cache_log /var/log/squid/cache.log -cache_store_log /var/log/squid/store.log -cache_effective_user nobody -cache_effective_group nogroup -# emulate_httpd_log off - - -# RESOURCES -# ------------------------------------------------------------------------------ -# amount of memory used for caching recently accessed objects - defaults to 8 MB -cache_mem 64 MB -maximum_object_size 10 MB # max cached object size -maximum_object_size_in_memory 300 KB # max cached-in-memory object size - - -# ACCESS CONTROL -# ------------------------------------------------------------------------------ - -# Basic ACLs -acl all src 0.0.0.0/0.0.0.0 -acl localhost src 127.0.0.1/32 -acl ssl_ports port 443 563 -acl safe_ports port 80 443 - -acl openvz_instances src 192.168.1.0/24 -acl squid_server src localhost -acl manager proto cache_object -acl connect method connect - - -# deny requests to unknown ports -http_access deny !safe_ports - -acl accelerated_protocols proto http https -acl accelerated_domains dstdomain url_regex -i "{config_dir}/domains.txt" -acl accelerated_ports myport 80 443 - -http_access allow accelerated_domains -http_access allow accelerated_ports -http_access allow accelerated_protocols - - -acl purge method PURGE -http_access allow squid_server purge -http_access allow openvz_instances purge -http_access deny purge - -# Reply access -http_reply_access allow all - -# Cache manager setup - cache manager can only connect from localhost -# only allow cache manager access from localhost -http_access allow manager localhost -http_access deny manager -# deny connect to other than ssl ports -http_access deny connect !ssl_ports - -# ICP access - anybody can access icp methods -icp_access allow localhost - -# And finally deny all other access to this proxy -http_access deny all - - -# CACHE PEERS -# ------------------------------------------------------------------------------ - -# CONFIGURE THE CACHE PEERS. FIRST PORT IS THE HTTP PORT, SECOND PORT -# IS THE ICP PORT. REMEMBER TO ENABLE 'icp-server' ON YOUR 'zope.conf' -# LISTENING ON THE ICP PORT YOU USE HERE. -# acl in_backendpool dstdomain backendpool -# cache_peer 127.0.0.1 parent 8080 9090 no-digest no-netdb-exchange -# cache_peer 192.168.0.3 parent 8081 9091 no-digest no-netdb-exchange - -# cache_peer_access 127.0.0.1 allow in_backendpool -# cache_peer_access 127.0.0.1 deny all - -# cache_peer_access 192.168.0.3 allow in_backendpool -# cache_peer_access 192.168.0.3 deny all - -# IF YOU NEED TO FORWARD REQUESTS TO HOSTS NOT IN THE POOL THIS IS -# WHERE YOU ALLOW THE TARGET DOMAINS -# acl local_servers dstdomain some.mysite.com other.mysite.com -always_direct allow all - -# THE FOLLOWING DIRECTIVE IS NEEDED TO MAKE 'backendpool' RESOLVE TO -# THE POOL OF CACHE PEERS. -# never_direct allow all -# icp_access allow all - -# PROXY ON, NEEDED TO MAKE CACHE PEERS INTERCOMMUNICATE -# httpd_accel_with_proxy on - - -# REDIRECTOR PROGRAM -# ------------------------------------------------------------------------------ - - -url_rewrite_program {config_dir}/iRedirector.py -url_rewrite_children 1 -url_rewrite_concurrency 20 -url_rewrite_host_header off - - -# SPECIFY WHAT REQUESTS SQUID SHOULD CACHE -# ------------------------------------------------------------------------------ - -# Control what squid caches. We want to have squid handle content that is not -# personalized and that does not require any kind of authorization. -# -# 1) Always cache static content in squid - -acl static_content urlpath_regex -i \.(jpg|jpeg|gif|png|tiff|tif|svg|swf|ico|css|js|vsd|doc|ppt|pps|xls|pdf|mp3|mp4|m4a|ogg|mov|avi|wmv|sxw|zip|gz|bz2|tgz|tar|rar|odc|odb|odf|odg|odi|odp|ods|odt|sxc|sxd|sxi|sxw|dmg|torrent|deb|msi|iso|rpm)$ -no_cache allow static_content - -# 2) (OPTIONAL) Prevent squid from caching an item that is the result of a POST - -acl post_requests method POST -no_cache deny post_requests - -# 3) (OPTIONAL) Prevent squid from caching items with items in the query string -# If this is uncommented, squid will treat a url with 2 different query strings -# as 2 different urls when caching. - -# XXX: where did this example go? - -# 4) Prevent squid from caching requests from authenticated users or conditional -# GETs with an If-None-Match header (since squid doesn't know about ETags) -# We use an external python method to check these conditions and pass in the -# value of the __ac cookie (two different ways to allow for different cookie -# delimiters), the HTTP Authorization header, and the If-None-Match header. -# -# Squid caches the results of the external python method, so for debugging, set -# the options ttl=0 negative_ttl=0 so you can see what is going on - -# external_acl_type is_cacheable_type children=20 ttl=0 negative_ttl=0 %{Cookie:__ac} %{Cookie:;__ac} %{Authorization} %{If-None-Match} /etc/squid/squidAcl.py - -#external_acl_type is_cacheable_type protocol=2.5 children=20 %{Cookie:__ac} %{Cookie:;__ac} %{Authorization} %{If-None-Match} /etc/squid/squidAcl.py -#acl is_cacheable external is_cacheable_type -#no_cache allow is_cacheable - - -collapsed_forwarding on -#refresh_stale_hit on - - -# Explicitly disallow squid from handling anything else -no_cache deny all - - -# SPECIFY EFFECTS OF A BROWSER REFRESH -# ------------------------------------------------------------------------------ - -# RELOAD_INTO_IMS CAUSES WEIRD SQUID BEHAVIOR - IT APPEARS TO CAUSE FILES WITH -# INAPPROPRIATE HEADERS TO END UP IN THE CACHE, AND AS A RESULT BROWSERS END -# UP MAKING LOTS OF EXTRA (CONDITIONAL) REQUESTS WHEN THEY WOULD OTHERWISE MAKE -# NO REQUESTS. DO NOT USE! - -# Tell squid how to handle expiration times for content with no explicit expiration -# Assume static content is fresh for at least an hour and at most a day -#refresh_pattern -i \.(jpg|jpeg|gif|png|tiff|tif|svg|swf|ico|css|js|vsd|doc|ppt|pps|xls|pdf|mp3|mp4|m4a|ogg|mov|avi|wmv|sxw|zip|gz|bz2|tar|rar|odc|odb|odf|odg|odi|odp|ods|odt|sxc|sxd|sxi|sxw|dmg|torrent|deb|msi|iso|rpm)$ 60 50% 1440 reload-into-ims -#refresh_pattern . 0 20% 1440 - -# Change force-refresh requests into conditional gets using if-modified-since -#reload_into_ims on - -# DEBUGGING -# ------------------------------------------------------------------------------ -# debug_options ALL,1 33,2 # use this for debugging acls - debug_options ALL,8 - - -# MISCELLANEOUS -# ------------------------------------------------------------------------------ -# have squid handle all requests with ranges -# range_offset_limit -1 - -# amount of time squid waits for existing requests to be serviced before shutting down -shutdown_lifetime 1 seconds - -# allow squid to process multiple requests simultaneously if client is pipelining -pipeline_prefetch on - -# allow white spaces to be included in URLs -uri_whitespace allow - - -# OTHER PARAMETERS THAT MAY BE OF INTEREST -# ------------------------------------------------------------------------------ - -# logfile_rotate 0 -# reload_into_ims off -#error_directory /usr/local/squid/share/errors/English - - - + +# This configuration file requires squid 2.5+. It is untested with squid 3.x. + +# BASIC CONFIGURATION +# ------------------------------------------------------------------------------ + +visible_hostname {server_name} + + + +# port on which to listen + +http_port {ip_address}:80 vhost defaultsite={server_name} + + +# set cache directory and size (1000 MB) - be sure to set the cache size to +# about 10% less than the physical space available to leave room for squid's +# swap files and other temp files +cache_dir ufs /var/spool/squid 100 16 256 +cache_mgr webmaster@{server_name} + + + + +# LOGS +# ------------------------------------------------------------------------------ +log_icp_queries off +cache_access_log /var/log/squid/access.log +cache_log /var/log/squid/cache.log +cache_store_log /var/log/squid/store.log +cache_effective_user nobody +cache_effective_group nogroup +# emulate_httpd_log off + + +# RESOURCES +# ------------------------------------------------------------------------------ +# amount of memory used for caching recently accessed objects - defaults to 8 MB +cache_mem 64 MB +maximum_object_size 10 MB # max cached object size +maximum_object_size_in_memory 300 KB # max cached-in-memory object size + + +# ACCESS CONTROL +# ------------------------------------------------------------------------------ + +# Basic ACLs +acl all src 0.0.0.0/0.0.0.0 +acl localhost src 127.0.0.1/32 +acl ssl_ports port 443 563 +acl safe_ports port 80 443 + +acl openvz_instances src 192.168.1.0/24 +acl squid_server src localhost +acl manager proto cache_object +acl connect method connect + + +# deny requests to unknown ports +http_access deny !safe_ports + +acl accelerated_protocols proto http https +acl accelerated_domains dstdomain url_regex -i "{config_dir}/domains.txt" +acl accelerated_ports myport 80 443 + +http_access allow accelerated_domains +http_access allow accelerated_ports +http_access allow accelerated_protocols + + +acl purge method PURGE +http_access allow squid_server purge +http_access allow openvz_instances purge +http_access deny purge + +# Reply access +http_reply_access allow all + +# Cache manager setup - cache manager can only connect from localhost +# only allow cache manager access from localhost +http_access allow manager localhost +http_access deny manager +# deny connect to other than ssl ports +http_access deny connect !ssl_ports + +# ICP access - anybody can access icp methods +icp_access allow localhost + +# And finally deny all other access to this proxy +http_access deny all + + +# CACHE PEERS +# ------------------------------------------------------------------------------ + +# CONFIGURE THE CACHE PEERS. FIRST PORT IS THE HTTP PORT, SECOND PORT +# IS THE ICP PORT. REMEMBER TO ENABLE 'icp-server' ON YOUR 'zope.conf' +# LISTENING ON THE ICP PORT YOU USE HERE. +# acl in_backendpool dstdomain backendpool +# cache_peer 127.0.0.1 parent 8080 9090 no-digest no-netdb-exchange +# cache_peer 192.168.0.3 parent 8081 9091 no-digest no-netdb-exchange + +# cache_peer_access 127.0.0.1 allow in_backendpool +# cache_peer_access 127.0.0.1 deny all + +# cache_peer_access 192.168.0.3 allow in_backendpool +# cache_peer_access 192.168.0.3 deny all + +# IF YOU NEED TO FORWARD REQUESTS TO HOSTS NOT IN THE POOL THIS IS +# WHERE YOU ALLOW THE TARGET DOMAINS +# acl local_servers dstdomain some.mysite.com other.mysite.com +always_direct allow all + +# THE FOLLOWING DIRECTIVE IS NEEDED TO MAKE 'backendpool' RESOLVE TO +# THE POOL OF CACHE PEERS. +# never_direct allow all +# icp_access allow all + +# PROXY ON, NEEDED TO MAKE CACHE PEERS INTERCOMMUNICATE +# httpd_accel_with_proxy on + + +# REDIRECTOR PROGRAM +# ------------------------------------------------------------------------------ + + +url_rewrite_program {config_dir}/iRedirector.py +url_rewrite_children 1 +url_rewrite_concurrency 20 +url_rewrite_host_header off + + +# SPECIFY WHAT REQUESTS SQUID SHOULD CACHE +# ------------------------------------------------------------------------------ + +# Control what squid caches. We want to have squid handle content that is not +# personalized and that does not require any kind of authorization. +# +# 1) Always cache static content in squid + +acl static_content urlpath_regex -i \.(jpg|jpeg|gif|png|tiff|tif|svg|swf|ico|css|js|vsd|doc|ppt|pps|xls|pdf|mp3|mp4|m4a|ogg|mov|avi|wmv|sxw|zip|gz|bz2|tgz|tar|rar|odc|odb|odf|odg|odi|odp|ods|odt|sxc|sxd|sxi|sxw|dmg|torrent|deb|msi|iso|rpm)$ +no_cache allow static_content + +# 2) (OPTIONAL) Prevent squid from caching an item that is the result of a POST + +acl post_requests method POST +no_cache deny post_requests + +# 3) (OPTIONAL) Prevent squid from caching items with items in the query string +# If this is uncommented, squid will treat a url with 2 different query strings +# as 2 different urls when caching. + +# XXX: where did this example go? + +# 4) Prevent squid from caching requests from authenticated users or conditional +# GETs with an If-None-Match header (since squid doesn't know about ETags) +# We use an external python method to check these conditions and pass in the +# value of the __ac cookie (two different ways to allow for different cookie +# delimiters), the HTTP Authorization header, and the If-None-Match header. +# +# Squid caches the results of the external python method, so for debugging, set +# the options ttl=0 negative_ttl=0 so you can see what is going on + +# external_acl_type is_cacheable_type children=20 ttl=0 negative_ttl=0 %{Cookie:__ac} %{Cookie:;__ac} %{Authorization} %{If-None-Match} /etc/squid/squidAcl.py + +#external_acl_type is_cacheable_type protocol=2.5 children=20 %{Cookie:__ac} %{Cookie:;__ac} %{Authorization} %{If-None-Match} /etc/squid/squidAcl.py +#acl is_cacheable external is_cacheable_type +#no_cache allow is_cacheable + + +collapsed_forwarding on +#refresh_stale_hit on + + +# Explicitly disallow squid from handling anything else +no_cache deny all + + +# SPECIFY EFFECTS OF A BROWSER REFRESH +# ------------------------------------------------------------------------------ + +# RELOAD_INTO_IMS CAUSES WEIRD SQUID BEHAVIOR - IT APPEARS TO CAUSE FILES WITH +# INAPPROPRIATE HEADERS TO END UP IN THE CACHE, AND AS A RESULT BROWSERS END +# UP MAKING LOTS OF EXTRA (CONDITIONAL) REQUESTS WHEN THEY WOULD OTHERWISE MAKE +# NO REQUESTS. DO NOT USE! + +# Tell squid how to handle expiration times for content with no explicit expiration +# Assume static content is fresh for at least an hour and at most a day +#refresh_pattern -i \.(jpg|jpeg|gif|png|tiff|tif|svg|swf|ico|css|js|vsd|doc|ppt|pps|xls|pdf|mp3|mp4|m4a|ogg|mov|avi|wmv|sxw|zip|gz|bz2|tar|rar|odc|odb|odf|odg|odi|odp|ods|odt|sxc|sxd|sxi|sxw|dmg|torrent|deb|msi|iso|rpm)$ 60 50% 1440 reload-into-ims +#refresh_pattern . 0 20% 1440 + +# Change force-refresh requests into conditional gets using if-modified-since +#reload_into_ims on + +# DEBUGGING +# ------------------------------------------------------------------------------ +# debug_options ALL,1 33,2 # use this for debugging acls + debug_options ALL,8 + + +# MISCELLANEOUS +# ------------------------------------------------------------------------------ +# have squid handle all requests with ranges +# range_offset_limit -1 + +# amount of time squid waits for existing requests to be serviced before shutting down +shutdown_lifetime 1 seconds + +# allow squid to process multiple requests simultaneously if client is pipelining +pipeline_prefetch on + +# allow white spaces to be included in URLs +uri_whitespace allow + + +# OTHER PARAMETERS THAT MAY BE OF INTEREST +# ------------------------------------------------------------------------------ + +# logfile_rotate 0 +# reload_into_ims off +#error_directory /usr/local/squid/share/errors/English + + + diff --git a/install/tpl/ufw.conf.master b/install/tpl/ufw.conf.master index 9dc02d367..caae14f71 100644 --- a/install/tpl/ufw.conf.master +++ b/install/tpl/ufw.conf.master @@ -1,8 +1,8 @@ -# /etc/ufw/ufw.conf -# - -# set to yes to start on boot -ENABLED=yes - -# set to one of 'off', 'low', 'medium', 'high' -LOGLEVEL=low +# /etc/ufw/ufw.conf +# + +# set to yes to start on boot +ENABLED=yes + +# set to one of 'off', 'low', 'medium', 'high' +LOGLEVEL=low diff --git a/interface/lib/lang/fr.lng b/interface/lib/lang/fr.lng index c6de82fda..cdee4e727 100644 --- a/interface/lib/lang/fr.lng +++ b/interface/lib/lang/fr.lng @@ -1,42 +1,42 @@ - - + + diff --git a/interface/web/admin/lib/lang/fr.lng b/interface/web/admin/lib/lang/fr.lng index 87c76200d..0bdae1b4f 100644 --- a/interface/web/admin/lib/lang/fr.lng +++ b/interface/web/admin/lib/lang/fr.lng @@ -1,44 +1,44 @@ - - + + diff --git a/interface/web/admin/lib/lang/fr_firewall.lng b/interface/web/admin/lib/lang/fr_firewall.lng index 745b8b1b0..66a2ab8d8 100644 --- a/interface/web/admin/lib/lang/fr_firewall.lng +++ b/interface/web/admin/lib/lang/fr_firewall.lng @@ -1,12 +1,12 @@ - - + + diff --git a/interface/web/admin/lib/lang/fr_firewall_list.lng b/interface/web/admin/lib/lang/fr_firewall_list.lng index 73bf402d9..9beb57565 100644 --- a/interface/web/admin/lib/lang/fr_firewall_list.lng +++ b/interface/web/admin/lib/lang/fr_firewall_list.lng @@ -1,9 +1,9 @@ - - + + diff --git a/interface/web/admin/lib/lang/fr_groups.lng b/interface/web/admin/lib/lang/fr_groups.lng index b128631f4..b48ed561f 100644 --- a/interface/web/admin/lib/lang/fr_groups.lng +++ b/interface/web/admin/lib/lang/fr_groups.lng @@ -1,6 +1,6 @@ - - + + diff --git a/interface/web/admin/lib/lang/fr_groups_list.lng b/interface/web/admin/lib/lang/fr_groups_list.lng index 07d73592f..7b8261045 100644 --- a/interface/web/admin/lib/lang/fr_groups_list.lng +++ b/interface/web/admin/lib/lang/fr_groups_list.lng @@ -1,8 +1,8 @@ -ATTENTION: Ne pas éditer ou modifier de paramètre utilisateur ici. Utilisez les paramètres Client et Revendeur dans le module Client à la place. Modifier ou changer les informations ici peut conduire à la perte de données'; -?> - +ATTENTION: Ne pas éditer ou modifier de paramètre utilisateur ici. Utilisez les paramètres Client et Revendeur dans le module Client à la place. Modifier ou changer les informations ici peut conduire à la perte de données'; +?> + diff --git a/interface/web/admin/lib/lang/fr_language_add.lng b/interface/web/admin/lib/lang/fr_language_add.lng index 79cabb70a..51fa7c967 100644 --- a/interface/web/admin/lib/lang/fr_language_add.lng +++ b/interface/web/admin/lib/lang/fr_language_add.lng @@ -1,9 +1,9 @@ - - + + diff --git a/interface/web/admin/lib/lang/fr_language_complete.lng b/interface/web/admin/lib/lang/fr_language_complete.lng index 12c432119..711607abb 100644 --- a/interface/web/admin/lib/lang/fr_language_complete.lng +++ b/interface/web/admin/lib/lang/fr_language_complete.lng @@ -1,8 +1,8 @@ -Ceci ajoute les élements manquants en anglais au fichier sélectionné.'; -?> - +Ceci ajoute les élements manquants en anglais au fichier sélectionné.'; +?> + diff --git a/interface/web/admin/lib/lang/fr_language_edit.lng b/interface/web/admin/lib/lang/fr_language_edit.lng index 1e1f3b27a..fe5f0c08b 100644 --- a/interface/web/admin/lib/lang/fr_language_edit.lng +++ b/interface/web/admin/lib/lang/fr_language_edit.lng @@ -1,9 +1,9 @@ - - + + diff --git a/interface/web/admin/lib/lang/fr_language_export.lng b/interface/web/admin/lib/lang/fr_language_export.lng index ed304f031..85edd5e31 100644 --- a/interface/web/admin/lib/lang/fr_language_export.lng +++ b/interface/web/admin/lib/lang/fr_language_export.lng @@ -1,7 +1,7 @@ - - + + diff --git a/interface/web/admin/lib/lang/fr_language_import.lng b/interface/web/admin/lib/lang/fr_language_import.lng index 66ab22c32..20632476f 100644 --- a/interface/web/admin/lib/lang/fr_language_import.lng +++ b/interface/web/admin/lib/lang/fr_language_import.lng @@ -1,9 +1,9 @@ - - + + diff --git a/interface/web/admin/lib/lang/fr_language_list.lng b/interface/web/admin/lib/lang/fr_language_list.lng index ad38bc1be..dab727161 100644 --- a/interface/web/admin/lib/lang/fr_language_list.lng +++ b/interface/web/admin/lib/lang/fr_language_list.lng @@ -1,8 +1,8 @@ - - + + diff --git a/interface/web/admin/lib/lang/fr_package_install.lng b/interface/web/admin/lib/lang/fr_package_install.lng index f5c3afa89..60ed772b3 100644 --- a/interface/web/admin/lib/lang/fr_package_install.lng +++ b/interface/web/admin/lib/lang/fr_package_install.lng @@ -1,8 +1,8 @@ - - + + diff --git a/interface/web/admin/lib/lang/fr_remote_action.lng b/interface/web/admin/lib/lang/fr_remote_action.lng index 4e21f9654..9a4c579a1 100644 --- a/interface/web/admin/lib/lang/fr_remote_action.lng +++ b/interface/web/admin/lib/lang/fr_remote_action.lng @@ -1,11 +1,11 @@ -
UTILISEZ A VOS RISQUES ET PERILS !'; -$wb['do_ispcupdate_caption'] = 'Mettre à jour ISPConfig 3 sur le serveur distant'; -$wb['do_ispcupdate_desc'] = 'Cette action met à jour ISPConfig3 sur le serveur sélectionné.

UTILISEZ A VOS RISQUES ET PERILS !'; -$wb['action_scheduled'] = 'L\'action est marquée pour exécution'; -$wb['select_all_server'] = 'Tout serveur'; -?> - +
UTILISEZ A VOS RISQUES ET PERILS !'; +$wb['do_ispcupdate_caption'] = 'Mettre à jour ISPConfig 3 sur le serveur distant'; +$wb['do_ispcupdate_desc'] = 'Cette action met à jour ISPConfig3 sur le serveur sélectionné.

UTILISEZ A VOS RISQUES ET PERILS !'; +$wb['action_scheduled'] = 'L\'action est marquée pour exécution'; +$wb['select_all_server'] = 'Tout serveur'; +?> + diff --git a/interface/web/admin/lib/lang/fr_remote_user.lng b/interface/web/admin/lib/lang/fr_remote_user.lng index 451d80049..ab77be4fd 100644 --- a/interface/web/admin/lib/lang/fr_remote_user.lng +++ b/interface/web/admin/lib/lang/fr_remote_user.lng @@ -1,43 +1,43 @@ - - + + diff --git a/interface/web/admin/lib/lang/fr_remote_user_list.lng b/interface/web/admin/lib/lang/fr_remote_user_list.lng index 6b5ada2f5..808fa3994 100644 --- a/interface/web/admin/lib/lang/fr_remote_user_list.lng +++ b/interface/web/admin/lib/lang/fr_remote_user_list.lng @@ -1,8 +1,8 @@ - - + + diff --git a/interface/web/admin/lib/lang/fr_server.lng b/interface/web/admin/lib/lang/fr_server.lng index 5b8684a7c..4ba7b7dde 100644 --- a/interface/web/admin/lib/lang/fr_server.lng +++ b/interface/web/admin/lib/lang/fr_server.lng @@ -1,14 +1,14 @@ - - + + diff --git a/interface/web/admin/lib/lang/fr_server_config.lng b/interface/web/admin/lib/lang/fr_server_config.lng index 4e32219f1..3efec6a7c 100644 --- a/interface/web/admin/lib/lang/fr_server_config.lng +++ b/interface/web/admin/lib/lang/fr_server_config.lng @@ -1,78 +1,78 @@ - - + + diff --git a/interface/web/admin/lib/lang/fr_server_config_list.lng b/interface/web/admin/lib/lang/fr_server_config_list.lng index 04278ff05..c1c75e3ef 100644 --- a/interface/web/admin/lib/lang/fr_server_config_list.lng +++ b/interface/web/admin/lib/lang/fr_server_config_list.lng @@ -1,5 +1,5 @@ - - + + diff --git a/interface/web/admin/lib/lang/fr_server_ip.lng b/interface/web/admin/lib/lang/fr_server_ip.lng index 9e3be01c3..a7b36db89 100644 --- a/interface/web/admin/lib/lang/fr_server_ip.lng +++ b/interface/web/admin/lib/lang/fr_server_ip.lng @@ -1,8 +1,8 @@ - - + + diff --git a/interface/web/admin/lib/lang/fr_server_ip_list.lng b/interface/web/admin/lib/lang/fr_server_ip_list.lng index faca536a3..e75b76a3d 100644 --- a/interface/web/admin/lib/lang/fr_server_ip_list.lng +++ b/interface/web/admin/lib/lang/fr_server_ip_list.lng @@ -1,7 +1,7 @@ - - + + diff --git a/interface/web/admin/lib/lang/fr_server_list.lng b/interface/web/admin/lib/lang/fr_server_list.lng index b4e6569e9..660d64c60 100644 --- a/interface/web/admin/lib/lang/fr_server_list.lng +++ b/interface/web/admin/lib/lang/fr_server_list.lng @@ -1,12 +1,12 @@ - - + + diff --git a/interface/web/admin/lib/lang/fr_software_package_install.lng b/interface/web/admin/lib/lang/fr_software_package_install.lng index aa31bc63d..9ebf62be3 100644 --- a/interface/web/admin/lib/lang/fr_software_package_install.lng +++ b/interface/web/admin/lib/lang/fr_software_package_install.lng @@ -1,7 +1,7 @@ - - + + diff --git a/interface/web/admin/lib/lang/fr_software_package_list.lng b/interface/web/admin/lib/lang/fr_software_package_list.lng index 379840a97..6258e9d80 100644 --- a/interface/web/admin/lib/lang/fr_software_package_list.lng +++ b/interface/web/admin/lib/lang/fr_software_package_list.lng @@ -1,11 +1,11 @@ - - + + diff --git a/interface/web/admin/lib/lang/fr_software_repo.lng b/interface/web/admin/lib/lang/fr_software_repo.lng index b6722b2a1..aaf690614 100644 --- a/interface/web/admin/lib/lang/fr_software_repo.lng +++ b/interface/web/admin/lib/lang/fr_software_repo.lng @@ -1,8 +1,8 @@ - - + + diff --git a/interface/web/admin/lib/lang/fr_software_repo_list.lng b/interface/web/admin/lib/lang/fr_software_repo_list.lng index 2e5029c1d..1b8d0ffc1 100644 --- a/interface/web/admin/lib/lang/fr_software_repo_list.lng +++ b/interface/web/admin/lib/lang/fr_software_repo_list.lng @@ -1,7 +1,7 @@ - - + + diff --git a/interface/web/admin/lib/lang/fr_software_update_list.lng b/interface/web/admin/lib/lang/fr_software_update_list.lng index 8399418b1..1170d50df 100644 --- a/interface/web/admin/lib/lang/fr_software_update_list.lng +++ b/interface/web/admin/lib/lang/fr_software_update_list.lng @@ -1,9 +1,9 @@ - - + + diff --git a/interface/web/admin/lib/lang/fr_system_config.lng b/interface/web/admin/lib/lang/fr_system_config.lng index 1f26b4b5d..63edba38b 100644 --- a/interface/web/admin/lib/lang/fr_system_config.lng +++ b/interface/web/admin/lib/lang/fr_system_config.lng @@ -1,24 +1,24 @@ - - + + diff --git a/interface/web/admin/lib/lang/fr_users.lng b/interface/web/admin/lib/lang/fr_users.lng index fd92c795f..d9a41042d 100644 --- a/interface/web/admin/lib/lang/fr_users.lng +++ b/interface/web/admin/lib/lang/fr_users.lng @@ -1,29 +1,29 @@ - - + + diff --git a/interface/web/admin/lib/lang/fr_users_list.lng b/interface/web/admin/lib/lang/fr_users_list.lng index 770270c34..e33efc6e8 100644 --- a/interface/web/admin/lib/lang/fr_users_list.lng +++ b/interface/web/admin/lib/lang/fr_users_list.lng @@ -1,10 +1,10 @@ -ATTENTION: Ne pas éditer ou modifier de paramètre utilisateur ici. Utilisez les paramètres Client et Revendeur dans le module Client à la place. Modifier ou changer les informations ici peut conduire à la perte de données'; -?> - +ATTENTION: Ne pas éditer ou modifier de paramètre utilisateur ici. Utilisez les paramètres Client et Revendeur dans le module Client à la place. Modifier ou changer les informations ici peut conduire à la perte de données'; +?> + diff --git a/interface/web/client/lib/lang/fr.lng b/interface/web/client/lib/lang/fr.lng index 8223d24a5..a0075d8a7 100644 --- a/interface/web/client/lib/lang/fr.lng +++ b/interface/web/client/lib/lang/fr.lng @@ -1,14 +1,14 @@ - - + + diff --git a/interface/web/client/lib/lang/fr_client.lng b/interface/web/client/lib/lang/fr_client.lng index bc68dca65..f5c8fca96 100644 --- a/interface/web/client/lib/lang/fr_client.lng +++ b/interface/web/client/lib/lang/fr_client.lng @@ -1,102 +1,102 @@ - - + + diff --git a/interface/web/client/lib/lang/fr_client_del.lng b/interface/web/client/lib/lang/fr_client_del.lng index 8a9d14f4d..8a8948542 100644 --- a/interface/web/client/lib/lang/fr_client_del.lng +++ b/interface/web/client/lib/lang/fr_client_del.lng @@ -1,7 +1,7 @@ - - + + diff --git a/interface/web/client/lib/lang/fr_client_template.lng b/interface/web/client/lib/lang/fr_client_template.lng index c1274b770..2d17b1f79 100644 --- a/interface/web/client/lib/lang/fr_client_template.lng +++ b/interface/web/client/lib/lang/fr_client_template.lng @@ -1,64 +1,64 @@ - - + + diff --git a/interface/web/client/lib/lang/fr_client_template_list.lng b/interface/web/client/lib/lang/fr_client_template_list.lng index 776dbd0b5..f6063e2d4 100644 --- a/interface/web/client/lib/lang/fr_client_template_list.lng +++ b/interface/web/client/lib/lang/fr_client_template_list.lng @@ -1,6 +1,6 @@ - - + + diff --git a/interface/web/client/lib/lang/fr_clients_list.lng b/interface/web/client/lib/lang/fr_clients_list.lng index a6787f34f..afbf646d2 100644 --- a/interface/web/client/lib/lang/fr_clients_list.lng +++ b/interface/web/client/lib/lang/fr_clients_list.lng @@ -1,10 +1,10 @@ - - + + diff --git a/interface/web/client/lib/lang/fr_reseller.lng b/interface/web/client/lib/lang/fr_reseller.lng index 0be106adb..5245e0f60 100644 --- a/interface/web/client/lib/lang/fr_reseller.lng +++ b/interface/web/client/lib/lang/fr_reseller.lng @@ -1,103 +1,103 @@ - - + + diff --git a/interface/web/client/lib/lang/fr_resellers_list.lng b/interface/web/client/lib/lang/fr_resellers_list.lng index a6787f34f..afbf646d2 100644 --- a/interface/web/client/lib/lang/fr_resellers_list.lng +++ b/interface/web/client/lib/lang/fr_resellers_list.lng @@ -1,10 +1,10 @@ - - + + diff --git a/interface/web/dashboard/lib/lang/fr.lng b/interface/web/dashboard/lib/lang/fr.lng index 6bb32cf77..305c525d3 100644 --- a/interface/web/dashboard/lib/lang/fr.lng +++ b/interface/web/dashboard/lib/lang/fr.lng @@ -1,5 +1,5 @@ - - + + diff --git a/interface/web/dashboard/lib/lang/fr_dashlet_limits.lng b/interface/web/dashboard/lib/lang/fr_dashlet_limits.lng index 7a4f76b41..2d3752730 100644 --- a/interface/web/dashboard/lib/lang/fr_dashlet_limits.lng +++ b/interface/web/dashboard/lib/lang/fr_dashlet_limits.lng @@ -1,30 +1,30 @@ - - + + diff --git a/interface/web/dashboard/lib/lang/fr_dashlet_modules.lng b/interface/web/dashboard/lib/lang/fr_dashlet_modules.lng index 4eebdb76d..c511af9f3 100644 --- a/interface/web/dashboard/lib/lang/fr_dashlet_modules.lng +++ b/interface/web/dashboard/lib/lang/fr_dashlet_modules.lng @@ -1,4 +1,4 @@ - - + + diff --git a/interface/web/designer/lib/lang/fr.lng b/interface/web/designer/lib/lang/fr.lng index 75c42c807..29f4a51ef 100644 --- a/interface/web/designer/lib/lang/fr.lng +++ b/interface/web/designer/lib/lang/fr.lng @@ -1,3 +1,3 @@ - - + + diff --git a/interface/web/designer/lib/lang/fr_form_edit.lng b/interface/web/designer/lib/lang/fr_form_edit.lng index 7b272a4b0..f02964708 100644 --- a/interface/web/designer/lib/lang/fr_form_edit.lng +++ b/interface/web/designer/lib/lang/fr_form_edit.lng @@ -1,25 +1,25 @@ - - + + diff --git a/interface/web/designer/lib/lang/fr_form_list.lng b/interface/web/designer/lib/lang/fr_form_list.lng index a386f5bf4..65497a5f1 100644 --- a/interface/web/designer/lib/lang/fr_form_list.lng +++ b/interface/web/designer/lib/lang/fr_form_list.lng @@ -1,8 +1,8 @@ - - + + diff --git a/interface/web/designer/lib/lang/fr_form_show.lng b/interface/web/designer/lib/lang/fr_form_show.lng index 3a15faa3f..236ae2c50 100644 --- a/interface/web/designer/lib/lang/fr_form_show.lng +++ b/interface/web/designer/lib/lang/fr_form_show.lng @@ -1,19 +1,19 @@ - - + + diff --git a/interface/web/designer/lib/lang/fr_module_edit.lng b/interface/web/designer/lib/lang/fr_module_edit.lng index c5d174483..6de5b6577 100644 --- a/interface/web/designer/lib/lang/fr_module_edit.lng +++ b/interface/web/designer/lib/lang/fr_module_edit.lng @@ -1,13 +1,13 @@ -Description

Nom du Module: Nom du répertoire du module. Seuls les nombres, lettres et underscores sont autorisés.
Titre du module: Sera affiché dans le menu de navigation (supérieur).
Fichier gabarit: Fichier'; -?> - +Description

Nom du Module: Nom du répertoire du module. Seuls les nombres, lettres et underscores sont autorisés.
Titre du module: Sera affiché dans le menu de navigation (supérieur).
Fichier gabarit: Fichier'; +?> + diff --git a/interface/web/designer/lib/lang/fr_module_list.lng b/interface/web/designer/lib/lang/fr_module_list.lng index 83093dbbf..06ac92720 100644 --- a/interface/web/designer/lib/lang/fr_module_list.lng +++ b/interface/web/designer/lib/lang/fr_module_list.lng @@ -1,6 +1,6 @@ - - + + diff --git a/interface/web/designer/lib/lang/fr_module_nav_edit.lng b/interface/web/designer/lib/lang/fr_module_nav_edit.lng index affd745e4..8ff301813 100644 --- a/interface/web/designer/lib/lang/fr_module_nav_edit.lng +++ b/interface/web/designer/lib/lang/fr_module_nav_edit.lng @@ -1,7 +1,7 @@ - - + + diff --git a/interface/web/designer/lib/lang/fr_module_nav_item_edit.lng b/interface/web/designer/lib/lang/fr_module_nav_item_edit.lng index 803d96c99..fafcfbc1e 100644 --- a/interface/web/designer/lib/lang/fr_module_nav_item_edit.lng +++ b/interface/web/designer/lib/lang/fr_module_nav_item_edit.lng @@ -1,9 +1,9 @@ - - + + diff --git a/interface/web/designer/lib/lang/fr_module_show.lng b/interface/web/designer/lib/lang/fr_module_show.lng index b768f4939..857817aaa 100644 --- a/interface/web/designer/lib/lang/fr_module_show.lng +++ b/interface/web/designer/lib/lang/fr_module_show.lng @@ -1,17 +1,17 @@ - - + + diff --git a/interface/web/dns/lib/lang/fr.lng b/interface/web/dns/lib/lang/fr.lng index 6c2d923e4..af0a6df9c 100644 --- a/interface/web/dns/lib/lang/fr.lng +++ b/interface/web/dns/lib/lang/fr.lng @@ -1,21 +1,21 @@ - - + + diff --git a/interface/web/dns/lib/lang/fr_dns_a.lng b/interface/web/dns/lib/lang/fr_dns_a.lng index 207547f99..929ccf5c5 100644 --- a/interface/web/dns/lib/lang/fr_dns_a.lng +++ b/interface/web/dns/lib/lang/fr_dns_a.lng @@ -1,17 +1,17 @@ - - + + diff --git a/interface/web/dns/lib/lang/fr_dns_a_list.lng b/interface/web/dns/lib/lang/fr_dns_a_list.lng index f34205a7e..8aec347f1 100644 --- a/interface/web/dns/lib/lang/fr_dns_a_list.lng +++ b/interface/web/dns/lib/lang/fr_dns_a_list.lng @@ -1,15 +1,15 @@ - - + + diff --git a/interface/web/dns/lib/lang/fr_dns_aaaa.lng b/interface/web/dns/lib/lang/fr_dns_aaaa.lng index 826c76403..dcc1eee8f 100644 --- a/interface/web/dns/lib/lang/fr_dns_aaaa.lng +++ b/interface/web/dns/lib/lang/fr_dns_aaaa.lng @@ -1,16 +1,16 @@ - - + + diff --git a/interface/web/dns/lib/lang/fr_dns_alias.lng b/interface/web/dns/lib/lang/fr_dns_alias.lng index e9e5b5c82..6208ee671 100644 --- a/interface/web/dns/lib/lang/fr_dns_alias.lng +++ b/interface/web/dns/lib/lang/fr_dns_alias.lng @@ -1,16 +1,16 @@ - - + + diff --git a/interface/web/dns/lib/lang/fr_dns_cname.lng b/interface/web/dns/lib/lang/fr_dns_cname.lng index de0b938e9..f9dda246a 100644 --- a/interface/web/dns/lib/lang/fr_dns_cname.lng +++ b/interface/web/dns/lib/lang/fr_dns_cname.lng @@ -1,17 +1,17 @@ - - + + diff --git a/interface/web/dns/lib/lang/fr_dns_hinfo.lng b/interface/web/dns/lib/lang/fr_dns_hinfo.lng index 6b974a739..2134f85df 100644 --- a/interface/web/dns/lib/lang/fr_dns_hinfo.lng +++ b/interface/web/dns/lib/lang/fr_dns_hinfo.lng @@ -1,16 +1,16 @@ - - + + diff --git a/interface/web/dns/lib/lang/fr_dns_mx.lng b/interface/web/dns/lib/lang/fr_dns_mx.lng index 238ff1d65..27dd822be 100644 --- a/interface/web/dns/lib/lang/fr_dns_mx.lng +++ b/interface/web/dns/lib/lang/fr_dns_mx.lng @@ -1,17 +1,17 @@ - - + + diff --git a/interface/web/dns/lib/lang/fr_dns_ns.lng b/interface/web/dns/lib/lang/fr_dns_ns.lng index 5cc49ce30..86bd0cf3f 100644 --- a/interface/web/dns/lib/lang/fr_dns_ns.lng +++ b/interface/web/dns/lib/lang/fr_dns_ns.lng @@ -1,16 +1,16 @@ - - + + diff --git a/interface/web/dns/lib/lang/fr_dns_ptr.lng b/interface/web/dns/lib/lang/fr_dns_ptr.lng index 794561829..9bd4e707e 100644 --- a/interface/web/dns/lib/lang/fr_dns_ptr.lng +++ b/interface/web/dns/lib/lang/fr_dns_ptr.lng @@ -1,16 +1,16 @@ - - + + diff --git a/interface/web/dns/lib/lang/fr_dns_rp.lng b/interface/web/dns/lib/lang/fr_dns_rp.lng index 1d79fbaee..d6654df39 100644 --- a/interface/web/dns/lib/lang/fr_dns_rp.lng +++ b/interface/web/dns/lib/lang/fr_dns_rp.lng @@ -1,16 +1,16 @@ - - + + diff --git a/interface/web/dns/lib/lang/fr_dns_slave.lng b/interface/web/dns/lib/lang/fr_dns_slave.lng index 2c8a96e07..afd91c940 100644 --- a/interface/web/dns/lib/lang/fr_dns_slave.lng +++ b/interface/web/dns/lib/lang/fr_dns_slave.lng @@ -1,15 +1,15 @@ -ces IPs (liste séparée par des virgules)'; -$wb['server_id_error_empty'] = 'Aucun serveur sélectionné'; -$wb['origin_error_empty'] = 'zone vide.'; -$wb['origin_error_unique'] = 'Il y a déjà un enregistrement pour cette zone.'; -$wb['origin_error_regex'] = 'La zone a un format invalide.'; -$wb['ns_error_regex'] = 'L\'enregistrement NS a un format invalide.'; -?> - +ces IPs (liste séparée par des virgules)'; +$wb['server_id_error_empty'] = 'Aucun serveur sélectionné'; +$wb['origin_error_empty'] = 'zone vide.'; +$wb['origin_error_unique'] = 'Il y a déjà un enregistrement pour cette zone.'; +$wb['origin_error_regex'] = 'La zone a un format invalide.'; +$wb['ns_error_regex'] = 'L\'enregistrement NS a un format invalide.'; +?> + diff --git a/interface/web/dns/lib/lang/fr_dns_slave_list.lng b/interface/web/dns/lib/lang/fr_dns_slave_list.lng index f375f0106..86b0b5b99 100644 --- a/interface/web/dns/lib/lang/fr_dns_slave_list.lng +++ b/interface/web/dns/lib/lang/fr_dns_slave_list.lng @@ -1,9 +1,9 @@ - - + + diff --git a/interface/web/dns/lib/lang/fr_dns_soa.lng b/interface/web/dns/lib/lang/fr_dns_soa.lng index 8824f946f..9b65216bc 100644 --- a/interface/web/dns/lib/lang/fr_dns_soa.lng +++ b/interface/web/dns/lib/lang/fr_dns_soa.lng @@ -1,27 +1,27 @@ -ces IP (liste séparée par des virgules)'; -$wb['active_txt'] = 'Actif'; -$wb['client_txt'] = 'Client'; -$wb['no_zone_perm'] = 'Vous n\'avez pas la permission d\'ajouter un enregistrement dans cette zone DNS.'; -$wb['server_id_error_empty'] = 'Aucun serveur sélectionné'; -$wb['origin_error_empty'] = 'Zone vide.'; -$wb['origin_error_unique'] = 'Il y a déja un enregistrement pour cette zone.'; -$wb['origin_error_regex'] = 'La zone est d\'un format invalide.'; -$wb['ns_error_regex'] = 'Le serveur de nom est d\'un format invalide.'; -$wb['mbox_error_empty'] = 'L\'adresse email est vide.'; -$wb['mbox_error_regex'] = 'L\'adresse email est d\'un format invalide.'; -$wb['limit_dns_zone_txt'] = 'Le nombre maximal de zones DNS pour votre compte est atteint.'; -$wb['also_notify_txt'] = 'Notifier aussi'; -$wb['update_acl_txt'] = 'Mettre à jour l\'ACL'; -?> - +ces IP (liste séparée par des virgules)'; +$wb['active_txt'] = 'Actif'; +$wb['client_txt'] = 'Client'; +$wb['no_zone_perm'] = 'Vous n\'avez pas la permission d\'ajouter un enregistrement dans cette zone DNS.'; +$wb['server_id_error_empty'] = 'Aucun serveur sélectionné'; +$wb['origin_error_empty'] = 'Zone vide.'; +$wb['origin_error_unique'] = 'Il y a déja un enregistrement pour cette zone.'; +$wb['origin_error_regex'] = 'La zone est d\'un format invalide.'; +$wb['ns_error_regex'] = 'Le serveur de nom est d\'un format invalide.'; +$wb['mbox_error_empty'] = 'L\'adresse email est vide.'; +$wb['mbox_error_regex'] = 'L\'adresse email est d\'un format invalide.'; +$wb['limit_dns_zone_txt'] = 'Le nombre maximal de zones DNS pour votre compte est atteint.'; +$wb['also_notify_txt'] = 'Notifier aussi'; +$wb['update_acl_txt'] = 'Mettre à jour l\'ACL'; +?> + diff --git a/interface/web/dns/lib/lang/fr_dns_soa_list.lng b/interface/web/dns/lib/lang/fr_dns_soa_list.lng index 1e39193e9..7b69c8a7e 100644 --- a/interface/web/dns/lib/lang/fr_dns_soa_list.lng +++ b/interface/web/dns/lib/lang/fr_dns_soa_list.lng @@ -1,11 +1,11 @@ - - + + diff --git a/interface/web/dns/lib/lang/fr_dns_srv.lng b/interface/web/dns/lib/lang/fr_dns_srv.lng index 2e649a3e9..dda4fbacb 100644 --- a/interface/web/dns/lib/lang/fr_dns_srv.lng +++ b/interface/web/dns/lib/lang/fr_dns_srv.lng @@ -1,18 +1,18 @@ - - + + diff --git a/interface/web/dns/lib/lang/fr_dns_template.lng b/interface/web/dns/lib/lang/fr_dns_template.lng index 303f8a1fb..dffdae27f 100644 --- a/interface/web/dns/lib/lang/fr_dns_template.lng +++ b/interface/web/dns/lib/lang/fr_dns_template.lng @@ -1,7 +1,7 @@ - - + + diff --git a/interface/web/dns/lib/lang/fr_dns_template_list.lng b/interface/web/dns/lib/lang/fr_dns_template_list.lng index b62aa8b87..0a4b7ef60 100644 --- a/interface/web/dns/lib/lang/fr_dns_template_list.lng +++ b/interface/web/dns/lib/lang/fr_dns_template_list.lng @@ -1,7 +1,7 @@ - - + + diff --git a/interface/web/dns/lib/lang/fr_dns_txt.lng b/interface/web/dns/lib/lang/fr_dns_txt.lng index 15815454f..07ea85e80 100644 --- a/interface/web/dns/lib/lang/fr_dns_txt.lng +++ b/interface/web/dns/lib/lang/fr_dns_txt.lng @@ -1,16 +1,16 @@ - - + + diff --git a/interface/web/dns/lib/lang/fr_dns_wizard.lng b/interface/web/dns/lib/lang/fr_dns_wizard.lng index 7ef4411b8..00dd9839c 100644 --- a/interface/web/dns/lib/lang/fr_dns_wizard.lng +++ b/interface/web/dns/lib/lang/fr_dns_wizard.lng @@ -1,30 +1,30 @@ - - + + diff --git a/interface/web/domain/lib/lang/fr.lng b/interface/web/domain/lib/lang/fr.lng index 8e769cc41..bf171dbdd 100644 --- a/interface/web/domain/lib/lang/fr.lng +++ b/interface/web/domain/lib/lang/fr.lng @@ -1,10 +1,10 @@ -'; -?> - +'; +?> + diff --git a/interface/web/domain/lib/lang/fr_domain.lng b/interface/web/domain/lib/lang/fr_domain.lng index d6e689e82..5658a19a9 100644 --- a/interface/web/domain/lib/lang/fr_domain.lng +++ b/interface/web/domain/lib/lang/fr_domain.lng @@ -1,7 +1,7 @@ - - + + diff --git a/interface/web/domain/lib/lang/fr_domain_list.lng b/interface/web/domain/lib/lang/fr_domain_list.lng index a431f877e..f73cb556e 100644 --- a/interface/web/domain/lib/lang/fr_domain_list.lng +++ b/interface/web/domain/lib/lang/fr_domain_list.lng @@ -1,6 +1,6 @@ - - + + diff --git a/interface/web/help/lib/lang/fr.lng b/interface/web/help/lib/lang/fr.lng index 25eec0abe..3c08f2a2e 100644 --- a/interface/web/help/lib/lang/fr.lng +++ b/interface/web/help/lib/lang/fr.lng @@ -1,10 +1,10 @@ - - + + diff --git a/interface/web/help/lib/lang/fr_support_message.lng b/interface/web/help/lib/lang/fr_support_message.lng index 01b5b19dd..9d7eab163 100644 --- a/interface/web/help/lib/lang/fr_support_message.lng +++ b/interface/web/help/lib/lang/fr_support_message.lng @@ -1,8 +1,8 @@ - - + + diff --git a/interface/web/help/lib/lang/fr_support_message_list.lng b/interface/web/help/lib/lang/fr_support_message_list.lng index 358b5e1ca..cfa461086 100644 --- a/interface/web/help/lib/lang/fr_support_message_list.lng +++ b/interface/web/help/lib/lang/fr_support_message_list.lng @@ -1,7 +1,7 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr.lng b/interface/web/mail/lib/lang/fr.lng index 637ebca95..6a437b7f9 100644 --- a/interface/web/mail/lib/lang/fr.lng +++ b/interface/web/mail/lib/lang/fr.lng @@ -1,48 +1,48 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_alias.lng b/interface/web/mail/lib/lang/fr_mail_alias.lng index 8a1a5eb9a..423d2ae2e 100644 --- a/interface/web/mail/lib/lang/fr_mail_alias.lng +++ b/interface/web/mail/lib/lang/fr_mail_alias.lng @@ -1,12 +1,12 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_alias_list.lng b/interface/web/mail/lib/lang/fr_mail_alias_list.lng index 0e28b1e9b..cb88394d2 100644 --- a/interface/web/mail/lib/lang/fr_mail_alias_list.lng +++ b/interface/web/mail/lib/lang/fr_mail_alias_list.lng @@ -1,9 +1,9 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_aliasdomain.lng b/interface/web/mail/lib/lang/fr_mail_aliasdomain.lng index 8855ee794..c59aaa961 100644 --- a/interface/web/mail/lib/lang/fr_mail_aliasdomain.lng +++ b/interface/web/mail/lib/lang/fr_mail_aliasdomain.lng @@ -1,12 +1,12 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_aliasdomain_list.lng b/interface/web/mail/lib/lang/fr_mail_aliasdomain_list.lng index 8f0999dc0..e9615443e 100644 --- a/interface/web/mail/lib/lang/fr_mail_aliasdomain_list.lng +++ b/interface/web/mail/lib/lang/fr_mail_aliasdomain_list.lng @@ -1,8 +1,8 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_blacklist.lng b/interface/web/mail/lib/lang/fr_mail_blacklist.lng index a2f1e1315..ba70338c7 100644 --- a/interface/web/mail/lib/lang/fr_mail_blacklist.lng +++ b/interface/web/mail/lib/lang/fr_mail_blacklist.lng @@ -1,10 +1,10 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_blacklist_list.lng b/interface/web/mail/lib/lang/fr_mail_blacklist_list.lng index b9158ec7e..a2e698cac 100644 --- a/interface/web/mail/lib/lang/fr_mail_blacklist_list.lng +++ b/interface/web/mail/lib/lang/fr_mail_blacklist_list.lng @@ -1,11 +1,11 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_content_filter.lng b/interface/web/mail/lib/lang/fr_mail_content_filter.lng index 0097ce152..2eadb4b11 100644 --- a/interface/web/mail/lib/lang/fr_mail_content_filter.lng +++ b/interface/web/mail/lib/lang/fr_mail_content_filter.lng @@ -1,10 +1,10 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_content_filter_list.lng b/interface/web/mail/lib/lang/fr_mail_content_filter_list.lng index 184401bdd..89774dff6 100644 --- a/interface/web/mail/lib/lang/fr_mail_content_filter_list.lng +++ b/interface/web/mail/lib/lang/fr_mail_content_filter_list.lng @@ -1,9 +1,9 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_domain.lng b/interface/web/mail/lib/lang/fr_mail_domain.lng index dc77e9ca2..5584326ff 100644 --- a/interface/web/mail/lib/lang/fr_mail_domain.lng +++ b/interface/web/mail/lib/lang/fr_mail_domain.lng @@ -1,14 +1,14 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_domain_admin_list.lng b/interface/web/mail/lib/lang/fr_mail_domain_admin_list.lng index b3f1bec4f..87ae9706a 100644 --- a/interface/web/mail/lib/lang/fr_mail_domain_admin_list.lng +++ b/interface/web/mail/lib/lang/fr_mail_domain_admin_list.lng @@ -1,9 +1,9 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_domain_catchall.lng b/interface/web/mail/lib/lang/fr_mail_domain_catchall.lng index 0f973bf11..fdc59c4a6 100644 --- a/interface/web/mail/lib/lang/fr_mail_domain_catchall.lng +++ b/interface/web/mail/lib/lang/fr_mail_domain_catchall.lng @@ -1,10 +1,10 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_domain_catchall_list.lng b/interface/web/mail/lib/lang/fr_mail_domain_catchall_list.lng index 57281c689..41833df40 100644 --- a/interface/web/mail/lib/lang/fr_mail_domain_catchall_list.lng +++ b/interface/web/mail/lib/lang/fr_mail_domain_catchall_list.lng @@ -1,10 +1,10 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_domain_list.lng b/interface/web/mail/lib/lang/fr_mail_domain_list.lng index 6419abb49..f0897b58e 100644 --- a/interface/web/mail/lib/lang/fr_mail_domain_list.lng +++ b/interface/web/mail/lib/lang/fr_mail_domain_list.lng @@ -1,8 +1,8 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_forward.lng b/interface/web/mail/lib/lang/fr_mail_forward.lng index 23270ccb4..4672e693a 100644 --- a/interface/web/mail/lib/lang/fr_mail_forward.lng +++ b/interface/web/mail/lib/lang/fr_mail_forward.lng @@ -1,8 +1,8 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_forward_list.lng b/interface/web/mail/lib/lang/fr_mail_forward_list.lng index 608372013..c5373a893 100644 --- a/interface/web/mail/lib/lang/fr_mail_forward_list.lng +++ b/interface/web/mail/lib/lang/fr_mail_forward_list.lng @@ -1,9 +1,9 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_get.lng b/interface/web/mail/lib/lang/fr_mail_get.lng index 8d69849fb..33be0e99d 100644 --- a/interface/web/mail/lib/lang/fr_mail_get.lng +++ b/interface/web/mail/lib/lang/fr_mail_get.lng @@ -1,17 +1,17 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_get_list.lng b/interface/web/mail/lib/lang/fr_mail_get_list.lng index 590fc9c5c..4f3be03bf 100644 --- a/interface/web/mail/lib/lang/fr_mail_get_list.lng +++ b/interface/web/mail/lib/lang/fr_mail_get_list.lng @@ -1,10 +1,10 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_relay_recipient.lng b/interface/web/mail/lib/lang/fr_mail_relay_recipient.lng index f714d76e6..9f01efbbb 100644 --- a/interface/web/mail/lib/lang/fr_mail_relay_recipient.lng +++ b/interface/web/mail/lib/lang/fr_mail_relay_recipient.lng @@ -1,10 +1,10 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_relay_recipient_list.lng b/interface/web/mail/lib/lang/fr_mail_relay_recipient_list.lng index 834d047ca..96ee42dcb 100644 --- a/interface/web/mail/lib/lang/fr_mail_relay_recipient_list.lng +++ b/interface/web/mail/lib/lang/fr_mail_relay_recipient_list.lng @@ -1,10 +1,10 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_spamfilter.lng b/interface/web/mail/lib/lang/fr_mail_spamfilter.lng index 958435ffc..dc1c23716 100644 --- a/interface/web/mail/lib/lang/fr_mail_spamfilter.lng +++ b/interface/web/mail/lib/lang/fr_mail_spamfilter.lng @@ -1,18 +1,18 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_spamfilter_list.lng b/interface/web/mail/lib/lang/fr_mail_spamfilter_list.lng index 33edceb88..217860b98 100644 --- a/interface/web/mail/lib/lang/fr_mail_spamfilter_list.lng +++ b/interface/web/mail/lib/lang/fr_mail_spamfilter_list.lng @@ -1,9 +1,9 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_transport.lng b/interface/web/mail/lib/lang/fr_mail_transport.lng index 2e8d58875..bfa35e654 100644 --- a/interface/web/mail/lib/lang/fr_mail_transport.lng +++ b/interface/web/mail/lib/lang/fr_mail_transport.lng @@ -1,11 +1,11 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_transport_list.lng b/interface/web/mail/lib/lang/fr_mail_transport_list.lng index 05eede3a1..5814d0b90 100644 --- a/interface/web/mail/lib/lang/fr_mail_transport_list.lng +++ b/interface/web/mail/lib/lang/fr_mail_transport_list.lng @@ -1,10 +1,10 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_user.lng b/interface/web/mail/lib/lang/fr_mail_user.lng index bb8831a80..b2d376427 100644 --- a/interface/web/mail/lib/lang/fr_mail_user.lng +++ b/interface/web/mail/lib/lang/fr_mail_user.lng @@ -1,43 +1,43 @@ - 1'; -$wb['move_junk_txt'] = 'Déplacer le spam vers le dossier pourris'; -$wb['name_txt'] = 'Nom véritable'; -$wb['name_optional_txt'] = '(Optionnel)'; -$wb['autoresponder_active'] = 'Activer l\'autorépondeur'; -$wb['cc_txt'] = 'Envoyer une copie à'; -$wb['cc_error_isemail'] = 'Le champ Envoyer une copie ne contient pas une adresse email valide'; -?> - + 1'; +$wb['move_junk_txt'] = 'Déplacer le spam vers le dossier pourris'; +$wb['name_txt'] = 'Nom véritable'; +$wb['name_optional_txt'] = '(Optionnel)'; +$wb['autoresponder_active'] = 'Activer l\'autorépondeur'; +$wb['cc_txt'] = 'Envoyer une copie à'; +$wb['cc_error_isemail'] = 'Le champ Envoyer une copie ne contient pas une adresse email valide'; +?> + diff --git a/interface/web/mail/lib/lang/fr_mail_user_filter.lng b/interface/web/mail/lib/lang/fr_mail_user_filter.lng index 4e4bb57cf..0f512903c 100644 --- a/interface/web/mail/lib/lang/fr_mail_user_filter.lng +++ b/interface/web/mail/lib/lang/fr_mail_user_filter.lng @@ -1,12 +1,12 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_user_filter_list.lng b/interface/web/mail/lib/lang/fr_mail_user_filter_list.lng index dbe3ea93b..237a2b806 100644 --- a/interface/web/mail/lib/lang/fr_mail_user_filter_list.lng +++ b/interface/web/mail/lib/lang/fr_mail_user_filter_list.lng @@ -1,8 +1,8 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_user_list.lng b/interface/web/mail/lib/lang/fr_mail_user_list.lng index 01241d3d0..58039d5cc 100644 --- a/interface/web/mail/lib/lang/fr_mail_user_list.lng +++ b/interface/web/mail/lib/lang/fr_mail_user_list.lng @@ -1,8 +1,8 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_user_stats_list.lng b/interface/web/mail/lib/lang/fr_mail_user_stats_list.lng index 9a1f844ea..195c6b81f 100644 --- a/interface/web/mail/lib/lang/fr_mail_user_stats_list.lng +++ b/interface/web/mail/lib/lang/fr_mail_user_stats_list.lng @@ -1,9 +1,9 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_whitelist.lng b/interface/web/mail/lib/lang/fr_mail_whitelist.lng index 00bab6f94..c3dbc6768 100644 --- a/interface/web/mail/lib/lang/fr_mail_whitelist.lng +++ b/interface/web/mail/lib/lang/fr_mail_whitelist.lng @@ -1,10 +1,10 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_mail_whitelist_list.lng b/interface/web/mail/lib/lang/fr_mail_whitelist_list.lng index 20e49cf05..2be47e556 100644 --- a/interface/web/mail/lib/lang/fr_mail_whitelist_list.lng +++ b/interface/web/mail/lib/lang/fr_mail_whitelist_list.lng @@ -1,11 +1,11 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_spamfilter_blacklist.lng b/interface/web/mail/lib/lang/fr_spamfilter_blacklist.lng index 279db539a..86f91d687 100644 --- a/interface/web/mail/lib/lang/fr_spamfilter_blacklist.lng +++ b/interface/web/mail/lib/lang/fr_spamfilter_blacklist.lng @@ -1,10 +1,10 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_spamfilter_blacklist_list.lng b/interface/web/mail/lib/lang/fr_spamfilter_blacklist_list.lng index 14d086eaa..c915c814e 100644 --- a/interface/web/mail/lib/lang/fr_spamfilter_blacklist_list.lng +++ b/interface/web/mail/lib/lang/fr_spamfilter_blacklist_list.lng @@ -1,10 +1,10 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_spamfilter_config.lng b/interface/web/mail/lib/lang/fr_spamfilter_config.lng index bfdca7060..6cd09cde3 100644 --- a/interface/web/mail/lib/lang/fr_spamfilter_config.lng +++ b/interface/web/mail/lib/lang/fr_spamfilter_config.lng @@ -1,21 +1,21 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_spamfilter_config_list.lng b/interface/web/mail/lib/lang/fr_spamfilter_config_list.lng index 812ba85a4..03f09d139 100644 --- a/interface/web/mail/lib/lang/fr_spamfilter_config_list.lng +++ b/interface/web/mail/lib/lang/fr_spamfilter_config_list.lng @@ -1,6 +1,6 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_spamfilter_policy.lng b/interface/web/mail/lib/lang/fr_spamfilter_policy.lng index bc0d939ec..432246060 100644 --- a/interface/web/mail/lib/lang/fr_spamfilter_policy.lng +++ b/interface/web/mail/lib/lang/fr_spamfilter_policy.lng @@ -1,39 +1,39 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_spamfilter_policy_list.lng b/interface/web/mail/lib/lang/fr_spamfilter_policy_list.lng index 27a1a20e2..2269111b3 100644 --- a/interface/web/mail/lib/lang/fr_spamfilter_policy_list.lng +++ b/interface/web/mail/lib/lang/fr_spamfilter_policy_list.lng @@ -1,10 +1,10 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_spamfilter_users.lng b/interface/web/mail/lib/lang/fr_spamfilter_users.lng index 93e92156b..9f29ef066 100644 --- a/interface/web/mail/lib/lang/fr_spamfilter_users.lng +++ b/interface/web/mail/lib/lang/fr_spamfilter_users.lng @@ -1,9 +1,9 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_spamfilter_users_list.lng b/interface/web/mail/lib/lang/fr_spamfilter_users_list.lng index 82509ec75..81dc8d827 100644 --- a/interface/web/mail/lib/lang/fr_spamfilter_users_list.lng +++ b/interface/web/mail/lib/lang/fr_spamfilter_users_list.lng @@ -1,11 +1,11 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_spamfilter_whitelist.lng b/interface/web/mail/lib/lang/fr_spamfilter_whitelist.lng index f318d823f..67b7efc43 100644 --- a/interface/web/mail/lib/lang/fr_spamfilter_whitelist.lng +++ b/interface/web/mail/lib/lang/fr_spamfilter_whitelist.lng @@ -1,10 +1,10 @@ - - + + diff --git a/interface/web/mail/lib/lang/fr_spamfilter_whitelist_list.lng b/interface/web/mail/lib/lang/fr_spamfilter_whitelist_list.lng index 20a18f0de..ea298b842 100644 --- a/interface/web/mail/lib/lang/fr_spamfilter_whitelist_list.lng +++ b/interface/web/mail/lib/lang/fr_spamfilter_whitelist_list.lng @@ -1,10 +1,10 @@ - - + + diff --git a/interface/web/monitor/lib/lang/fr.lng b/interface/web/monitor/lib/lang/fr.lng index 4c9d81247..4974aade4 100644 --- a/interface/web/monitor/lib/lang/fr.lng +++ b/interface/web/monitor/lib/lang/fr.lng @@ -1,146 +1,146 @@ -Nous n\'avaons pas trouvé ces logiciels sur votre serveur.

Ceci implique que nous ne pouvons pas encore prendre en charge votre RAID.'; -$wb['monitor_serverstate_beancounterok_txt'] = 'Le compteur ok'; -$wb['monitor_serverstate_beancounterinfo_txt'] = 'Il y a quelques échecs dans le compteur'; -$wb['monitor_serverstate_beancounterwarning_txt'] = 'Il y a des échecs dans le compteur'; -$wb['monitor_serverstate_beancountercritical_txt'] = 'Il y a beaucoup d\'échecs dans le compteur'; -$wb['monitor_serverstate_beancountererror_txt'] = 'Il y a trop d\'échecs dans le compteur'; -$wb['monitor_title_fail2ban_txt'] = 'Log Fail2Ban'; -$wb['monitor_title_beancounter_txt'] = 'Compteur OpenVz VE'; -$wb['monitor_beancounter_nosupport_txt'] = 'Ce serveur n\'est pas un VE OpenVz et n\'a pas d\'information de compteur'; -?> - +Nous n\'avaons pas trouvé ces logiciels sur votre serveur.

Ceci implique que nous ne pouvons pas encore prendre en charge votre RAID.'; +$wb['monitor_serverstate_beancounterok_txt'] = 'Le compteur ok'; +$wb['monitor_serverstate_beancounterinfo_txt'] = 'Il y a quelques échecs dans le compteur'; +$wb['monitor_serverstate_beancounterwarning_txt'] = 'Il y a des échecs dans le compteur'; +$wb['monitor_serverstate_beancountercritical_txt'] = 'Il y a beaucoup d\'échecs dans le compteur'; +$wb['monitor_serverstate_beancountererror_txt'] = 'Il y a trop d\'échecs dans le compteur'; +$wb['monitor_title_fail2ban_txt'] = 'Log Fail2Ban'; +$wb['monitor_title_beancounter_txt'] = 'Compteur OpenVz VE'; +$wb['monitor_beancounter_nosupport_txt'] = 'Ce serveur n\'est pas un VE OpenVz et n\'a pas d\'information de compteur'; +?> + diff --git a/interface/web/monitor/lib/lang/fr_datalog_list.lng b/interface/web/monitor/lib/lang/fr_datalog_list.lng index e30a334bb..111b6d12f 100644 --- a/interface/web/monitor/lib/lang/fr_datalog_list.lng +++ b/interface/web/monitor/lib/lang/fr_datalog_list.lng @@ -1,9 +1,9 @@ - - + + diff --git a/interface/web/monitor/lib/lang/fr_syslog_list.lng b/interface/web/monitor/lib/lang/fr_syslog_list.lng index 166e7cd95..9ca1f5939 100644 --- a/interface/web/monitor/lib/lang/fr_syslog_list.lng +++ b/interface/web/monitor/lib/lang/fr_syslog_list.lng @@ -1,8 +1,8 @@ - - + + diff --git a/interface/web/remote/monitor.php b/interface/web/remote/monitor.php index c7a69f61e..2f35105d4 100644 --- a/interface/web/remote/monitor.php +++ b/interface/web/remote/monitor.php @@ -1,126 +1,126 @@ -error('This function is disabled in demo mode.'); - -header('Content-Type: application/json; charset=utf-8'); -header('Access-Control-Allow-Origin: *'); -header('Access-Control-Allow-Headers: X-Requested-With'); -header('Cache-Control: no-cache, must-revalidate'); // HTTP/1.1 -header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past - -$type = addslashes($_GET['type']); -$token = addslashes($_GET['token']); -$server_id = intval($_GET['server']); - -$app->uses('getconf'); -$interface_config = $app->getconf->get_global_config('misc'); -$secret = $interface_config['monitor_key']; - -$out = array(); - -if($token == '' or $secret == '' or $token != $secret) { - $out['state'] = 'syserror'; - $out['data'] = 'Password empty or incorrect.'; - $out['time'] = date('Y-m-d H:i'); -} else { - if($type == 'serverlist') { - $sql = 'SELECT server_id, server_name FROM server WHERE 1 ORDER BY server_id'; - $records = $app->db->queryAllRecords($sql); - $out['state'] = 'ok'; - $out['data'] = $records; - $out['time'] = date('Y-m-d H:i',$rec['created']); - } else { - $rec = $app->db->queryOneRecord("SELECT * FROM monitor_data WHERE type = '$type' AND server_id = $server_id"); - if(is_array($rec)) { - $out['state'] = $rec['state']; - $out['data'] = unserialize(stripslashes($rec['data'])); - if(is_array($out['data']) && sizeof($out['data']) > 0){ - foreach($out['data'] as $key => $val){ - if(!$val) $out['data'][$key] = " "; - } - } - $out['time'] = date('Y-m-d H:i',$rec['created']); - } else { - $out['state'] = 'syserror'; - $out['data'] = 'No monitor record found.'; - $out['time'] = date('Y-m-d H:i'); - } - $sql = 'SELECT server_id, server_name FROM server WHERE 1 ORDER BY server_id'; - $records = $app->db->queryAllRecords($sql); - $out['serverlist'] = $records; - } -} -$out['type'] = $type; - -function __json_encode($data) { - if( is_array($data) || is_object($data) ) { - $islist = is_array($data) && ( empty($data) || array_keys($data) === range(0,count($data)-1) ); - - if( $islist ) { - $json = '[' . implode(',', array_map('__json_encode', $data) ) . ']'; - } else { - $items = Array(); - foreach( $data as $key => $value ) { - $items[] = __json_encode("$key") . ':' . __json_encode($value); - } - $json = '{' . implode(',', $items) . '}'; - } - } elseif( is_string($data) ) { - # Escape non-printable or Non-ASCII characters. - # I also put the \\ character first, as suggested in comments on the 'addcslashes' page. - $string = '"' . addcslashes($data, "\\\"\n\r\t/" . chr(8) . chr(12)) . '"'; - $json = ''; - $len = strlen($string); - # Convert UTF-8 to Hexadecimal Codepoints. - for( $i = 0; $i < $len; $i++ ) { - - $char = $string[$i]; - $c1 = ord($char); - - # Single byte; - if( $c1 <128 ) { - $json .= ($c1 > 31) ? $char : sprintf("\\u%04x", $c1); - continue; - } - - # Double byte - $c2 = ord($string[++$i]); - if ( ($c1 & 32) === 0 ) { - $json .= sprintf("\\u%04x", ($c1 - 192) * 64 + $c2 - 128); - continue; - } - - # Triple - $c3 = ord($string[++$i]); - if( ($c1 & 16) === 0 ) { - $json .= sprintf("\\u%04x", (($c1 - 224) <<12) + (($c2 - 128) << 6) + ($c3 - 128)); - continue; - } - - # Quadruple - $c4 = ord($string[++$i]); - if( ($c1 & 8 ) === 0 ) { - $u = (($c1 & 15) << 2) + (($c2>>4) & 3) - 1; - - $w1 = (54<<10) + ($u<<6) + (($c2 & 15) << 2) + (($c3>>4) & 3); - $w2 = (55<<10) + (($c3 & 15)<<6) + ($c4-128); - $json .= sprintf("\\u%04x\\u%04x", $w1, $w2); - } - } - } else { - # int, floats, bools, null - $json = strtolower(var_export( $data, true )); - } - return $json; -} - -if(function_exists('json_encode')) { // PHP >= 5.2 - echo json_encode($out); -} else { // PHP < 5.2 - echo __json_encode($out); -} -exit; +error('This function is disabled in demo mode.'); + +header('Content-Type: application/json; charset=utf-8'); +header('Access-Control-Allow-Origin: *'); +header('Access-Control-Allow-Headers: X-Requested-With'); +header('Cache-Control: no-cache, must-revalidate'); // HTTP/1.1 +header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past + +$type = addslashes($_GET['type']); +$token = addslashes($_GET['token']); +$server_id = intval($_GET['server']); + +$app->uses('getconf'); +$interface_config = $app->getconf->get_global_config('misc'); +$secret = $interface_config['monitor_key']; + +$out = array(); + +if($token == '' or $secret == '' or $token != $secret) { + $out['state'] = 'syserror'; + $out['data'] = 'Password empty or incorrect.'; + $out['time'] = date('Y-m-d H:i'); +} else { + if($type == 'serverlist') { + $sql = 'SELECT server_id, server_name FROM server WHERE 1 ORDER BY server_id'; + $records = $app->db->queryAllRecords($sql); + $out['state'] = 'ok'; + $out['data'] = $records; + $out['time'] = date('Y-m-d H:i',$rec['created']); + } else { + $rec = $app->db->queryOneRecord("SELECT * FROM monitor_data WHERE type = '$type' AND server_id = $server_id"); + if(is_array($rec)) { + $out['state'] = $rec['state']; + $out['data'] = unserialize(stripslashes($rec['data'])); + if(is_array($out['data']) && sizeof($out['data']) > 0){ + foreach($out['data'] as $key => $val){ + if(!$val) $out['data'][$key] = " "; + } + } + $out['time'] = date('Y-m-d H:i',$rec['created']); + } else { + $out['state'] = 'syserror'; + $out['data'] = 'No monitor record found.'; + $out['time'] = date('Y-m-d H:i'); + } + $sql = 'SELECT server_id, server_name FROM server WHERE 1 ORDER BY server_id'; + $records = $app->db->queryAllRecords($sql); + $out['serverlist'] = $records; + } +} +$out['type'] = $type; + +function __json_encode($data) { + if( is_array($data) || is_object($data) ) { + $islist = is_array($data) && ( empty($data) || array_keys($data) === range(0,count($data)-1) ); + + if( $islist ) { + $json = '[' . implode(',', array_map('__json_encode', $data) ) . ']'; + } else { + $items = Array(); + foreach( $data as $key => $value ) { + $items[] = __json_encode("$key") . ':' . __json_encode($value); + } + $json = '{' . implode(',', $items) . '}'; + } + } elseif( is_string($data) ) { + # Escape non-printable or Non-ASCII characters. + # I also put the \\ character first, as suggested in comments on the 'addcslashes' page. + $string = '"' . addcslashes($data, "\\\"\n\r\t/" . chr(8) . chr(12)) . '"'; + $json = ''; + $len = strlen($string); + # Convert UTF-8 to Hexadecimal Codepoints. + for( $i = 0; $i < $len; $i++ ) { + + $char = $string[$i]; + $c1 = ord($char); + + # Single byte; + if( $c1 <128 ) { + $json .= ($c1 > 31) ? $char : sprintf("\\u%04x", $c1); + continue; + } + + # Double byte + $c2 = ord($string[++$i]); + if ( ($c1 & 32) === 0 ) { + $json .= sprintf("\\u%04x", ($c1 - 192) * 64 + $c2 - 128); + continue; + } + + # Triple + $c3 = ord($string[++$i]); + if( ($c1 & 16) === 0 ) { + $json .= sprintf("\\u%04x", (($c1 - 224) <<12) + (($c2 - 128) << 6) + ($c3 - 128)); + continue; + } + + # Quadruple + $c4 = ord($string[++$i]); + if( ($c1 & 8 ) === 0 ) { + $u = (($c1 & 15) << 2) + (($c2>>4) & 3) - 1; + + $w1 = (54<<10) + ($u<<6) + (($c2 & 15) << 2) + (($c3>>4) & 3); + $w2 = (55<<10) + (($c3 & 15)<<6) + ($c4-128); + $json .= sprintf("\\u%04x\\u%04x", $w1, $w2); + } + } + } else { + # int, floats, bools, null + $json = strtolower(var_export( $data, true )); + } + return $json; +} + +if(function_exists('json_encode')) { // PHP >= 5.2 + echo json_encode($out); +} else { // PHP < 5.2 + echo __json_encode($out); +} +exit; ?> \ No newline at end of file diff --git a/interface/web/sites/lib/lang/fr.lng b/interface/web/sites/lib/lang/fr.lng index 6757337dc..082750a3f 100644 --- a/interface/web/sites/lib/lang/fr.lng +++ b/interface/web/sites/lib/lang/fr.lng @@ -1,26 +1,26 @@ - - + + diff --git a/interface/web/sites/lib/lang/fr_cron.lng b/interface/web/sites/lib/lang/fr_cron.lng index 4c3ba5c21..d15b2dfad 100644 --- a/interface/web/sites/lib/lang/fr_cron.lng +++ b/interface/web/sites/lib/lang/fr_cron.lng @@ -1,22 +1,22 @@ - - + + diff --git a/interface/web/sites/lib/lang/fr_cron_list.lng b/interface/web/sites/lib/lang/fr_cron_list.lng index ad652c62d..78faabf4d 100644 --- a/interface/web/sites/lib/lang/fr_cron_list.lng +++ b/interface/web/sites/lib/lang/fr_cron_list.lng @@ -1,13 +1,13 @@ - - + + diff --git a/interface/web/sites/lib/lang/fr_database.lng b/interface/web/sites/lib/lang/fr_database.lng index f29ea4a20..3bcd0b144 100644 --- a/interface/web/sites/lib/lang/fr_database.lng +++ b/interface/web/sites/lib/lang/fr_database.lng @@ -1,26 +1,26 @@ - - + + diff --git a/interface/web/sites/lib/lang/fr_database_admin_list.lng b/interface/web/sites/lib/lang/fr_database_admin_list.lng index 28a6f9f86..cca33739f 100644 --- a/interface/web/sites/lib/lang/fr_database_admin_list.lng +++ b/interface/web/sites/lib/lang/fr_database_admin_list.lng @@ -1,11 +1,11 @@ - - + + diff --git a/interface/web/sites/lib/lang/fr_database_list.lng b/interface/web/sites/lib/lang/fr_database_list.lng index 2a875dd1c..6ceba6ec8 100644 --- a/interface/web/sites/lib/lang/fr_database_list.lng +++ b/interface/web/sites/lib/lang/fr_database_list.lng @@ -1,10 +1,10 @@ - - + + diff --git a/interface/web/sites/lib/lang/fr_ftp_user.lng b/interface/web/sites/lib/lang/fr_ftp_user.lng index 1921d8e69..0ade08ea8 100644 --- a/interface/web/sites/lib/lang/fr_ftp_user.lng +++ b/interface/web/sites/lib/lang/fr_ftp_user.lng @@ -1,29 +1,29 @@ - 0'; -?> - + 0'; +?> + diff --git a/interface/web/sites/lib/lang/fr_ftp_user_list.lng b/interface/web/sites/lib/lang/fr_ftp_user_list.lng index 8cf91cfd2..468201de0 100644 --- a/interface/web/sites/lib/lang/fr_ftp_user_list.lng +++ b/interface/web/sites/lib/lang/fr_ftp_user_list.lng @@ -1,9 +1,9 @@ - - + + diff --git a/interface/web/sites/lib/lang/fr_shell_user.lng b/interface/web/sites/lib/lang/fr_shell_user.lng index 65efda42e..753d1378b 100644 --- a/interface/web/sites/lib/lang/fr_shell_user.lng +++ b/interface/web/sites/lib/lang/fr_shell_user.lng @@ -1,23 +1,23 @@ - - + + diff --git a/interface/web/sites/lib/lang/fr_shell_user_list.lng b/interface/web/sites/lib/lang/fr_shell_user_list.lng index 888ec5f93..a5cc29a40 100644 --- a/interface/web/sites/lib/lang/fr_shell_user_list.lng +++ b/interface/web/sites/lib/lang/fr_shell_user_list.lng @@ -1,9 +1,9 @@ - - + + diff --git a/interface/web/sites/lib/lang/fr_user_quota_stats_list.lng b/interface/web/sites/lib/lang/fr_user_quota_stats_list.lng index d8f3a3214..106b3e9af 100644 --- a/interface/web/sites/lib/lang/fr_user_quota_stats_list.lng +++ b/interface/web/sites/lib/lang/fr_user_quota_stats_list.lng @@ -1,9 +1,9 @@ - - + + diff --git a/interface/web/sites/lib/lang/fr_web_aliasdomain_list.lng b/interface/web/sites/lib/lang/fr_web_aliasdomain_list.lng index a7bd62e89..50d3bd289 100644 --- a/interface/web/sites/lib/lang/fr_web_aliasdomain_list.lng +++ b/interface/web/sites/lib/lang/fr_web_aliasdomain_list.lng @@ -1,12 +1,12 @@ - - + + diff --git a/interface/web/sites/lib/lang/fr_web_domain.lng b/interface/web/sites/lib/lang/fr_web_domain.lng index 850c2f922..152dbec50 100644 --- a/interface/web/sites/lib/lang/fr_web_domain.lng +++ b/interface/web/sites/lib/lang/fr_web_domain.lng @@ -1,71 +1,71 @@ - 0'; -$wb['traffic_quota_error_regex'] = 'Quota de trafic: entrez -1 pour illimité ou un nombre > 0'; -?> - + 0'; +$wb['traffic_quota_error_regex'] = 'Quota de trafic: entrez -1 pour illimité ou un nombre > 0'; +?> + diff --git a/interface/web/sites/lib/lang/fr_web_domain_admin_list.lng b/interface/web/sites/lib/lang/fr_web_domain_admin_list.lng index 413c36496..bb8f1a1a0 100644 --- a/interface/web/sites/lib/lang/fr_web_domain_admin_list.lng +++ b/interface/web/sites/lib/lang/fr_web_domain_admin_list.lng @@ -1,10 +1,10 @@ - - + + diff --git a/interface/web/sites/lib/lang/fr_web_domain_list.lng b/interface/web/sites/lib/lang/fr_web_domain_list.lng index 306c6d1dc..f59495cc5 100644 --- a/interface/web/sites/lib/lang/fr_web_domain_list.lng +++ b/interface/web/sites/lib/lang/fr_web_domain_list.lng @@ -1,9 +1,9 @@ - - + + diff --git a/interface/web/sites/lib/lang/fr_web_sites_stats_list.lng b/interface/web/sites/lib/lang/fr_web_sites_stats_list.lng index 39f98eef3..4c91b7d33 100644 --- a/interface/web/sites/lib/lang/fr_web_sites_stats_list.lng +++ b/interface/web/sites/lib/lang/fr_web_sites_stats_list.lng @@ -1,9 +1,9 @@ - - + + diff --git a/interface/web/sites/lib/lang/fr_web_subdomain.lng b/interface/web/sites/lib/lang/fr_web_subdomain.lng index 93e038c93..7264aec77 100644 --- a/interface/web/sites/lib/lang/fr_web_subdomain.lng +++ b/interface/web/sites/lib/lang/fr_web_subdomain.lng @@ -1,41 +1,41 @@ - - + + diff --git a/interface/web/sites/lib/lang/fr_web_subdomain_list.lng b/interface/web/sites/lib/lang/fr_web_subdomain_list.lng index c8230d4a9..592464c15 100644 --- a/interface/web/sites/lib/lang/fr_web_subdomain_list.lng +++ b/interface/web/sites/lib/lang/fr_web_subdomain_list.lng @@ -1,9 +1,9 @@ - - + + diff --git a/interface/web/sites/lib/lang/fr_webdav_user.lng b/interface/web/sites/lib/lang/fr_webdav_user.lng index 0eb333227..01008281c 100644 --- a/interface/web/sites/lib/lang/fr_webdav_user.lng +++ b/interface/web/sites/lib/lang/fr_webdav_user.lng @@ -1,16 +1,16 @@ - - + + diff --git a/interface/web/sites/lib/lang/fr_webdav_user_list.lng b/interface/web/sites/lib/lang/fr_webdav_user_list.lng index 4ceedd7fc..88bb7fa86 100644 --- a/interface/web/sites/lib/lang/fr_webdav_user_list.lng +++ b/interface/web/sites/lib/lang/fr_webdav_user_list.lng @@ -1,9 +1,9 @@ - - + + diff --git a/interface/web/strengthmeter/lib/lang/fr_strengthmeter.lng b/interface/web/strengthmeter/lib/lang/fr_strengthmeter.lng index f64de79ae..91804fc5c 100644 --- a/interface/web/strengthmeter/lib/lang/fr_strengthmeter.lng +++ b/interface/web/strengthmeter/lib/lang/fr_strengthmeter.lng @@ -1,9 +1,9 @@ - - + + diff --git a/interface/web/tools/lib/lang/fr.lng b/interface/web/tools/lib/lang/fr.lng index 56d46fd5e..aad891629 100644 --- a/interface/web/tools/lib/lang/fr.lng +++ b/interface/web/tools/lib/lang/fr.lng @@ -1,7 +1,7 @@ - - + + diff --git a/interface/web/tools/lib/lang/fr_usersettings.lng b/interface/web/tools/lib/lang/fr_usersettings.lng index a84cdc7e3..b37da7c9e 100644 --- a/interface/web/tools/lib/lang/fr_usersettings.lng +++ b/interface/web/tools/lib/lang/fr_usersettings.lng @@ -1,9 +1,9 @@ - - + + diff --git a/server/conf/nginx_rewrites.conf.master b/server/conf/nginx_rewrites.conf.master index b5d2ad55a..c9080a7e3 100644 --- a/server/conf/nginx_rewrites.conf.master +++ b/server/conf/nginx_rewrites.conf.master @@ -1,9 +1,9 @@ -server { - listen 80 default_server; - listen 443 default_server; - server_name _; - include /etc/nginx/proxy.conf; - - rewrite ^{tmpl_var name="rewrite_url_src"} {tmpl_var name="rewrite_url_dst"}; - -} +server { + listen 80 default_server; + listen 443 default_server; + server_name _; + include /etc/nginx/proxy.conf; + + rewrite ^{tmpl_var name="rewrite_url_src"} {tmpl_var name="rewrite_url_dst"}; + +} diff --git a/server/conf/nginx_vhost.conf.master b/server/conf/nginx_vhost.conf.master index 83ed251b5..40df89509 100644 --- a/server/conf/nginx_vhost.conf.master +++ b/server/conf/nginx_vhost.conf.master @@ -1,69 +1,69 @@ -server { - listen 80; - server_name ; - - access_log /var/log/ispconfig/nginx//access.log; - error_log /var/log/ispconfig/nginx//error.log; - - include /etc/nginx/proxy.conf; - - location / { - proxy_pass http://:80; - } - - location ~* \.(jpg|png|gif|jpeg|css|js|mp3|wav|swf|mov|doc|pdf|xls|ppt|docx|pptx|xlsx)$ { - # Cache static-looking files for 120 minutes, setting a 10 day expiry time in the HTTP header, - # whether logged in or not (may be too heavy-handed). - proxy_cache_valid 200 120m; - expires 864000; - proxy_pass http://:80; - } - - - - - - - -} - - - -########################################################### -# SSL Vhost -########################################################### -server { - listen 443; - server_name ; - - access_log /var/log/ispconfig/nginx//access.log - error_log /var/log/ispconfig/nginx//error.log - - ### SSL cert files ### - ssl_certificate /ssl/.crt - ssl_certificate_key /ssl/.crt - - - ssl_client_certificate /ssl/.bundle - - - ### Add SSL specific settings here ### - keepalive_timeout 60; - - ### Limiting Ciphers ######################## - # Uncomment as per your setup - #ssl_ciphers HIGH:!ADH; - #ssl_perfer_server_ciphers on; - #ssl_protocols SSLv3; - ############################################## - - include /etc/nginx/proxy.conf; - - ### Most PHP, Python, Rails, Java App can use this header ### - proxy_set_header X-Forwarded-Proto https; - - location / { - proxy_pass https://:443; - } -} - +server { + listen 80; + server_name ; + + access_log /var/log/ispconfig/nginx//access.log; + error_log /var/log/ispconfig/nginx//error.log; + + include /etc/nginx/proxy.conf; + + location / { + proxy_pass http://:80; + } + + location ~* \.(jpg|png|gif|jpeg|css|js|mp3|wav|swf|mov|doc|pdf|xls|ppt|docx|pptx|xlsx)$ { + # Cache static-looking files for 120 minutes, setting a 10 day expiry time in the HTTP header, + # whether logged in or not (may be too heavy-handed). + proxy_cache_valid 200 120m; + expires 864000; + proxy_pass http://:80; + } + + + + + + + +} + + + +########################################################### +# SSL Vhost +########################################################### +server { + listen 443; + server_name ; + + access_log /var/log/ispconfig/nginx//access.log + error_log /var/log/ispconfig/nginx//error.log + + ### SSL cert files ### + ssl_certificate /ssl/.crt + ssl_certificate_key /ssl/.crt + + + ssl_client_certificate /ssl/.bundle + + + ### Add SSL specific settings here ### + keepalive_timeout 60; + + ### Limiting Ciphers ######################## + # Uncomment as per your setup + #ssl_ciphers HIGH:!ADH; + #ssl_perfer_server_ciphers on; + #ssl_protocols SSLv3; + ############################################## + + include /etc/nginx/proxy.conf; + + ### Most PHP, Python, Rails, Java App can use this header ### + proxy_set_header X-Forwarded-Proto https; + + location / { + proxy_pass https://:443; + } +} + diff --git a/server/conf/squidRewriteRules.py.master b/server/conf/squidRewriteRules.py.master index 6005bb3b2..a8a241b9b 100644 --- a/server/conf/squidRewriteRules.py.master +++ b/server/conf/squidRewriteRules.py.master @@ -1,196 +1,196 @@ -""" -/********************************************************************** -FILE : $RCSfile: squidRewriteRules.py,v $ -PURPOSE : Rule set for icoya redirector -NOTES : -AUTHOR : Simon Eisenmann -COPYRIGHT: (c) 2003,2004 by struktur AG -DATE : 28JAN2003 -REVISION : $Revision: 1.12 $ -VERSION : $Id: squidRewriteRules.py,v 1.12 2004/08/06 08:16:19 longsleep Exp $ (Author: $Author: longsleep $) - -struktur AG Phone: +49 711 8966560 -Junghansstr. 5 Fax: +49 711 89665610 -70469 Stuttgart email: info@struktur.de -GERMANY - -http://www.struktur.de -http://www.strukturag.com - -**********************************************************************/ - - Reloadable module allows arbitrary url transformations. - - - Automatic reload of the rules - +++++++++++++++++++++++++++++++++++ - - NOTE: use the reload after parameter to auto reload this module - after x requests. Use -1 to disable auto reload - - - Logging - +++++++++++++++++++++++++++++++++++ - - NOTE: set debug to 1 to enable logging - define the logfile in the logfile variable (enter full path) - - -""" -import re, sys - -try: - import py -except ImportError: - pass - -""" -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -begin of configuration -""" - -# log mode (set to 1 to enable logging) -debug = 0 - -# logfile for debugging (only required when debug == 1) -logfile = "/etc/squid/redirector_class.log" - -# set this to -1 to get best performance (no reload) -reload_after = -1 - -# define sitemap matching regex mapping - -# MODIFY THIS REWRITE RULE AS NEEDED FOR YOUR SITE - -rewrites = ( - -### HTTP SSL/encrypted webmail rewrite ### You can use this as an example for your ssl virtualhosted website - - - (r'{tmpl_var name="rewrite_url_src"}', r'{tmpl_var name="rewrite_url_dest"}\1', 'P,L'), - - - - - - -) - - - -""" -end of configuration -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -""" - -compiled_rewrites = None - -def log(s): - """ Logging facility. - """ - try: - f = open(logfile, "a") - except IOError: - print >> sys.stderr, s - return - f.write('%s\n' % s) - f.flush() - f.close() - -def init(): - global compiled_rewrites - - compiled_rewrites = [] - for rewrite in rewrites: - regexp = re.compile(rewrite[0]) - template = rewrite[1] - flags = {} - for flag in rewrite[2].split(','): - parts = flag.split('=') - flag = parts[0] - option = None - if flag == 'R': - if len(parts) > 1: - option = "%s:" % parts[1] - else: - option = '302:' - flags[flag] = option - compiled = (regexp, template, flags) - if debug: - log('compiled: %s' % str((regexp.pattern, template, flags))) - compiled_rewrites.append(compiled) - compiled_rewrites = tuple(compiled_rewrites) - -def rewrite(url, src_address=''): - """ just rewrites urls. - """ - - if debug: - log("args: %s" % str((url, src_address))) - - newurl = None - for regexp, template, flags in compiled_rewrites: - m = regexp.match(url) - if m is not None and template != '-': - if debug: - log("match.groups ('%s'): %s" % (regexp.pattern, str(m.groups()))) - url = newurl = "%s%s" % (flags.get('R', ''), m.expand(template)) - if debug: - log('newurl: %s' % newurl) - if 'L' in flags: - break - - if newurl is not None: - if debug: - log('finalurl: %s' % newurl) - return newurl - - # redirect to something we can match by a squid acl - # this special non existing domain should be denied - # by squid with a http_reply_access line - return "http://denypool/denyme" - -def test_foobar_redirection(): - assert rewrite('http://foobar.com/foo/bar') == '302:http://www.foobar.com/foo/bar' - assert rewrite('http://foobar.de/foo/bar') == '302:http://www.foobar.com/foo/bar' - assert rewrite('http://www.foobar.de/foo/bar') == '302:http://www.foobar.com/foo/bar' - assert rewrite('http://foobar-portal.de/foo/bar') == '302:http://www.foobar.com/foo/bar' - assert rewrite('http://www.foobar-portal.de/foo/bar') == '302:http://www.foobar.com/foo/bar' - assert rewrite('http://foobar-portal-europe.de/foo/bar') == '302:http://www.foobar.com/foo/bar' - assert rewrite('http://www.foobar-portal-europe.de/foo/bar') == '302:http://www.foobar.com/foo/bar' - # shouldn't redirect, just rewrite - assert not rewrite('http://www.foobar.com/foo/bar').startswith('302:') - -def test_foobarbacon_redirection(): - assert rewrite('http://foobar-bacon.com/foo/bar') == '302:http://www.foobar-bacon.com/foo/bar' - assert rewrite('http://foobar-bacon.de/foo/bar') == '302:http://www.foobar-bacon.com/foo/bar' - assert rewrite('http://www.foobar-bacon.de/foo/bar') == '302:http://www.foobar-bacon.com/foo/bar' - assert rewrite('http://foobar-bacon-europe.de/foo/bar') == '302:http://www.foobar-bacon.com/foo/bar' - assert rewrite('http://www.foobar-bacon-europe.de/foo/bar') == '302:http://www.foobar-bacon.com/foo/bar' - assert rewrite('http://foobar-bacon-europe.com/foo/bar') == '302:http://www.foobar-bacon.com/foo/bar' - assert rewrite('http://www.foobar-bacon-europe.com/foo/bar') == '302:http://www.foobar-bacon.com/foo/bar' - assert rewrite('http://foobar-bacon.net/foo/bar') == '302:http://www.foobar-bacon.com/foo/bar' - assert rewrite('http://www.foobar-bacon.net/foo/bar') == '302:http://www.foobar-bacon.com/foo/bar' - # shouldn't redirect, just rewrite - assert not rewrite('http://www.foobar-bacon.com/foo/bar').startswith('302:') - -def test_virtual_hosting(): - assert rewrite('http://www.foobar.com/foo/bar') == 'http://backendpool/VirtualHostBase/http/www.foobar.com/foobarportal/VirtualHostRoot/foo/bar' - assert rewrite('http://www.foobar.com:8088/foo/bar') == 'http://backendpool/VirtualHostBase/http/www.foobar.com:8088/foobarportal/VirtualHostRoot/foo/bar' - assert rewrite('http://www.foobar-bacon.com/foo/bar') == 'http://backendpool/VirtualHostBase/http/www.foobar-bacon.com/foobarbacon/VirtualHostRoot/foo/bar' - assert rewrite('http://www.foobar-bacon.com:8088/foo/bar') == 'http://backendpool/VirtualHostBase/http/www.foobar-bacon.com:8088/foobarbacon/VirtualHostRoot/foo/bar' - -def test_zmi(): - assert rewrite('http://www.foobar.com/--zmi--/foo/bar') == 'http://backendpool/VirtualHostBase/http/www.foobar.com/VirtualHostRoot/_vh_--zmi--/foo/bar' - assert rewrite('http://www.foobar.com:8088/--zmi--/foo/bar') == 'http://backendpool/VirtualHostBase/http/www.foobar.com:8088/VirtualHostRoot/_vh_--zmi--/foo/bar' - -def test_repos(): - assert rewrite('http://www.foobar.com/--repos--/foo/bar') == 'http://localhost/--repos--/foo/bar' - assert rewrite('http://www.foobar.com:8088/--repos--/foo/bar') == 'http://localhost/--repos--/foo/bar' - -if debug: - log("reloading user redirector module") -init() -if debug: - log("reloaded user redirector module") - +""" +/********************************************************************** +FILE : $RCSfile: squidRewriteRules.py,v $ +PURPOSE : Rule set for icoya redirector +NOTES : +AUTHOR : Simon Eisenmann +COPYRIGHT: (c) 2003,2004 by struktur AG +DATE : 28JAN2003 +REVISION : $Revision: 1.12 $ +VERSION : $Id: squidRewriteRules.py,v 1.12 2004/08/06 08:16:19 longsleep Exp $ (Author: $Author: longsleep $) + +struktur AG Phone: +49 711 8966560 +Junghansstr. 5 Fax: +49 711 89665610 +70469 Stuttgart email: info@struktur.de +GERMANY + +http://www.struktur.de +http://www.strukturag.com + +**********************************************************************/ + + Reloadable module allows arbitrary url transformations. + + + Automatic reload of the rules + +++++++++++++++++++++++++++++++++++ + + NOTE: use the reload after parameter to auto reload this module + after x requests. Use -1 to disable auto reload + + + Logging + +++++++++++++++++++++++++++++++++++ + + NOTE: set debug to 1 to enable logging + define the logfile in the logfile variable (enter full path) + + +""" +import re, sys + +try: + import py +except ImportError: + pass + +""" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +begin of configuration +""" + +# log mode (set to 1 to enable logging) +debug = 0 + +# logfile for debugging (only required when debug == 1) +logfile = "/etc/squid/redirector_class.log" + +# set this to -1 to get best performance (no reload) +reload_after = -1 + +# define sitemap matching regex mapping + +# MODIFY THIS REWRITE RULE AS NEEDED FOR YOUR SITE + +rewrites = ( + +### HTTP SSL/encrypted webmail rewrite ### You can use this as an example for your ssl virtualhosted website + + + (r'{tmpl_var name="rewrite_url_src"}', r'{tmpl_var name="rewrite_url_dest"}\1', 'P,L'), + + + + + + +) + + + +""" +end of configuration ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +""" + +compiled_rewrites = None + +def log(s): + """ Logging facility. + """ + try: + f = open(logfile, "a") + except IOError: + print >> sys.stderr, s + return + f.write('%s\n' % s) + f.flush() + f.close() + +def init(): + global compiled_rewrites + + compiled_rewrites = [] + for rewrite in rewrites: + regexp = re.compile(rewrite[0]) + template = rewrite[1] + flags = {} + for flag in rewrite[2].split(','): + parts = flag.split('=') + flag = parts[0] + option = None + if flag == 'R': + if len(parts) > 1: + option = "%s:" % parts[1] + else: + option = '302:' + flags[flag] = option + compiled = (regexp, template, flags) + if debug: + log('compiled: %s' % str((regexp.pattern, template, flags))) + compiled_rewrites.append(compiled) + compiled_rewrites = tuple(compiled_rewrites) + +def rewrite(url, src_address=''): + """ just rewrites urls. + """ + + if debug: + log("args: %s" % str((url, src_address))) + + newurl = None + for regexp, template, flags in compiled_rewrites: + m = regexp.match(url) + if m is not None and template != '-': + if debug: + log("match.groups ('%s'): %s" % (regexp.pattern, str(m.groups()))) + url = newurl = "%s%s" % (flags.get('R', ''), m.expand(template)) + if debug: + log('newurl: %s' % newurl) + if 'L' in flags: + break + + if newurl is not None: + if debug: + log('finalurl: %s' % newurl) + return newurl + + # redirect to something we can match by a squid acl + # this special non existing domain should be denied + # by squid with a http_reply_access line + return "http://denypool/denyme" + +def test_foobar_redirection(): + assert rewrite('http://foobar.com/foo/bar') == '302:http://www.foobar.com/foo/bar' + assert rewrite('http://foobar.de/foo/bar') == '302:http://www.foobar.com/foo/bar' + assert rewrite('http://www.foobar.de/foo/bar') == '302:http://www.foobar.com/foo/bar' + assert rewrite('http://foobar-portal.de/foo/bar') == '302:http://www.foobar.com/foo/bar' + assert rewrite('http://www.foobar-portal.de/foo/bar') == '302:http://www.foobar.com/foo/bar' + assert rewrite('http://foobar-portal-europe.de/foo/bar') == '302:http://www.foobar.com/foo/bar' + assert rewrite('http://www.foobar-portal-europe.de/foo/bar') == '302:http://www.foobar.com/foo/bar' + # shouldn't redirect, just rewrite + assert not rewrite('http://www.foobar.com/foo/bar').startswith('302:') + +def test_foobarbacon_redirection(): + assert rewrite('http://foobar-bacon.com/foo/bar') == '302:http://www.foobar-bacon.com/foo/bar' + assert rewrite('http://foobar-bacon.de/foo/bar') == '302:http://www.foobar-bacon.com/foo/bar' + assert rewrite('http://www.foobar-bacon.de/foo/bar') == '302:http://www.foobar-bacon.com/foo/bar' + assert rewrite('http://foobar-bacon-europe.de/foo/bar') == '302:http://www.foobar-bacon.com/foo/bar' + assert rewrite('http://www.foobar-bacon-europe.de/foo/bar') == '302:http://www.foobar-bacon.com/foo/bar' + assert rewrite('http://foobar-bacon-europe.com/foo/bar') == '302:http://www.foobar-bacon.com/foo/bar' + assert rewrite('http://www.foobar-bacon-europe.com/foo/bar') == '302:http://www.foobar-bacon.com/foo/bar' + assert rewrite('http://foobar-bacon.net/foo/bar') == '302:http://www.foobar-bacon.com/foo/bar' + assert rewrite('http://www.foobar-bacon.net/foo/bar') == '302:http://www.foobar-bacon.com/foo/bar' + # shouldn't redirect, just rewrite + assert not rewrite('http://www.foobar-bacon.com/foo/bar').startswith('302:') + +def test_virtual_hosting(): + assert rewrite('http://www.foobar.com/foo/bar') == 'http://backendpool/VirtualHostBase/http/www.foobar.com/foobarportal/VirtualHostRoot/foo/bar' + assert rewrite('http://www.foobar.com:8088/foo/bar') == 'http://backendpool/VirtualHostBase/http/www.foobar.com:8088/foobarportal/VirtualHostRoot/foo/bar' + assert rewrite('http://www.foobar-bacon.com/foo/bar') == 'http://backendpool/VirtualHostBase/http/www.foobar-bacon.com/foobarbacon/VirtualHostRoot/foo/bar' + assert rewrite('http://www.foobar-bacon.com:8088/foo/bar') == 'http://backendpool/VirtualHostBase/http/www.foobar-bacon.com:8088/foobarbacon/VirtualHostRoot/foo/bar' + +def test_zmi(): + assert rewrite('http://www.foobar.com/--zmi--/foo/bar') == 'http://backendpool/VirtualHostBase/http/www.foobar.com/VirtualHostRoot/_vh_--zmi--/foo/bar' + assert rewrite('http://www.foobar.com:8088/--zmi--/foo/bar') == 'http://backendpool/VirtualHostBase/http/www.foobar.com:8088/VirtualHostRoot/_vh_--zmi--/foo/bar' + +def test_repos(): + assert rewrite('http://www.foobar.com/--repos--/foo/bar') == 'http://localhost/--repos--/foo/bar' + assert rewrite('http://www.foobar.com:8088/--repos--/foo/bar') == 'http://localhost/--repos--/foo/bar' + +if debug: + log("reloading user redirector module") +init() +if debug: + log("reloaded user redirector module") + diff --git a/server/conf/ufw.before.rules.master b/server/conf/ufw.before.rules.master index ab451718e..613e5250d 100644 --- a/server/conf/ufw.before.rules.master +++ b/server/conf/ufw.before.rules.master @@ -1,78 +1,78 @@ -# -# rules.before -# -# Rules that should be run before the ufw command line added rules. Custom -# rules should be added to one of these chains: -# ufw-before-input -# ufw-before-output -# ufw-before-forward -# - -# Don't delete these required lines, otherwise there will be errors -*filter -:ufw-before-input - [0:0] -:ufw-before-output - [0:0] -:ufw-before-forward - [0:0] -:ufw-not-local - [0:0] -# End required lines - - -# allow all on loopback --A ufw-before-input -i lo -j ACCEPT --A ufw-before-output -o lo -j ACCEPT - -# connection tracking rules --A ufw-before-input -m state --state RELATED,ESTABLISHED -j ACCEPT - -# drop INVALID packets (logs these in loglevel medium and higher) --A ufw-before-input -m state --state INVALID -j ufw-logging-deny --A ufw-before-input -m state --state INVALID -j DROP - -# connection tracking for outbound --A ufw-before-output -p tcp -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT --A ufw-before-output -p udp -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT - -# ok icmp codes --A ufw-before-input -p icmp --icmp-type destination-unreachable -j ACCEPT --A ufw-before-input -p icmp --icmp-type source-quench -j ACCEPT --A ufw-before-input -p icmp --icmp-type time-exceeded -j ACCEPT --A ufw-before-input -p icmp --icmp-type parameter-problem -j ACCEPT --A ufw-before-input -p icmp --icmp-type echo-request -j ACCEPT - -# allow dhcp client to work --A ufw-before-input -p udp --sport 67 --dport 68 -j ACCEPT - -# -# ufw-not-local -# --A ufw-before-input -j ufw-not-local - -# if LOCAL, RETURN --A ufw-not-local -m addrtype --dst-type LOCAL -j RETURN - -# if MULTICAST, RETURN --A ufw-not-local -m addrtype --dst-type MULTICAST -j RETURN - -# if BROADCAST, RETURN --A ufw-not-local -m addrtype --dst-type BROADCAST -j RETURN - -# all other non-local packets are dropped --A ufw-not-local -m limit --limit 3/min --limit-burst 10 -j ufw-logging-deny --A ufw-not-local -j DROP - -# allow MULTICAST, be sure the MULTICAST line above is uncommented --A ufw-before-input -s 224.0.0.0/4 -j ACCEPT --A ufw-before-input -d 224.0.0.0/4 -j ACCEPT - -COMMIT - -# nat Table rules -*nat -:POSTROUTING ACCEPT [0:0] - --A POSTROUTING -s 192.168.5.2/24 -o eth0 -j SNAT --to 192.168.5.105 - --A PREROUTING -p tcp -d 192.168.5.105 --dport 80 -i eth0 -j DNAT --to-destination 192.168.5.200:80 - -# don't delete the 'COMMIT' line or these rules won't be processed -COMMIT +# +# rules.before +# +# Rules that should be run before the ufw command line added rules. Custom +# rules should be added to one of these chains: +# ufw-before-input +# ufw-before-output +# ufw-before-forward +# + +# Don't delete these required lines, otherwise there will be errors +*filter +:ufw-before-input - [0:0] +:ufw-before-output - [0:0] +:ufw-before-forward - [0:0] +:ufw-not-local - [0:0] +# End required lines + + +# allow all on loopback +-A ufw-before-input -i lo -j ACCEPT +-A ufw-before-output -o lo -j ACCEPT + +# connection tracking rules +-A ufw-before-input -m state --state RELATED,ESTABLISHED -j ACCEPT + +# drop INVALID packets (logs these in loglevel medium and higher) +-A ufw-before-input -m state --state INVALID -j ufw-logging-deny +-A ufw-before-input -m state --state INVALID -j DROP + +# connection tracking for outbound +-A ufw-before-output -p tcp -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT +-A ufw-before-output -p udp -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT + +# ok icmp codes +-A ufw-before-input -p icmp --icmp-type destination-unreachable -j ACCEPT +-A ufw-before-input -p icmp --icmp-type source-quench -j ACCEPT +-A ufw-before-input -p icmp --icmp-type time-exceeded -j ACCEPT +-A ufw-before-input -p icmp --icmp-type parameter-problem -j ACCEPT +-A ufw-before-input -p icmp --icmp-type echo-request -j ACCEPT + +# allow dhcp client to work +-A ufw-before-input -p udp --sport 67 --dport 68 -j ACCEPT + +# +# ufw-not-local +# +-A ufw-before-input -j ufw-not-local + +# if LOCAL, RETURN +-A ufw-not-local -m addrtype --dst-type LOCAL -j RETURN + +# if MULTICAST, RETURN +-A ufw-not-local -m addrtype --dst-type MULTICAST -j RETURN + +# if BROADCAST, RETURN +-A ufw-not-local -m addrtype --dst-type BROADCAST -j RETURN + +# all other non-local packets are dropped +-A ufw-not-local -m limit --limit 3/min --limit-burst 10 -j ufw-logging-deny +-A ufw-not-local -j DROP + +# allow MULTICAST, be sure the MULTICAST line above is uncommented +-A ufw-before-input -s 224.0.0.0/4 -j ACCEPT +-A ufw-before-input -d 224.0.0.0/4 -j ACCEPT + +COMMIT + +# nat Table rules +*nat +:POSTROUTING ACCEPT [0:0] + +-A POSTROUTING -s 192.168.5.2/24 -o eth0 -j SNAT --to 192.168.5.105 + +-A PREROUTING -p tcp -d 192.168.5.105 --dport 80 -i eth0 -j DNAT --to-destination 192.168.5.200:80 + +# don't delete the 'COMMIT' line or these rules won't be processed +COMMIT diff --git a/server/conf/ufw.conf.master b/server/conf/ufw.conf.master index 7870d63ef..a3710d7bf 100644 --- a/server/conf/ufw.conf.master +++ b/server/conf/ufw.conf.master @@ -1,8 +1,8 @@ -# /etc/ufw/ufw.conf -# - -# set to yes to start on boot -ENABLED={tmpl_var name='enable'} - -# set to one of 'off', 'low', 'medium', 'high' -LOGLEVEL={tmpl_var name='log_level'} +# /etc/ufw/ufw.conf +# + +# set to yes to start on boot +ENABLED={tmpl_var name='enable'} + +# set to one of 'off', 'low', 'medium', 'high' +LOGLEVEL={tmpl_var name='log_level'} diff --git a/server/conf/ufw.default.master b/server/conf/ufw.default.master index 6a205006d..2deb421ac 100644 --- a/server/conf/ufw.default.master +++ b/server/conf/ufw.default.master @@ -1,39 +1,39 @@ -# /etc/default/ufw -# - -# set to yes to apply rules to support IPv6 (no means only IPv6 on loopback -# accepted). You will need to 'disable' and then 'enable' the firewall for -# the changes to take affect. -IPV6={tmpl_var name='ipv6'} - -# set the default input policy to ACCEPT, DROP or REJECT. Please note that if -# you change this you will most likely want to adjust your rules -DEFAULT_INPUT_POLICY="{tmpl_var name='default_input_policy'}" - -# set the default output policy to ACCEPT, DROP, or REJECT. Please note that -# if you change this you will most likely want to adjust your rules -DEFAULT_OUTPUT_POLICY="{tmpl_var name='default_output_policy'}T" - -# set the default forward policy to ACCEPT, DROP or REJECT. Please note that -# if you change this you will most likely want to adjust your rules -DEFAULT_FORWARD_POLICY="{tmpl_var name='default_forward_policy'}" - -# set the default application policy to ACCEPT, DROP, REJECT or SKIP. Please -# note that setting this to ACCEPT may be a security risk. See 'man ufw' for -# details -DEFAULT_APPLICATION_POLICY="{tmpl_var name='default_application_policy'}" - -# By default, ufw only touches its own chains. Set this to 'yes' to have ufw -# manage the built-in chains too. Warning: setting this to 'yes' will break -# non-ufw managed firewall rules -MANAGE_BUILTINS={tmpl_var name='manage_builtins'} - -# -# IPT backend -# -# only enable if using iptables backend -IPT_SYSCTL=/etc/ufw/sysctl.conf - -# extra connection tracking modules to load -IPT_MODULES="nf_conntrack_ftp nf_nat_ftp nf_conntrack_irc nf_nat_irc" - +# /etc/default/ufw +# + +# set to yes to apply rules to support IPv6 (no means only IPv6 on loopback +# accepted). You will need to 'disable' and then 'enable' the firewall for +# the changes to take affect. +IPV6={tmpl_var name='ipv6'} + +# set the default input policy to ACCEPT, DROP or REJECT. Please note that if +# you change this you will most likely want to adjust your rules +DEFAULT_INPUT_POLICY="{tmpl_var name='default_input_policy'}" + +# set the default output policy to ACCEPT, DROP, or REJECT. Please note that +# if you change this you will most likely want to adjust your rules +DEFAULT_OUTPUT_POLICY="{tmpl_var name='default_output_policy'}T" + +# set the default forward policy to ACCEPT, DROP or REJECT. Please note that +# if you change this you will most likely want to adjust your rules +DEFAULT_FORWARD_POLICY="{tmpl_var name='default_forward_policy'}" + +# set the default application policy to ACCEPT, DROP, REJECT or SKIP. Please +# note that setting this to ACCEPT may be a security risk. See 'man ufw' for +# details +DEFAULT_APPLICATION_POLICY="{tmpl_var name='default_application_policy'}" + +# By default, ufw only touches its own chains. Set this to 'yes' to have ufw +# manage the built-in chains too. Warning: setting this to 'yes' will break +# non-ufw managed firewall rules +MANAGE_BUILTINS={tmpl_var name='manage_builtins'} + +# +# IPT backend +# +# only enable if using iptables backend +IPT_SYSCTL=/etc/ufw/sysctl.conf + +# extra connection tracking modules to load +IPT_MODULES="nf_conntrack_ftp nf_nat_ftp nf_conntrack_irc nf_nat_irc" + diff --git a/server/mods-available/remoteaction_core_module.inc.php b/server/mods-available/remoteaction_core_module.inc.php index b112e8c54..6bf3ad398 100644 --- a/server/mods-available/remoteaction_core_module.inc.php +++ b/server/mods-available/remoteaction_core_module.inc.php @@ -1,207 +1,207 @@ -_execActions(); - } - - /* - This function is called when a change in one of the registered tables is detected. - The function then raises the events for the plugins. - */ - function process($tablename, $action, $data) { - // not needed - } // end function - - private function _actionDone($id, $state) { - /* - * First set the state - */ - global $app; - $sql = "UPDATE sys_remoteaction " . - "SET action_state = '" . $app->dbmaster->quote($state) . "' " . - "WHERE action_id = " . intval($id); - $app->dbmaster->query($sql); - - /* - * Then save the maxid for the next time... - */ - $fp = fopen(dirname(__FILE__) . "/../lib/remote_action.inc.php", 'wb'); - $content = '"; - fwrite($fp, $content); - fclose($fp); - } - - - /** - * This method searches for scheduled actions and exec then - */ - private function _execActions() { - global $app; - global $conf; - - /* the id of the server as int */ - $server_id = intval($conf["server_id"]); - - /* - * First we (till and i, oliver) thought, it was enough to write - * "select from where action_status = 'pending'" and then execute this actions. - * But it is not! - * If a hacker can hack into a server, she can change the valus of action_status - * and so re-exec a action, executed some days bevore. So she can (for example) - * stop a service, a admin stopped some days before! To avoid this, we ignore - * the status (it is only for the interface to show) and use our own maxid - */ - include_once (dirname(__FILE__) . "/../lib/remote_action.inc.php"); - - /* - * Get all actions this server should execute - */ - $sql = "SELECT action_id, action_type, action_param " . - "FROM sys_remoteaction " . - "WHERE server_id = " . $server_id . " ". - " AND action_id > " . intval($maxid_remote_action) . " ". - "ORDER BY action_id"; - $actions = $app->dbmaster->queryAllRecords($sql); - - /* - * process all actions - */ - if(is_array($actions)) { - foreach ($actions as $action) { - if ($action['action_type'] == 'os_update') { - /* do the update */ - $this->_doOsUpdate($action); - /* this action takes so much time, - * we stop executing the actions not to waste more time */ - return; - } - if ($action['action_type'] == 'ispc_update') { - /* do the update */ - $this->_doIspCUpdate($action); - /* this action takes so much time, - * we stop executing the actions not to waste more time */ - return; - } - } - } - } - - private function _doOsUpdate($action) { - /* - * Do the update - */ - exec("aptitude update"); - exec("aptitude safe-upgrade -y"); - - //TODO : change this when distribution information has been integrated into server record - if(file_exists('/etc/gentoo-release')) { - exec("glsa-check -f --nocolor affected"); - } - else { - exec("aptitude update"); - exec("aptitude safe-upgrade -y"); - } - - /* - * All well done! - */ - $this->_actionDone($action['action_id'], 'ok'); - } - - private function _doIspCUpdate($action) { - - // Ensure that this code is not executed twice as this would cause a loop in case of a failure - $this->_actionDone($action['action_id'], 'ok'); - - /* - * Get the version-number of the newest version - */ - $new_version = @file_get_contents('http://www.ispconfig.org/downloads/ispconfig3_version.txt'); - $new_version = trim($new_version); - - /* - * Do the update - */ - - /* jump into the temporary dir */ - $oldDir = getcwd(); - chdir("/tmp"); - - /* delete the old files (if there are any...) */ - exec("rm /tmp/ISPConfig-" . $new_version . ".tar.gz"); - exec("rm /tmp/ispconfig3_install -R"); - - /* get the newest version */ - exec("wget http://www.ispconfig.org/downloads/ISPConfig-" . $new_version . ".tar.gz"); - - /* extract the files */ - exec("tar xvfz ISPConfig-" . $new_version . ".tar.gz"); - - /* - * Initialize the automated update - * (the update is then done next start of server.sh - */ - chdir("/tmp/ispconfig3_install/install"); - exec("touch autoupdate"); - - /* - * do some clean-up - */ - exec("rm /tmp/ISPConfig-" . $new_version . ".tar.gz"); - - /* - * go back to the "old path" - */ - chdir($oldDir); - - /* - * All well done! - */ - //$this->_actionDone($action['action_id'], 'ok'); - } -} +_execActions(); + } + + /* + This function is called when a change in one of the registered tables is detected. + The function then raises the events for the plugins. + */ + function process($tablename, $action, $data) { + // not needed + } // end function + + private function _actionDone($id, $state) { + /* + * First set the state + */ + global $app; + $sql = "UPDATE sys_remoteaction " . + "SET action_state = '" . $app->dbmaster->quote($state) . "' " . + "WHERE action_id = " . intval($id); + $app->dbmaster->query($sql); + + /* + * Then save the maxid for the next time... + */ + $fp = fopen(dirname(__FILE__) . "/../lib/remote_action.inc.php", 'wb'); + $content = '"; + fwrite($fp, $content); + fclose($fp); + } + + + /** + * This method searches for scheduled actions and exec then + */ + private function _execActions() { + global $app; + global $conf; + + /* the id of the server as int */ + $server_id = intval($conf["server_id"]); + + /* + * First we (till and i, oliver) thought, it was enough to write + * "select from where action_status = 'pending'" and then execute this actions. + * But it is not! + * If a hacker can hack into a server, she can change the valus of action_status + * and so re-exec a action, executed some days bevore. So she can (for example) + * stop a service, a admin stopped some days before! To avoid this, we ignore + * the status (it is only for the interface to show) and use our own maxid + */ + include_once (dirname(__FILE__) . "/../lib/remote_action.inc.php"); + + /* + * Get all actions this server should execute + */ + $sql = "SELECT action_id, action_type, action_param " . + "FROM sys_remoteaction " . + "WHERE server_id = " . $server_id . " ". + " AND action_id > " . intval($maxid_remote_action) . " ". + "ORDER BY action_id"; + $actions = $app->dbmaster->queryAllRecords($sql); + + /* + * process all actions + */ + if(is_array($actions)) { + foreach ($actions as $action) { + if ($action['action_type'] == 'os_update') { + /* do the update */ + $this->_doOsUpdate($action); + /* this action takes so much time, + * we stop executing the actions not to waste more time */ + return; + } + if ($action['action_type'] == 'ispc_update') { + /* do the update */ + $this->_doIspCUpdate($action); + /* this action takes so much time, + * we stop executing the actions not to waste more time */ + return; + } + } + } + } + + private function _doOsUpdate($action) { + /* + * Do the update + */ + exec("aptitude update"); + exec("aptitude safe-upgrade -y"); + + //TODO : change this when distribution information has been integrated into server record + if(file_exists('/etc/gentoo-release')) { + exec("glsa-check -f --nocolor affected"); + } + else { + exec("aptitude update"); + exec("aptitude safe-upgrade -y"); + } + + /* + * All well done! + */ + $this->_actionDone($action['action_id'], 'ok'); + } + + private function _doIspCUpdate($action) { + + // Ensure that this code is not executed twice as this would cause a loop in case of a failure + $this->_actionDone($action['action_id'], 'ok'); + + /* + * Get the version-number of the newest version + */ + $new_version = @file_get_contents('http://www.ispconfig.org/downloads/ispconfig3_version.txt'); + $new_version = trim($new_version); + + /* + * Do the update + */ + + /* jump into the temporary dir */ + $oldDir = getcwd(); + chdir("/tmp"); + + /* delete the old files (if there are any...) */ + exec("rm /tmp/ISPConfig-" . $new_version . ".tar.gz"); + exec("rm /tmp/ispconfig3_install -R"); + + /* get the newest version */ + exec("wget http://www.ispconfig.org/downloads/ISPConfig-" . $new_version . ".tar.gz"); + + /* extract the files */ + exec("tar xvfz ISPConfig-" . $new_version . ".tar.gz"); + + /* + * Initialize the automated update + * (the update is then done next start of server.sh + */ + chdir("/tmp/ispconfig3_install/install"); + exec("touch autoupdate"); + + /* + * do some clean-up + */ + exec("rm /tmp/ISPConfig-" . $new_version . ".tar.gz"); + + /* + * go back to the "old path" + */ + chdir($oldDir); + + /* + * All well done! + */ + //$this->_actionDone($action['action_id'], 'ok'); + } +} ?> \ No newline at end of file diff --git a/server/plugins-available/nginx_plugin.inc.php b/server/plugins-available/nginx_plugin.inc.php index a200dafca..7016ad1bd 100644 --- a/server/plugins-available/nginx_plugin.inc.php +++ b/server/plugins-available/nginx_plugin.inc.php @@ -1,368 +1,368 @@ -plugins->registerEvent('web_domain_insert',$this->plugin_name,'ssl'); - $app->plugins->registerEvent('web_domain_update',$this->plugin_name,'ssl'); - $app->plugins->registerEvent('web_domain_delete',$this->plugin_name,'ssl'); - - $app->plugins->registerEvent('web_domain_insert',$this->plugin_name,'insert'); - $app->plugins->registerEvent('web_domain_update',$this->plugin_name,'update'); - $app->plugins->registerEvent('web_domain_delete',$this->plugin_name,'delete'); - - // $app->plugins->registerEvent('proxy_reverse_insert',$this->plugin_name,'rewrite_insert'); - // $app->plugins->registerEvent('proxy_reverse_update',$this->plugin_name,'rewrite_update'); - // $app->plugins->registerEvent('proxy_reverse_delete',$this->plugin_name,'rewrite_delete'); - - - - } - - - function insert($event_name,$data) { - global $app, $conf; - - // just run the update function - $this->update($event_name,$data); - } - - - function update($event_name,$data) { - global $app, $conf; - - if($this->action != 'insert') $this->action = 'update'; - - if($data['new']['type'] != 'vhost' && $data['new']['parent_domain_id'] > 0) { - - $old_parent_domain_id = intval($data['old']['parent_domain_id']); - $new_parent_domain_id = intval($data['new']['parent_domain_id']); - - // If the parent_domain_id has been chenged, we will have to update the old site as well. - if($this->action == 'update' && $data['new']['parent_domain_id'] != $data['old']['parent_domain_id']) { - $tmp = $app->dbmaster->queryOneRecord('SELECT * FROM web_domain WHERE domain_id = '.$old_parent_domain_id." AND active = 'y'"); - $data['new'] = $tmp; - $data['old'] = $tmp; - $this->action = 'update'; - $this->update($event_name,$data); - } - - // This is not a vhost, so we need to update the parent record instead. - $tmp = $app->dbmaster->queryOneRecord('SELECT * FROM web_domain WHERE domain_id = '.$new_parent_domain_id." AND active = 'y'"); - $data['new'] = $tmp; - $data['old'] = $tmp; - $this->action = 'update'; - } - - - - - // load the server configuration options - $app->uses('getconf'); - $nginx_config = $app->getconf->get_server_config($conf['server_id'], 'nginx'); - - // Create group and user, if not exist - $app->uses('system'); - - //* Create the vhost config file - $app->load('tpl'); - - $tpl = new tpl(); - $tpl->newTemplate('nginx_vhost.conf.master'); - - $vhost_data = $data['new']; - $vhost_data['config_dir'] = $config['nginx']['config_dir']; - - $vhost_data['ssl_domain'] = $data['new']['ssl_domain']; - // Check if a SSL cert exists - $ssl_dir = $config['nginx']['config_dir'].'/ssl'; - $domain = $data['new']['ssl_domain']; - $key_file = $ssl_dir.'/'.$domain.'.key'; - $crt_file = $ssl_dir.'/'.$domain.'.crt'; - $bundle_file = $ssl_dir.'/'.$domain.'.bundle'; - - $vhost_data['nginx_directives'] = preg_replace("/\[IP\]/", $vhost_data['ip_address'], $vhost_data['nginx_directives']); - - - if($data['new']['ssl'] == 'y' && @is_file($crt_file) && @is_file($key_file)) { - $vhost_data['ssl_enabled'] = 1; - $app->log('Enable SSL for: '.$domain,LOGLEVEL_DEBUG); - } else { - $vhost_data['ssl_enabled'] = 0; - $app->log('Disable SSL for: '.$domain,LOGLEVEL_DEBUG); - } - - if(@is_file($bundle_file)) $vhost_data['has_bundle_cert'] = 1; - - - $tpl->setVar($vhost_data); - - - - // get alias domains (co-domains and subdomains) - $aliases = $app->dbmaster->queryAllRecords('SELECT * FROM web_domain WHERE parent_domain_id = '.$data['new']['domain_id']." AND active = 'y'"); - $server_alias = array(); - switch($data['new']['subdomain']) { - case 'www': - $server_alias[] .= 'www.'.$data['new']['domain'].' '; - break; - case '*': - $server_alias[] .= '*.'.$data['new']['domain'].' '; - break; - } - if(is_array($aliases)) { - foreach($aliases as $alias) { - switch($alias['subdomain']) { - case 'www': - $server_alias[] .= 'www.'.$alias['domain'].' '.$alias['domain'].' '; - break; - case '*': - $server_alias[] .= '*.'.$alias['domain'].' '.$alias['domain'].' '; - break; - default: - $server_alias[] .= $alias['domain'].' '; - break; - } - $app->log('Add server alias: '.$alias['domain'],LOGLEVEL_DEBUG); - - } - } - - //* If we have some alias records - if(count($server_alias) > 0) { - $server_alias_str = ''; - $n = 0; - - // begin a new ServerAlias line after 30 alias domains - foreach($server_alias as $tmp_alias) { - if($n % 30 == 0) $server_alias_str .= " "; - $server_alias_str .= $tmp_alias; - } - unset($tmp_alias); - - $tpl->setVar('alias',trim($server_alias_str)); - } else { - $tpl->setVar('alias',''); - } - - - $vhost_file = escapeshellcmd($nginx_config['vhost_conf_dir'].'/'.$data['new']['domain'].'.vhost'); - //* Make a backup copy of vhost file - copy($vhost_file,$vhost_file.'~'); - - //* Write vhost file - file_put_contents($vhost_file,$tpl->grab()); - $app->log('Writing the vhost file: '.$vhost_file,LOGLEVEL_DEBUG); - unset($tpl); - - - // Set the symlink to enable the vhost - $vhost_symlink = escapeshellcmd($nginx_config['vhost_conf_enabled_dir'].'/'.$data['new']['domain'].'.vhost'); - if($data['new']['active'] == 'y' && !is_link($vhost_symlink)) { - symlink($vhost_file,$vhost_symlink); - $app->log('Creating symlink: '.$vhost_symlink.'->'.$vhost_file,LOGLEVEL_DEBUG); - } - - // Remove the symlink, if site is inactive - if($data['new']['active'] == 'n' && is_link($vhost_symlink)) { - unlink($vhost_symlink); - $app->log('Removing symlink: '.$vhost_symlink.'->'.$vhost_file,LOGLEVEL_DEBUG); - } - - if(!is_dir('/var/log/ispconfig/nginx/'.$data['new']['domain'])) exec('mkdir -p /var/log/ispconfig/nginx/'.$data['new']['domain']); - - // remove old symlink and vhost file, if domain name of the site has changed - if($this->action == 'update' && $data['old']['domain'] != '' && $data['new']['domain'] != $data['old']['domain']) { - $vhost_symlink = escapeshellcmd($nginx_config['vhost_conf_enabled_dir'].'/'.$data['old']['domain'].'.vhost'); - unlink($vhost_symlink); - $app->log('Removing symlink: '.$vhost_symlink.'->'.$vhost_file,LOGLEVEL_DEBUG); - $vhost_file = escapeshellcmd($nginx_config['vhost_conf_dir'].'/'.$data['old']['domain'].'.vhost'); - unlink($vhost_file); - $app->log('Removing file: '.$vhost_file,LOGLEVEL_DEBUG); - - if(is_dir('/var/log/ispconfig/nginx/'.$data['old']['domain'])) exec('rm -rf /var/log/ispconfig/nginx/'.$data['old']['domain']); - } - - // request a httpd reload when all records have been processed - $app->services->restartServiceDelayed('nginx','restart'); - - // Remove the backup copy of the config file. - if(@is_file($vhost_file.'~')) unlink($vhost_file.'~'); - - - //* Unset action to clean it for next processed vhost. - $this->action = ''; - - } - - - - - // Handle the creation of SSL certificates - function ssl($event_name,$data) { - global $app, $conf; - - if(!is_dir($conf['nginx']['config_dir'].'/ssl')) exec('mkdir -p '.$conf['nginx']['config_dir'].'/ssl'); - $ssl_dir = $conf['nginx']['config_dir'].'/ssl'; - $domain = $data['new']['ssl_domain']; - $key_file = $ssl_dir.'/'.$domain.'.key.org'; - $key_file2 = $ssl_dir.'/'.$domain.'.key'; - $csr_file = $ssl_dir.'/'.$domain.'.csr'; - $crt_file = $ssl_dir.'/'.$domain.'.crt'; - - - //* Save a SSL certificate to disk - if($data["new"]["ssl_action"] == 'save') { - $web = $app->masterdb->queryOneRecord("select wd.document_root, sp.ip_address from web_domain wd INNER JOIN server_ip sp USING(server_id) WHERE domain = '".$data['new']['domain']."'"); - - $src_ssl_dir = $web["document_root"]."/ssl"; - //$domain = $data["new"]["ssl_domain"]; - //$csr_file = $ssl_dir.'/'.$domain.".csr"; - //$crt_file = $ssl_dir.'/'.$domain.".crt"; - //$bundle_file = $ssl_dir.'/'.$domain.".bundle"; - $this->_exec('rsync -v -e ssh root@'.$web['ip_address'].':~/$src_ssl_dir '.$ssl_dir); - - $app->log('Syncing SSL Cert for: '.$domain,LOGLEVEL_DEBUG); - } - - //* Delete a SSL certificate - if($data['new']['ssl_action'] == 'del') { - //$ssl_dir = $data['new']['document_root'].'/ssl'; - $domain = $data['new']['ssl_domain']; - $csr_file = $ssl_dir.'/'.$domain.'.csr'; - $crt_file = $ssl_dir.'/'.$domain.'.crt'; - $bundle_file = $ssl_dir.'/'.$domain.'.bundle'; - unlink($csr_file); - unlink($crt_file); - unlink($bundle_file); - $app->log('Deleting SSL Cert for: '.$domain,LOGLEVEL_DEBUG); - } - - - } - - - function delete($event_name,$data) { - global $app, $conf; - - // load the server configuration options - $app->uses('getconf'); - $nginx_config = $app->getconf->get_server_config($conf['server_id'], 'nginx'); - - - if($data['old']['type'] == 'vhost') { - - //* This is a website - // Deleting the vhost file, symlink and the data directory - $vhost_symlink = escapeshellcmd($nginx_config['vhost_conf_enabled_dir'].'/'.$data['old']['domain'].'.vhost'); - unlink($vhost_symlink); - $app->log('Removing symlink: '.$vhost_symlink.'->'.$vhost_file,LOGLEVEL_DEBUG); - - $vhost_file = escapeshellcmd($nginx_config['vhost_conf_dir'].'/'.$data['old']['domain'].'.vhost'); - unlink($vhost_file); - $app->log('Removing vhost file: '.$vhost_file,LOGLEVEL_DEBUG); - - - - // Delete the log file directory - $vhost_logfile_dir = escapeshellcmd('/var/log/ispconfig/nginx/'.$data['old']['domain']); - if($data['old']['domain'] != '' && !stristr($vhost_logfile_dir,'..')) exec('rm -rf '.$vhost_logfile_dir); - $app->log('Removing website logfile directory: '.$vhost_logfile_dir,LOGLEVEL_DEBUG); - - } - } - - //* Wrapper for exec function for easier debugging - private function _exec($command) { - global $app; - $app->log('exec: '.$command,LOGLEVEL_DEBUG); - exec($command); - } - - function rewrite_insert($event_name,$data) { - global $app, $conf; - - // just run the update function - $this->update($event_name,$data); - } - - function rewrite_update($event_name,$data) { - global $app, $conf; - - $rules = $this->_getRewriteRules($app); - - $app->uses('getconf'); - $nginx_config = $app->getconf->get_server_config($conf['server_id'], 'nginx'); - - $app->load('tpl'); - $tpl = new tpl(); - $tpl->newTemplate("nginx-rewrites.conf.master"); - if (!empty($rules))$tpl->setLoop('nginx_rewrite_rules',$rules); - - $rewrites_file = escapeshellcmd($nginx_config['vhost_conf_dir'].'/default.rewrites.conf'); - //* Make a backup copy of vhost file - copy($rewrites_file,$rewrites_file.'~'); - - //* Write vhost file - file_put_contents($rewrites_file,$tpl->grab()); - $app->log('Writing the nginx rewrites file: '.$rewrites_file,LOGLEVEL_DEBUG); - unset($tpl); - - - // Set the symlink to enable the vhost - $rewrite_symlink = escapeshellcmd($nginx_config['vhost_conf_enabled_dir'].'/default.rewrites.conf'); - - if(!is_link($rewrite_symlink)) { - symlink($rewrites_file,$rewrite_symlink); - $app->log('Creating symlink for nginx rewrites: '.$rewrite_symlink.'->'.$rewrites_file,LOGLEVEL_DEBUG); - } - } - - function rewrite_delete($event_name,$data) { - global $app, $conf; - - // just run the update function - $this->rewrite_update($event_name,$data); - } - - - function _getRewriteRules($app) - { - $rules = array(); - $rules = $app->db->queryAllRecords("SELECT rewrite_url_src, rewrite_url_dst FROM proxy_reverse ORDER BY rewrite_id ASC"); - return $rules; - } - -} // end class - -?> +plugins->registerEvent('web_domain_insert',$this->plugin_name,'ssl'); + $app->plugins->registerEvent('web_domain_update',$this->plugin_name,'ssl'); + $app->plugins->registerEvent('web_domain_delete',$this->plugin_name,'ssl'); + + $app->plugins->registerEvent('web_domain_insert',$this->plugin_name,'insert'); + $app->plugins->registerEvent('web_domain_update',$this->plugin_name,'update'); + $app->plugins->registerEvent('web_domain_delete',$this->plugin_name,'delete'); + + // $app->plugins->registerEvent('proxy_reverse_insert',$this->plugin_name,'rewrite_insert'); + // $app->plugins->registerEvent('proxy_reverse_update',$this->plugin_name,'rewrite_update'); + // $app->plugins->registerEvent('proxy_reverse_delete',$this->plugin_name,'rewrite_delete'); + + + + } + + + function insert($event_name,$data) { + global $app, $conf; + + // just run the update function + $this->update($event_name,$data); + } + + + function update($event_name,$data) { + global $app, $conf; + + if($this->action != 'insert') $this->action = 'update'; + + if($data['new']['type'] != 'vhost' && $data['new']['parent_domain_id'] > 0) { + + $old_parent_domain_id = intval($data['old']['parent_domain_id']); + $new_parent_domain_id = intval($data['new']['parent_domain_id']); + + // If the parent_domain_id has been chenged, we will have to update the old site as well. + if($this->action == 'update' && $data['new']['parent_domain_id'] != $data['old']['parent_domain_id']) { + $tmp = $app->dbmaster->queryOneRecord('SELECT * FROM web_domain WHERE domain_id = '.$old_parent_domain_id." AND active = 'y'"); + $data['new'] = $tmp; + $data['old'] = $tmp; + $this->action = 'update'; + $this->update($event_name,$data); + } + + // This is not a vhost, so we need to update the parent record instead. + $tmp = $app->dbmaster->queryOneRecord('SELECT * FROM web_domain WHERE domain_id = '.$new_parent_domain_id." AND active = 'y'"); + $data['new'] = $tmp; + $data['old'] = $tmp; + $this->action = 'update'; + } + + + + + // load the server configuration options + $app->uses('getconf'); + $nginx_config = $app->getconf->get_server_config($conf['server_id'], 'nginx'); + + // Create group and user, if not exist + $app->uses('system'); + + //* Create the vhost config file + $app->load('tpl'); + + $tpl = new tpl(); + $tpl->newTemplate('nginx_vhost.conf.master'); + + $vhost_data = $data['new']; + $vhost_data['config_dir'] = $config['nginx']['config_dir']; + + $vhost_data['ssl_domain'] = $data['new']['ssl_domain']; + // Check if a SSL cert exists + $ssl_dir = $config['nginx']['config_dir'].'/ssl'; + $domain = $data['new']['ssl_domain']; + $key_file = $ssl_dir.'/'.$domain.'.key'; + $crt_file = $ssl_dir.'/'.$domain.'.crt'; + $bundle_file = $ssl_dir.'/'.$domain.'.bundle'; + + $vhost_data['nginx_directives'] = preg_replace("/\[IP\]/", $vhost_data['ip_address'], $vhost_data['nginx_directives']); + + + if($data['new']['ssl'] == 'y' && @is_file($crt_file) && @is_file($key_file)) { + $vhost_data['ssl_enabled'] = 1; + $app->log('Enable SSL for: '.$domain,LOGLEVEL_DEBUG); + } else { + $vhost_data['ssl_enabled'] = 0; + $app->log('Disable SSL for: '.$domain,LOGLEVEL_DEBUG); + } + + if(@is_file($bundle_file)) $vhost_data['has_bundle_cert'] = 1; + + + $tpl->setVar($vhost_data); + + + + // get alias domains (co-domains and subdomains) + $aliases = $app->dbmaster->queryAllRecords('SELECT * FROM web_domain WHERE parent_domain_id = '.$data['new']['domain_id']." AND active = 'y'"); + $server_alias = array(); + switch($data['new']['subdomain']) { + case 'www': + $server_alias[] .= 'www.'.$data['new']['domain'].' '; + break; + case '*': + $server_alias[] .= '*.'.$data['new']['domain'].' '; + break; + } + if(is_array($aliases)) { + foreach($aliases as $alias) { + switch($alias['subdomain']) { + case 'www': + $server_alias[] .= 'www.'.$alias['domain'].' '.$alias['domain'].' '; + break; + case '*': + $server_alias[] .= '*.'.$alias['domain'].' '.$alias['domain'].' '; + break; + default: + $server_alias[] .= $alias['domain'].' '; + break; + } + $app->log('Add server alias: '.$alias['domain'],LOGLEVEL_DEBUG); + + } + } + + //* If we have some alias records + if(count($server_alias) > 0) { + $server_alias_str = ''; + $n = 0; + + // begin a new ServerAlias line after 30 alias domains + foreach($server_alias as $tmp_alias) { + if($n % 30 == 0) $server_alias_str .= " "; + $server_alias_str .= $tmp_alias; + } + unset($tmp_alias); + + $tpl->setVar('alias',trim($server_alias_str)); + } else { + $tpl->setVar('alias',''); + } + + + $vhost_file = escapeshellcmd($nginx_config['vhost_conf_dir'].'/'.$data['new']['domain'].'.vhost'); + //* Make a backup copy of vhost file + copy($vhost_file,$vhost_file.'~'); + + //* Write vhost file + file_put_contents($vhost_file,$tpl->grab()); + $app->log('Writing the vhost file: '.$vhost_file,LOGLEVEL_DEBUG); + unset($tpl); + + + // Set the symlink to enable the vhost + $vhost_symlink = escapeshellcmd($nginx_config['vhost_conf_enabled_dir'].'/'.$data['new']['domain'].'.vhost'); + if($data['new']['active'] == 'y' && !is_link($vhost_symlink)) { + symlink($vhost_file,$vhost_symlink); + $app->log('Creating symlink: '.$vhost_symlink.'->'.$vhost_file,LOGLEVEL_DEBUG); + } + + // Remove the symlink, if site is inactive + if($data['new']['active'] == 'n' && is_link($vhost_symlink)) { + unlink($vhost_symlink); + $app->log('Removing symlink: '.$vhost_symlink.'->'.$vhost_file,LOGLEVEL_DEBUG); + } + + if(!is_dir('/var/log/ispconfig/nginx/'.$data['new']['domain'])) exec('mkdir -p /var/log/ispconfig/nginx/'.$data['new']['domain']); + + // remove old symlink and vhost file, if domain name of the site has changed + if($this->action == 'update' && $data['old']['domain'] != '' && $data['new']['domain'] != $data['old']['domain']) { + $vhost_symlink = escapeshellcmd($nginx_config['vhost_conf_enabled_dir'].'/'.$data['old']['domain'].'.vhost'); + unlink($vhost_symlink); + $app->log('Removing symlink: '.$vhost_symlink.'->'.$vhost_file,LOGLEVEL_DEBUG); + $vhost_file = escapeshellcmd($nginx_config['vhost_conf_dir'].'/'.$data['old']['domain'].'.vhost'); + unlink($vhost_file); + $app->log('Removing file: '.$vhost_file,LOGLEVEL_DEBUG); + + if(is_dir('/var/log/ispconfig/nginx/'.$data['old']['domain'])) exec('rm -rf /var/log/ispconfig/nginx/'.$data['old']['domain']); + } + + // request a httpd reload when all records have been processed + $app->services->restartServiceDelayed('nginx','restart'); + + // Remove the backup copy of the config file. + if(@is_file($vhost_file.'~')) unlink($vhost_file.'~'); + + + //* Unset action to clean it for next processed vhost. + $this->action = ''; + + } + + + + + // Handle the creation of SSL certificates + function ssl($event_name,$data) { + global $app, $conf; + + if(!is_dir($conf['nginx']['config_dir'].'/ssl')) exec('mkdir -p '.$conf['nginx']['config_dir'].'/ssl'); + $ssl_dir = $conf['nginx']['config_dir'].'/ssl'; + $domain = $data['new']['ssl_domain']; + $key_file = $ssl_dir.'/'.$domain.'.key.org'; + $key_file2 = $ssl_dir.'/'.$domain.'.key'; + $csr_file = $ssl_dir.'/'.$domain.'.csr'; + $crt_file = $ssl_dir.'/'.$domain.'.crt'; + + + //* Save a SSL certificate to disk + if($data["new"]["ssl_action"] == 'save') { + $web = $app->masterdb->queryOneRecord("select wd.document_root, sp.ip_address from web_domain wd INNER JOIN server_ip sp USING(server_id) WHERE domain = '".$data['new']['domain']."'"); + + $src_ssl_dir = $web["document_root"]."/ssl"; + //$domain = $data["new"]["ssl_domain"]; + //$csr_file = $ssl_dir.'/'.$domain.".csr"; + //$crt_file = $ssl_dir.'/'.$domain.".crt"; + //$bundle_file = $ssl_dir.'/'.$domain.".bundle"; + $this->_exec('rsync -v -e ssh root@'.$web['ip_address'].':~/$src_ssl_dir '.$ssl_dir); + + $app->log('Syncing SSL Cert for: '.$domain,LOGLEVEL_DEBUG); + } + + //* Delete a SSL certificate + if($data['new']['ssl_action'] == 'del') { + //$ssl_dir = $data['new']['document_root'].'/ssl'; + $domain = $data['new']['ssl_domain']; + $csr_file = $ssl_dir.'/'.$domain.'.csr'; + $crt_file = $ssl_dir.'/'.$domain.'.crt'; + $bundle_file = $ssl_dir.'/'.$domain.'.bundle'; + unlink($csr_file); + unlink($crt_file); + unlink($bundle_file); + $app->log('Deleting SSL Cert for: '.$domain,LOGLEVEL_DEBUG); + } + + + } + + + function delete($event_name,$data) { + global $app, $conf; + + // load the server configuration options + $app->uses('getconf'); + $nginx_config = $app->getconf->get_server_config($conf['server_id'], 'nginx'); + + + if($data['old']['type'] == 'vhost') { + + //* This is a website + // Deleting the vhost file, symlink and the data directory + $vhost_symlink = escapeshellcmd($nginx_config['vhost_conf_enabled_dir'].'/'.$data['old']['domain'].'.vhost'); + unlink($vhost_symlink); + $app->log('Removing symlink: '.$vhost_symlink.'->'.$vhost_file,LOGLEVEL_DEBUG); + + $vhost_file = escapeshellcmd($nginx_config['vhost_conf_dir'].'/'.$data['old']['domain'].'.vhost'); + unlink($vhost_file); + $app->log('Removing vhost file: '.$vhost_file,LOGLEVEL_DEBUG); + + + + // Delete the log file directory + $vhost_logfile_dir = escapeshellcmd('/var/log/ispconfig/nginx/'.$data['old']['domain']); + if($data['old']['domain'] != '' && !stristr($vhost_logfile_dir,'..')) exec('rm -rf '.$vhost_logfile_dir); + $app->log('Removing website logfile directory: '.$vhost_logfile_dir,LOGLEVEL_DEBUG); + + } + } + + //* Wrapper for exec function for easier debugging + private function _exec($command) { + global $app; + $app->log('exec: '.$command,LOGLEVEL_DEBUG); + exec($command); + } + + function rewrite_insert($event_name,$data) { + global $app, $conf; + + // just run the update function + $this->update($event_name,$data); + } + + function rewrite_update($event_name,$data) { + global $app, $conf; + + $rules = $this->_getRewriteRules($app); + + $app->uses('getconf'); + $nginx_config = $app->getconf->get_server_config($conf['server_id'], 'nginx'); + + $app->load('tpl'); + $tpl = new tpl(); + $tpl->newTemplate("nginx-rewrites.conf.master"); + if (!empty($rules))$tpl->setLoop('nginx_rewrite_rules',$rules); + + $rewrites_file = escapeshellcmd($nginx_config['vhost_conf_dir'].'/default.rewrites.conf'); + //* Make a backup copy of vhost file + copy($rewrites_file,$rewrites_file.'~'); + + //* Write vhost file + file_put_contents($rewrites_file,$tpl->grab()); + $app->log('Writing the nginx rewrites file: '.$rewrites_file,LOGLEVEL_DEBUG); + unset($tpl); + + + // Set the symlink to enable the vhost + $rewrite_symlink = escapeshellcmd($nginx_config['vhost_conf_enabled_dir'].'/default.rewrites.conf'); + + if(!is_link($rewrite_symlink)) { + symlink($rewrites_file,$rewrite_symlink); + $app->log('Creating symlink for nginx rewrites: '.$rewrite_symlink.'->'.$rewrites_file,LOGLEVEL_DEBUG); + } + } + + function rewrite_delete($event_name,$data) { + global $app, $conf; + + // just run the update function + $this->rewrite_update($event_name,$data); + } + + + function _getRewriteRules($app) + { + $rules = array(); + $rules = $app->db->queryAllRecords("SELECT rewrite_url_src, rewrite_url_dst FROM proxy_reverse ORDER BY rewrite_id ASC"); + return $rules; + } + +} // end class + +?> diff --git a/server/plugins-available/squid_plugin.inc.php b/server/plugins-available/squid_plugin.inc.php index fb667e050..f8bdefcd0 100644 --- a/server/plugins-available/squid_plugin.inc.php +++ b/server/plugins-available/squid_plugin.inc.php @@ -1,171 +1,171 @@ -plugins->registerEvent('proxy_reverse_insert',$this->plugin_name,'insert'); - $app->plugins->registerEvent('proxy_reverse_update',$this->plugin_name,'update'); - $app->plugins->registerEvent('proxy_reverse_delete',$this->plugin_name,'delete'); - - $app->plugins->registerEvent('web_domain_insert',$this->plugin_name,'insert'); - $app->plugins->registerEvent('web_domain_update',$this->plugin_name,'update'); - $app->plugins->registerEvent('web_domain_delete',$this->plugin_name,'delete'); - - - - } - - - - - function insert($event_name,$data) { - global $app, $conf; - - - // just run the update function - $this->update($event_name,$data); - - - } - - - function update($event_name,$data) { - global $app, $conf; - - $domains = $this->_getSquidDomains($app); - $rules = $this->_getSquidRewriteRules($app); - - $app->load('tpl'); - $tpl = new tpl(); - $tpl->newTemplate("squidRewriteRules.py.master"); - if (!empty($rules))$tpl->setLoop('squid_rewrite_rules',$rules); - file_put_contents('/etc/squid/squidRewriteRules.py',$tpl->grab()); - unset($tpl); - $app->log('Writing squid rewrite configuration to /etc/squid/squidRewriteRules.py',LOGLEVEL_DEBUG); - - - $tpl = new tpl(); - $tpl->newTemplate("domains.txt.master"); - $tpl->setLoop('squid_domains',$domains); - file_put_contents('/etc/squid/domains.txt',$tpl->grab()); - unset($tpl); - $app->log('Writing squid domains configuration to /etc/squid/domains.txt',LOGLEVEL_DEBUG); - - - // request a httpd reload when all records have been processed - $app->services->restartServiceDelayed('squid','restart'); - - } - - function delete($event_name,$data) { - global $app, $conf; - - // load the server configuration options - - // just run the update function - $this->update($event_name,$data); - - } - - function _getSquidDomains($app) - { - $records = $app->dbmaster->queryAllRecords("SELECT ds.origin, dr.name, IF(origin=name,true,false) AS isRoot FROM dns_soa ds inner join dns_rr dr ON ds.id=dr.zone WHERE ds.active='Y' AND dr.type IN ('A','CNAME') AND dr.name NOT IN ('mail','ns1')"); - $domains = array(); - foreach ($records as $record) { - - $origin = substr($record["origin"],0,-1); - if ($record["isRoot"]) - { - array_push($domains, array("domain" => $origin)); - } else { - array_push($domains, array("domain" => $record["name"].".".$origin)); - } - - } - - return $domains; - - } - - function _getSquidRewriteRules($app) - { - $rules = array(); - - $rules = $app->db->queryAllRecords("SELECT rewrite_url_src, rewrite_url_dest FROM squid_reverse ORDER BY rewrite_id ASC"); - $web_domains = $app->db->queryAllRecords("SELECT wd.subdomain, wd.domain, si.ip_address FROM web_domain wd INNER JOIN server s USING(server_id) INNER JOIN server_ip si USING(server_id)"); - - foreach ($web_domains as $domain) { - if ($domain["subdomain"] == "www") { - array_push($rules,array("rewrite_url_src"=>"^http://www.".$domain["domain"]."/(.*)","rewrite_url_dest"=>"http://".$domain["ip_address"].":80/")); - array_push($rules,array("rewrite_url_src"=>"^http://".$domain["domain"]."/(.*)","rewrite_url_dest"=>"http://".$domain["ip_address"].":80/")); - } else { - array_push($rules,array("rewrite_url_src"=>"^http://www.".$domain["domain"]."/(.*)","rewrite_url_dest"=>"http://".$domain["ip_address"].":80/")); - } - } - return $rules; - } - - - -} // end class - -?> +plugins->registerEvent('proxy_reverse_insert',$this->plugin_name,'insert'); + $app->plugins->registerEvent('proxy_reverse_update',$this->plugin_name,'update'); + $app->plugins->registerEvent('proxy_reverse_delete',$this->plugin_name,'delete'); + + $app->plugins->registerEvent('web_domain_insert',$this->plugin_name,'insert'); + $app->plugins->registerEvent('web_domain_update',$this->plugin_name,'update'); + $app->plugins->registerEvent('web_domain_delete',$this->plugin_name,'delete'); + + + + } + + + + + function insert($event_name,$data) { + global $app, $conf; + + + // just run the update function + $this->update($event_name,$data); + + + } + + + function update($event_name,$data) { + global $app, $conf; + + $domains = $this->_getSquidDomains($app); + $rules = $this->_getSquidRewriteRules($app); + + $app->load('tpl'); + $tpl = new tpl(); + $tpl->newTemplate("squidRewriteRules.py.master"); + if (!empty($rules))$tpl->setLoop('squid_rewrite_rules',$rules); + file_put_contents('/etc/squid/squidRewriteRules.py',$tpl->grab()); + unset($tpl); + $app->log('Writing squid rewrite configuration to /etc/squid/squidRewriteRules.py',LOGLEVEL_DEBUG); + + + $tpl = new tpl(); + $tpl->newTemplate("domains.txt.master"); + $tpl->setLoop('squid_domains',$domains); + file_put_contents('/etc/squid/domains.txt',$tpl->grab()); + unset($tpl); + $app->log('Writing squid domains configuration to /etc/squid/domains.txt',LOGLEVEL_DEBUG); + + + // request a httpd reload when all records have been processed + $app->services->restartServiceDelayed('squid','restart'); + + } + + function delete($event_name,$data) { + global $app, $conf; + + // load the server configuration options + + // just run the update function + $this->update($event_name,$data); + + } + + function _getSquidDomains($app) + { + $records = $app->dbmaster->queryAllRecords("SELECT ds.origin, dr.name, IF(origin=name,true,false) AS isRoot FROM dns_soa ds inner join dns_rr dr ON ds.id=dr.zone WHERE ds.active='Y' AND dr.type IN ('A','CNAME') AND dr.name NOT IN ('mail','ns1')"); + $domains = array(); + foreach ($records as $record) { + + $origin = substr($record["origin"],0,-1); + if ($record["isRoot"]) + { + array_push($domains, array("domain" => $origin)); + } else { + array_push($domains, array("domain" => $record["name"].".".$origin)); + } + + } + + return $domains; + + } + + function _getSquidRewriteRules($app) + { + $rules = array(); + + $rules = $app->db->queryAllRecords("SELECT rewrite_url_src, rewrite_url_dest FROM squid_reverse ORDER BY rewrite_id ASC"); + $web_domains = $app->db->queryAllRecords("SELECT wd.subdomain, wd.domain, si.ip_address FROM web_domain wd INNER JOIN server s USING(server_id) INNER JOIN server_ip si USING(server_id)"); + + foreach ($web_domains as $domain) { + if ($domain["subdomain"] == "www") { + array_push($rules,array("rewrite_url_src"=>"^http://www.".$domain["domain"]."/(.*)","rewrite_url_dest"=>"http://".$domain["ip_address"].":80/")); + array_push($rules,array("rewrite_url_src"=>"^http://".$domain["domain"]."/(.*)","rewrite_url_dest"=>"http://".$domain["ip_address"].":80/")); + } else { + array_push($rules,array("rewrite_url_src"=>"^http://www.".$domain["domain"]."/(.*)","rewrite_url_dest"=>"http://".$domain["ip_address"].":80/")); + } + } + return $rules; + } + + + +} // end class + +?> diff --git a/server/plugins-available/ufw_firewall_plugin.inc.php b/server/plugins-available/ufw_firewall_plugin.inc.php index 4eb1e1f96..be10cf673 100644 --- a/server/plugins-available/ufw_firewall_plugin.inc.php +++ b/server/plugins-available/ufw_firewall_plugin.inc.php @@ -1,504 +1,504 @@ -plugins->registerEvent('firewall_insert',$this->plugin_name,'insert_basic'); - $app->plugins->registerEvent('firewall_update',$this->plugin_name,'update_basic'); - $app->plugins->registerEvent('firewall_delete',$this->plugin_name,'update_basic'); - - $app->plugins->registerEvent('firewall_forward_insert',$this->plugin_name,'insert_forward'); - $app->plugins->registerEvent('firewall_forward_update',$this->plugin_name,'update_forward'); - $app->plugins->registerEvent('firewall_forward_delete',$this->plugin_name,'update_forward'); - - $app->plugins->registerEvent('firewall_filter_insert',$this->plugin_name,'insert_filter'); - $app->plugins->registerEvent('firewall_filter_update',$this->plugin_name,'update_filter'); - $app->plugins->registerEvent('firewall_filter_delete',$this->plugin_name,'delete_filter'); - - $app->plugins->registerEvent('server_insert',$this->plugin_name,'updateSettings'); - $app->plugins->registerEvent('server_update',$this->plugin_name,'updateSettings'); - - - - } - - - function insert_basic($event_name,$data) { - global $app, $conf; - - $this->update_basic($event_name,$data); - - } - - function update_basic($event_name,$data) { - global $app, $conf; - - $tcp_ports = ''; - $udp_ports = ''; - - $delete_rule = ($data["new"]["active"] == "n" ? "delete " : ""); - /* - $ports = explode(',',$data["new"]["tcp_port"]); - if(is_array($ports)) { - foreach($ports as $p) { - if(strstr($p,':')) { - $p_parts = explode(':',$p); - $p_clean = intval($p_parts[0]).':'.intval($p_parts[1]); - } else { - $p_clean = intval($p); - } - - //system("ufw $delete_rule allow " . $p_clean . "/tcp"); - - } - }*/ - - system("ufw $delete_rule allow out" . $data["new"]["tcp_port"] . "/tcp"); - system("ufw $delete_rule allow in" . $data["new"]["tcp_port"] . "/tcp"); - system("ufw $delete_rule allow out" . $data["new"]["udp_port"] . "/udp"); - system("ufw $delete_rule allow in" . $data["new"]["udp_port"] . "/udp"); - //$tcp_ports = trim($tcp_ports); - /* - $ports = explode(',',$data["new"]["udp_port"]); - if(is_array($ports)) { - foreach($ports as $p) { - if(strstr($p,':')) { - $p_parts = explode(':',$p); - $p_clean = intval($p_parts[0]).':'.intval($p_parts[1]); - } else { - $p_clean = intval($p); - } - - - } - } - - system("ufw $delete_rule allow " . $p_clean . "/udp"); - */ - - if($data["new"]["active"] == 'y') { - exec('/etc/init.d/ufw force-reload'); - $app->log('Restarting the firewall',LOGLEVEL_DEBUG); - } else { - exec('/etc/init.d/ufw force-reload'); - $app->log('Flushing the firewall',LOGLEVEL_DEBUG); - } - - - } - - - function insert_filter($event_name,$data) { - global $app, $conf; - - $this->update_filter($event_name,$data); - - } - - function getCidr($mask) { - $long = ip2long($mask); - $base = ip2long('255.255.255.255'); - return 32-log(($long ^ $base)+1,2); - } - - function update_filter($event_name,$data) { - global $app, $conf; - - $app->uses("getconf"); - $server_config = $app->getconf->get_server_config($conf["server_id"], 'ufw'); - $network = $server_config["ufw_network"]; - - $records = $app->db->queryAllRecords( - "SELECT - protocol, - IF - (src_from_port=src_to_port, src_from_port, CONCAT(src_from_port, ':',src_to_port)) - AS - src_port, - IF - (dst_from_port=dst_to_port, dst_from_port, CONCAT(dst_from_port, ':',dst_to_port)) - AS - dst_port, - IF - (src_ip='0.0.0.0','any',src_ip) - AS - src_ip, - IF - (dst_ip='0.0.0.0','any',dst_ip) - AS - dst_ip, - src_netmask, - dst_netmask, - inbound_policy, - outbound_policy, - rule_id, - active - FROM - firewall_filter - ORDER BY - rule_id - ASC"); - - $commands = array(); - foreach ($records as $record) { - $src_netmask = $this->getCidr($record["src_netmask"]); - $dst_netmask = $this->getCidr($record["dst_netmask"]); - $src_port = ($record["src_port"] == "0:65535" ? "" : " port " .$record["src_port"]); - $dst_port = ($record["dst_port"] == "0:65535" ? "" : " port " . $record["dst_port"]); - $src_ip = ($record["src_ip"] == "any" ? "any" : $record["src_ip"] . "/" . $src_netmask); - $dst_ip = ($record["dst_ip"] == "any" ? "any" : $record["dst_ip"] . "/" . $dst_netmask); - //$protocol = $record["protocol"]; - $delete = ($record["active"] == "n" ? true : false); - //$protocols = array_split($record["protocol"]); - //$inbound = ($record["inbound"] == 0 ? "deny " : "allow"); - //$outbound = ($record["outbound"] == 0 ? "deny out" : "allow out"); - - //foreach ($protocols as $protocol) { - - - $ufw = new UFW(); - //$ufw->setDelete($record["active"] == "n"); - $ufw->setRuleID($record["rule_id"]); - $ufw->setSrcIP($src_ip); - $ufw->setDstIP($dst_ip); - $ufw->setSrcPort($src_port); - $ufw->setDstPort($dst_port); - $ufw->setInboundPolicy($record["inbound_policy"]); - $ufw->setOutboundPolicy($record["outbound_policy"]); - $ufw->setProtocol($record["protocol"]); - $ufw->setNetwork($network); - - if ($delete) { - $ufw->delete(); - } else { - $ufw->insert(); - } - //} - - /* - if ($record["active"] == 'n') { - $inbound = ($record["inbound"] == 0 ? "deny " : "allow"); - $outbound = ($record["outbound"] == 0 ? "deny out" : "allow out"); - array_push($commands, "ufw deny proto udp from $src_ip $src_port to $dst_ip $dst_port"); - if ($protocol == "tcp/udp") { - array_push($commands, "ufw delete $inbound proto udp from $src_ip $src_port to $dst_ip $dst_port"); - array_push($commands, "ufw delete $outbound proto udp from $src_ip $src_port to $dst_ip $dst_port"); - array_push($commands, "ufw delete $inbound proto tcp from $src_ip $src_port to $dst_ip $dst_port"); - array_push($commands, "ufw delete $outbound proto tcp from $src_ip $src_port to $dst_ip $dst_port"); - } else { - array_push($commands, "ufw delete $inbound proto $protocol from $src_ip $src_port to $dst_ip $dst_port"); - array_push($commands, "ufw delete $outbound proto $protocol from $src_ip $src_port to $dst_ip $dst_port"); - } - } elseif ($record["inbound"] == 0) { - if ($protocol == "tcp/udp") { - array_push($commands, "ufw deny proto udp from $src_ip $src_port to $dst_ip $dst_port"); - array_push($commands, "ufw deny proto tcp from $src_ip $src_port to $dst_ip $dst_port"); - } else { - array_push($commands, "ufw deny proto $protocol from $src_ip $src_port to $dst_ip $dst_port"); - } - - } elseif ($record["outbound"] == 0) { - if ($protocol == "tcp/udp") { - array_push($commands, "ufw deny out proto udp from $network to any $dst_port"); - array_push($commands, "ufw deny out proto tcp from $network to any $dst_port"); - } else { - array_push($commands, "ufw deny out proto $protocol from $network to any $dst_port"); - } - }*/ - - - } - - /* - - $records = $app->db->queryAllRecords( - "SELECT - protocol, - IF - (src_from_port=src_to_port, src_from_port, CONCAT(src_from_port, ':',src_to_port)) - AS - src_port, - IF - (dst_from_port=dst_to_port, dst_from_port, CONCAT(dst_from_port, ':',dst_to_port)) - AS - dst_port, - IF - (src_ip='0.0.0.0','any',src_ip) - AS - src_ip, - IF - (dst_ip='0.0.0.0','any',dst_ip) - AS - dst_ip, - src_netmask, - dst_netmask, - inbound, - outbound, - active - FROM - firewall_filter - WHERE - inbound=1 - OR - outbound=1 - AND - active='y'"); - - - foreach ($records as $record) { - $src_netmask = $this->getCidr($record["src_netmask"]); - $dst_netmask = $this->getCidr($record["dst_netmask"]); - $src_port = ($record["src_port"] == "0:65535" ? "" : " port " .$record["src_port"]); - $dst_port = ($record["dst_port"] == "0:65535" ? "" : " port " . $record["dst_port"]); - $src_ip = ($record["src_ip"] == "any" ? "any" : $record["src_ip"] . "/" . $src_netmask); - $dst_ip = ($record["dst_ip"] == "any" ? "any" : $record["dst_ip"] . "/" . $dst_netmask); - $protocol = $record["protocol"]; - $outbound = ($record["outbound"] == 1 ? "out" : ""); - - - - if ($record["inbound"] == 1) { - if ($protocol == "tcp/udp") { - array_push($commands, "ufw allow proto udp from $src_ip $src_port to $dst_ip $dst_port"); - array_push($commands, "ufw allow proto tcp from $src_ip $src_port to $dst_ip $dst_port"); - } else { - array_push($commands, "ufw allow proto $protocol from $src_ip $src_port to $dst_ip $dst_port"); - } - - } elseif ($record["outbound"] == 1) { - if ($protocol == "tcp/udp") { - array_push($commands, "ufw allow out proto udp from $network to any $dst_port"); - array_push($commands, "ufw allow out proto tcp from $network to any $dst_port"); - } else { - array_push($commands, "ufw allow out proto $protocol from $network to any $dst_port"); - } - } - - - } - - foreach ($commands as $command) { - system($command); - } - */ - } - - function insert_forward($event_name,$data) { - global $app, $conf; - - $this->update_filter($event_name,$data); - - } - - function update_forward($event_name,$data) { - global $app, $conf; - - - - } - - //update server config - - function backupConfigs() - { - copy('/etc/default/ufw','/etc/default/ufw~'); - copy('/etc/ufw/ufw.conf','/etc/ufw/ufw.conf~'); - copy('/etc/ufw/before.rules','/etc/ufw/before.rules~'); - } - - function updateSettings($event_name,$data) { - global $app, $conf; - - // get the config - $app->uses("getconf"); - $server_config = $app->getconf->get_server_config($conf["server_id"], 'ufw'); - - - if(is_dir('/etc/ufw') && is_file('/etc/default/ufw')) { - $this->backupConfigs(); - - $app->load('tpl'); - - $ufw_tpl = new tpl(); - $ufw_tpl->newTemplate("ufw.conf.master"); - - $ufw_tpl->setVar('enable',($server_config["ufw_enable"] == "" ? "no" : $server_config["ufw_enable"])); - $ufw_tpl->setVar('log_level',$server_config["ufw_log_level"]); - - - file_put_contents('/etc/ufw/ufw.conf',$ufw_tpl->grab()); - unset($ufw_tpl); - - $app->log("Changed UFW settings",LOGLEVEL_DEBUG); - - $ufw_tpl = new tpl(); - $ufw_tpl->newTemplate("ufw.default.master"); - - $ufw_tpl->setVar('ipv6',$server_config["ufw_ipv6"] == "" ? "no" : $server_config["ufw_ipv6"]); - $ufw_tpl->setVar('default_input_policy',$server_config["ufw_default_input_policy"]); - $ufw_tpl->setVar('default_output_policy',$server_config["ufw_default_output_policy"]); - $ufw_tpl->setVar('default_forward_policy',$server_config["ufw_default_forward_policy"]); - $ufw_tpl->setVar('default_application_policy',$server_config["ufw_default_application_policy"]); - $ufw_tpl->setVar('manage_builtins',$server_config["ufw_manage_builtins"] == "" ? "no" : $server_config["ufw_manage_builtins"]); - - file_put_contents('/etc/default/ufw',$ufw_tpl->grab()); - unset($ufw_tpl); - - $app->log("Changed default UFW settings",LOGLEVEL_DEBUG); - - $app->services->restartServiceDelayed('ufw','--force-reload'); - - } else { - $app->log("Ubuntu Uncomplicated Firewall configuration not available for this linux distribution.",LOGLEVEL_DEBUG); - } - - } - - - - -} // end class - -class UFW { - - var $_delete = false; - var $_ufwCmd = "ufw"; - var $_inboundPolicy = "allow"; - var $_outboundPolicy = "allow"; - var $_protocol = "tcp"; - var $_ruleID = 1; - var $_srcIP; - var $_dstIP; - var $_srcPort; - var $_dstPort; - var $_network = "0.0.0.0/24"; - - function UFW() { - - } - - function setDelete($delete) { - $this->_delete = $delete; - } - - function setInboundPolicy($policy) { - $this->_inboundPolicy = $policy; - } - - function setOutboundPolicy($policy) { - $this->_outboundPolicy = $policy; - } - - function setProtocol($protocol) { - $this->_outboundPolicy = $protocol; - } - - function setRuleID($id) { - $this->_ruleID = $id; - } - - function setSrcIP($ip) { - $this->_srcIP = $ip; - } - - function setDstIP($ip) { - $this->_dstIP = $ip; - } - - function setSrcPort($port) { - $this->_srcPort = $port; - } - - function setDstPort($port) { - $this->_dstPort = $port; - } - - function setNetwork($network) { - $this->_network = $network; - } - - - function insert() { - $protocols = split("/",$this->_protocol); - foreach ($protocols as $protocol) { - $inbound = sprintf("ufw insert %s %s proto %s from %s port %s to %s port %s ", $this->_ruleID, $this->_inboundPolicy, $protocol, $this->_srcIP, $this->_srcPort, $this->_dstIP, $this->_dstPort); - $outbound = sprintf("ufw insert %s %s proto %s from %s port %s to %s port %s ", $this->_ruleID, $this->_outboundPolicy, $protocol, $this->_network, $this->_srcPort, $this->_dstIP, $this->_dstPort); - - echo $inbound."\n"; - echo $outbound."\n"; - system($inbound); - system($outbound); - } - } - - function delete() { - $protocols = split("/",$this->_protocol); - foreach ($protocols as $protocol) { - $inbound = sprintf("ufw delete %s proto %s from %s port %s to %s port %s ", $this->_ruleID, $this->_inboundPolicy, $protocol, $this->_srcIP, $this->_srcPort, $this->_dstIP, $this->_dstPort); - $outbound = sprintf("ufw delete %s proto %s from %s port %s to %s port %s ", $this->_ruleID, $this->_outboundPolicy, $protocol, $this->_network, $this->_srcPort, $this->_dstIP, $this->_dstPort); - - echo $inbound."\n"; - echo $outbound."\n"; - - system($inbound); - system($outbound); - } - } - -} - -?> +plugins->registerEvent('firewall_insert',$this->plugin_name,'insert_basic'); + $app->plugins->registerEvent('firewall_update',$this->plugin_name,'update_basic'); + $app->plugins->registerEvent('firewall_delete',$this->plugin_name,'update_basic'); + + $app->plugins->registerEvent('firewall_forward_insert',$this->plugin_name,'insert_forward'); + $app->plugins->registerEvent('firewall_forward_update',$this->plugin_name,'update_forward'); + $app->plugins->registerEvent('firewall_forward_delete',$this->plugin_name,'update_forward'); + + $app->plugins->registerEvent('firewall_filter_insert',$this->plugin_name,'insert_filter'); + $app->plugins->registerEvent('firewall_filter_update',$this->plugin_name,'update_filter'); + $app->plugins->registerEvent('firewall_filter_delete',$this->plugin_name,'delete_filter'); + + $app->plugins->registerEvent('server_insert',$this->plugin_name,'updateSettings'); + $app->plugins->registerEvent('server_update',$this->plugin_name,'updateSettings'); + + + + } + + + function insert_basic($event_name,$data) { + global $app, $conf; + + $this->update_basic($event_name,$data); + + } + + function update_basic($event_name,$data) { + global $app, $conf; + + $tcp_ports = ''; + $udp_ports = ''; + + $delete_rule = ($data["new"]["active"] == "n" ? "delete " : ""); + /* + $ports = explode(',',$data["new"]["tcp_port"]); + if(is_array($ports)) { + foreach($ports as $p) { + if(strstr($p,':')) { + $p_parts = explode(':',$p); + $p_clean = intval($p_parts[0]).':'.intval($p_parts[1]); + } else { + $p_clean = intval($p); + } + + //system("ufw $delete_rule allow " . $p_clean . "/tcp"); + + } + }*/ + + system("ufw $delete_rule allow out" . $data["new"]["tcp_port"] . "/tcp"); + system("ufw $delete_rule allow in" . $data["new"]["tcp_port"] . "/tcp"); + system("ufw $delete_rule allow out" . $data["new"]["udp_port"] . "/udp"); + system("ufw $delete_rule allow in" . $data["new"]["udp_port"] . "/udp"); + //$tcp_ports = trim($tcp_ports); + /* + $ports = explode(',',$data["new"]["udp_port"]); + if(is_array($ports)) { + foreach($ports as $p) { + if(strstr($p,':')) { + $p_parts = explode(':',$p); + $p_clean = intval($p_parts[0]).':'.intval($p_parts[1]); + } else { + $p_clean = intval($p); + } + + + } + } + + system("ufw $delete_rule allow " . $p_clean . "/udp"); + */ + + if($data["new"]["active"] == 'y') { + exec('/etc/init.d/ufw force-reload'); + $app->log('Restarting the firewall',LOGLEVEL_DEBUG); + } else { + exec('/etc/init.d/ufw force-reload'); + $app->log('Flushing the firewall',LOGLEVEL_DEBUG); + } + + + } + + + function insert_filter($event_name,$data) { + global $app, $conf; + + $this->update_filter($event_name,$data); + + } + + function getCidr($mask) { + $long = ip2long($mask); + $base = ip2long('255.255.255.255'); + return 32-log(($long ^ $base)+1,2); + } + + function update_filter($event_name,$data) { + global $app, $conf; + + $app->uses("getconf"); + $server_config = $app->getconf->get_server_config($conf["server_id"], 'ufw'); + $network = $server_config["ufw_network"]; + + $records = $app->db->queryAllRecords( + "SELECT + protocol, + IF + (src_from_port=src_to_port, src_from_port, CONCAT(src_from_port, ':',src_to_port)) + AS + src_port, + IF + (dst_from_port=dst_to_port, dst_from_port, CONCAT(dst_from_port, ':',dst_to_port)) + AS + dst_port, + IF + (src_ip='0.0.0.0','any',src_ip) + AS + src_ip, + IF + (dst_ip='0.0.0.0','any',dst_ip) + AS + dst_ip, + src_netmask, + dst_netmask, + inbound_policy, + outbound_policy, + rule_id, + active + FROM + firewall_filter + ORDER BY + rule_id + ASC"); + + $commands = array(); + foreach ($records as $record) { + $src_netmask = $this->getCidr($record["src_netmask"]); + $dst_netmask = $this->getCidr($record["dst_netmask"]); + $src_port = ($record["src_port"] == "0:65535" ? "" : " port " .$record["src_port"]); + $dst_port = ($record["dst_port"] == "0:65535" ? "" : " port " . $record["dst_port"]); + $src_ip = ($record["src_ip"] == "any" ? "any" : $record["src_ip"] . "/" . $src_netmask); + $dst_ip = ($record["dst_ip"] == "any" ? "any" : $record["dst_ip"] . "/" . $dst_netmask); + //$protocol = $record["protocol"]; + $delete = ($record["active"] == "n" ? true : false); + //$protocols = array_split($record["protocol"]); + //$inbound = ($record["inbound"] == 0 ? "deny " : "allow"); + //$outbound = ($record["outbound"] == 0 ? "deny out" : "allow out"); + + //foreach ($protocols as $protocol) { + + + $ufw = new UFW(); + //$ufw->setDelete($record["active"] == "n"); + $ufw->setRuleID($record["rule_id"]); + $ufw->setSrcIP($src_ip); + $ufw->setDstIP($dst_ip); + $ufw->setSrcPort($src_port); + $ufw->setDstPort($dst_port); + $ufw->setInboundPolicy($record["inbound_policy"]); + $ufw->setOutboundPolicy($record["outbound_policy"]); + $ufw->setProtocol($record["protocol"]); + $ufw->setNetwork($network); + + if ($delete) { + $ufw->delete(); + } else { + $ufw->insert(); + } + //} + + /* + if ($record["active"] == 'n') { + $inbound = ($record["inbound"] == 0 ? "deny " : "allow"); + $outbound = ($record["outbound"] == 0 ? "deny out" : "allow out"); + array_push($commands, "ufw deny proto udp from $src_ip $src_port to $dst_ip $dst_port"); + if ($protocol == "tcp/udp") { + array_push($commands, "ufw delete $inbound proto udp from $src_ip $src_port to $dst_ip $dst_port"); + array_push($commands, "ufw delete $outbound proto udp from $src_ip $src_port to $dst_ip $dst_port"); + array_push($commands, "ufw delete $inbound proto tcp from $src_ip $src_port to $dst_ip $dst_port"); + array_push($commands, "ufw delete $outbound proto tcp from $src_ip $src_port to $dst_ip $dst_port"); + } else { + array_push($commands, "ufw delete $inbound proto $protocol from $src_ip $src_port to $dst_ip $dst_port"); + array_push($commands, "ufw delete $outbound proto $protocol from $src_ip $src_port to $dst_ip $dst_port"); + } + } elseif ($record["inbound"] == 0) { + if ($protocol == "tcp/udp") { + array_push($commands, "ufw deny proto udp from $src_ip $src_port to $dst_ip $dst_port"); + array_push($commands, "ufw deny proto tcp from $src_ip $src_port to $dst_ip $dst_port"); + } else { + array_push($commands, "ufw deny proto $protocol from $src_ip $src_port to $dst_ip $dst_port"); + } + + } elseif ($record["outbound"] == 0) { + if ($protocol == "tcp/udp") { + array_push($commands, "ufw deny out proto udp from $network to any $dst_port"); + array_push($commands, "ufw deny out proto tcp from $network to any $dst_port"); + } else { + array_push($commands, "ufw deny out proto $protocol from $network to any $dst_port"); + } + }*/ + + + } + + /* + + $records = $app->db->queryAllRecords( + "SELECT + protocol, + IF + (src_from_port=src_to_port, src_from_port, CONCAT(src_from_port, ':',src_to_port)) + AS + src_port, + IF + (dst_from_port=dst_to_port, dst_from_port, CONCAT(dst_from_port, ':',dst_to_port)) + AS + dst_port, + IF + (src_ip='0.0.0.0','any',src_ip) + AS + src_ip, + IF + (dst_ip='0.0.0.0','any',dst_ip) + AS + dst_ip, + src_netmask, + dst_netmask, + inbound, + outbound, + active + FROM + firewall_filter + WHERE + inbound=1 + OR + outbound=1 + AND + active='y'"); + + + foreach ($records as $record) { + $src_netmask = $this->getCidr($record["src_netmask"]); + $dst_netmask = $this->getCidr($record["dst_netmask"]); + $src_port = ($record["src_port"] == "0:65535" ? "" : " port " .$record["src_port"]); + $dst_port = ($record["dst_port"] == "0:65535" ? "" : " port " . $record["dst_port"]); + $src_ip = ($record["src_ip"] == "any" ? "any" : $record["src_ip"] . "/" . $src_netmask); + $dst_ip = ($record["dst_ip"] == "any" ? "any" : $record["dst_ip"] . "/" . $dst_netmask); + $protocol = $record["protocol"]; + $outbound = ($record["outbound"] == 1 ? "out" : ""); + + + + if ($record["inbound"] == 1) { + if ($protocol == "tcp/udp") { + array_push($commands, "ufw allow proto udp from $src_ip $src_port to $dst_ip $dst_port"); + array_push($commands, "ufw allow proto tcp from $src_ip $src_port to $dst_ip $dst_port"); + } else { + array_push($commands, "ufw allow proto $protocol from $src_ip $src_port to $dst_ip $dst_port"); + } + + } elseif ($record["outbound"] == 1) { + if ($protocol == "tcp/udp") { + array_push($commands, "ufw allow out proto udp from $network to any $dst_port"); + array_push($commands, "ufw allow out proto tcp from $network to any $dst_port"); + } else { + array_push($commands, "ufw allow out proto $protocol from $network to any $dst_port"); + } + } + + + } + + foreach ($commands as $command) { + system($command); + } + */ + } + + function insert_forward($event_name,$data) { + global $app, $conf; + + $this->update_filter($event_name,$data); + + } + + function update_forward($event_name,$data) { + global $app, $conf; + + + + } + + //update server config + + function backupConfigs() + { + copy('/etc/default/ufw','/etc/default/ufw~'); + copy('/etc/ufw/ufw.conf','/etc/ufw/ufw.conf~'); + copy('/etc/ufw/before.rules','/etc/ufw/before.rules~'); + } + + function updateSettings($event_name,$data) { + global $app, $conf; + + // get the config + $app->uses("getconf"); + $server_config = $app->getconf->get_server_config($conf["server_id"], 'ufw'); + + + if(is_dir('/etc/ufw') && is_file('/etc/default/ufw')) { + $this->backupConfigs(); + + $app->load('tpl'); + + $ufw_tpl = new tpl(); + $ufw_tpl->newTemplate("ufw.conf.master"); + + $ufw_tpl->setVar('enable',($server_config["ufw_enable"] == "" ? "no" : $server_config["ufw_enable"])); + $ufw_tpl->setVar('log_level',$server_config["ufw_log_level"]); + + + file_put_contents('/etc/ufw/ufw.conf',$ufw_tpl->grab()); + unset($ufw_tpl); + + $app->log("Changed UFW settings",LOGLEVEL_DEBUG); + + $ufw_tpl = new tpl(); + $ufw_tpl->newTemplate("ufw.default.master"); + + $ufw_tpl->setVar('ipv6',$server_config["ufw_ipv6"] == "" ? "no" : $server_config["ufw_ipv6"]); + $ufw_tpl->setVar('default_input_policy',$server_config["ufw_default_input_policy"]); + $ufw_tpl->setVar('default_output_policy',$server_config["ufw_default_output_policy"]); + $ufw_tpl->setVar('default_forward_policy',$server_config["ufw_default_forward_policy"]); + $ufw_tpl->setVar('default_application_policy',$server_config["ufw_default_application_policy"]); + $ufw_tpl->setVar('manage_builtins',$server_config["ufw_manage_builtins"] == "" ? "no" : $server_config["ufw_manage_builtins"]); + + file_put_contents('/etc/default/ufw',$ufw_tpl->grab()); + unset($ufw_tpl); + + $app->log("Changed default UFW settings",LOGLEVEL_DEBUG); + + $app->services->restartServiceDelayed('ufw','--force-reload'); + + } else { + $app->log("Ubuntu Uncomplicated Firewall configuration not available for this linux distribution.",LOGLEVEL_DEBUG); + } + + } + + + + +} // end class + +class UFW { + + var $_delete = false; + var $_ufwCmd = "ufw"; + var $_inboundPolicy = "allow"; + var $_outboundPolicy = "allow"; + var $_protocol = "tcp"; + var $_ruleID = 1; + var $_srcIP; + var $_dstIP; + var $_srcPort; + var $_dstPort; + var $_network = "0.0.0.0/24"; + + function UFW() { + + } + + function setDelete($delete) { + $this->_delete = $delete; + } + + function setInboundPolicy($policy) { + $this->_inboundPolicy = $policy; + } + + function setOutboundPolicy($policy) { + $this->_outboundPolicy = $policy; + } + + function setProtocol($protocol) { + $this->_outboundPolicy = $protocol; + } + + function setRuleID($id) { + $this->_ruleID = $id; + } + + function setSrcIP($ip) { + $this->_srcIP = $ip; + } + + function setDstIP($ip) { + $this->_dstIP = $ip; + } + + function setSrcPort($port) { + $this->_srcPort = $port; + } + + function setDstPort($port) { + $this->_dstPort = $port; + } + + function setNetwork($network) { + $this->_network = $network; + } + + + function insert() { + $protocols = split("/",$this->_protocol); + foreach ($protocols as $protocol) { + $inbound = sprintf("ufw insert %s %s proto %s from %s port %s to %s port %s ", $this->_ruleID, $this->_inboundPolicy, $protocol, $this->_srcIP, $this->_srcPort, $this->_dstIP, $this->_dstPort); + $outbound = sprintf("ufw insert %s %s proto %s from %s port %s to %s port %s ", $this->_ruleID, $this->_outboundPolicy, $protocol, $this->_network, $this->_srcPort, $this->_dstIP, $this->_dstPort); + + echo $inbound."\n"; + echo $outbound."\n"; + system($inbound); + system($outbound); + } + } + + function delete() { + $protocols = split("/",$this->_protocol); + foreach ($protocols as $protocol) { + $inbound = sprintf("ufw delete %s proto %s from %s port %s to %s port %s ", $this->_ruleID, $this->_inboundPolicy, $protocol, $this->_srcIP, $this->_srcPort, $this->_dstIP, $this->_dstPort); + $outbound = sprintf("ufw delete %s proto %s from %s port %s to %s port %s ", $this->_ruleID, $this->_outboundPolicy, $protocol, $this->_network, $this->_srcPort, $this->_dstIP, $this->_dstPort); + + echo $inbound."\n"; + echo $outbound."\n"; + + system($inbound); + system($outbound); + } + } + +} + +?> -- GitLab