Commit 1ca82372 authored by tbrehm's avatar tbrehm

Merged revisions 2181-2262 from stable branch.

parent fcac50bb
......@@ -96,6 +96,14 @@ class installer extends installer_base {
chgrp($config_dir.'/'.$configfile, 'root');
}
public function configure_apache() {
global $conf;
if(file_exists('/etc/apache2/mods-available/fcgid.conf')) replaceLine('/etc/apache2/mods-available/fcgid.conf','MaxRequestLen','MaxRequestLen 15728640',0,1);
parent::configure_apache();
}
}
......
......@@ -105,12 +105,6 @@ class installer_dist extends installer_base {
'transport_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_transports.cf',
'relay_domains = mysql:'.$config_dir.'/mysql-virtual_relaydomains.cf',
'relay_recipient_maps = mysql:'.$config_dir.'/mysql-virtual_relayrecipientmaps.cf',
'virtual_create_maildirsize = yes',
'virtual_maildir_extended = yes',
'virtual_mailbox_limit_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_mailbox_limit_maps.cf',
'virtual_mailbox_limit_override = yes',
'virtual_maildir_limit_message = "The user you are trying to reach is over quota."',
'virtual_overquota_bounce = yes',
'proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps',
'smtpd_sender_restrictions = check_sender_access mysql:'.$config_dir.'/mysql-virtual_sender.cf',
'smtpd_client_restrictions = check_client_access mysql:'.$config_dir.'/mysql-virtual_client.cf',
......
......@@ -101,13 +101,6 @@ class installer extends installer_base
'smtpd_tls_key_file = '.$config_dir.'/smtpd.key',
'transport_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_transports.cf',
'relay_domains = mysql:'.$config_dir.'/mysql-virtual_relaydomains.cf',
'relay_recipient_maps = mysql:'.$config_dir.'/mysql-virtual_relayrecipientmaps.cf',
'virtual_create_maildirsize = yes',
'virtual_maildir_extended = yes',
'virtual_mailbox_limit_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_mailbox_limit_maps.cf',
'virtual_mailbox_limit_override = yes',
'virtual_maildir_limit_message = "The user you are trying to reach is over quota."',
'virtual_overquota_bounce = yes',
'proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps',
'smtpd_sender_restrictions = check_sender_access mysql:'.$config_dir.'/mysql-virtual_sender.cf',
'smtpd_client_restrictions = check_client_access mysql:'.$config_dir.'/mysql-virtual_client.cf',
......
......@@ -76,6 +76,8 @@ class installer_dist extends installer_base {
caselog('chgrp '.$cf['group'].' '.$config_dir.'/mysql-virtual_*.cf* &> /dev/null',
__FILE__, __LINE__, 'chgrp on mysql-virtual_*.cf*', 'chgrp on mysql-virtual_*.cf* failed');
if(!is_dir($cf['vmail_mailbox_base'])) mkdir($cf['vmail_mailbox_base']);
//* Creating virtual mail user and group
if(is_group($cf['vmail_groupname'])) {
$command = 'groupmod -g '.$cf['vmail_groupid'].' '.$cf['vmail_groupname'];
......@@ -117,12 +119,6 @@ class installer_dist extends installer_base {
'transport_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_transports.cf',
'relay_domains = mysql:'.$config_dir.'/mysql-virtual_relaydomains.cf',
'relay_recipient_maps = mysql:'.$config_dir.'/mysql-virtual_relayrecipientmaps.cf',
'virtual_create_maildirsize = yes',
'virtual_maildir_extended = yes',
'virtual_mailbox_limit_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_mailbox_limit_maps.cf',
'virtual_mailbox_limit_override = yes',
'virtual_maildir_limit_message = "The user you are trying to reach is over quota."',
'virtual_overquota_bounce = yes',
'proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps',
'smtpd_sender_restrictions = check_sender_access mysql:'.$config_dir.'/mysql-virtual_sender.cf',
'smtpd_client_restrictions = check_client_access mysql:'.$config_dir.'/mysql-virtual_client.cf',
......
......@@ -116,7 +116,7 @@ class installer_base {
if(is_installed('mailman')) $conf['mailman']['installed'] = true;
if(is_installed('apache') || is_installed('apache2') || is_installed('httpd')) $conf['apache']['installed'] = true;
if(is_installed('getmail')) $conf['getmail']['installed'] = true;
if(is_installed('courierlogger')) $conf['courier']['installed'] = true;
if(is_installed('courierlogger')) $conf['courier']['installed'] = true;
if(is_installed('dovecot')) $conf['dovecot']['installed'] = true;
if(is_installed('saslsauthd')) $conf['saslauthd']['installed'] = true;
if(is_installed('amavisd-new')) $conf['amavis']['installed'] = true;
......@@ -578,12 +578,6 @@ class installer_base {
'transport_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_transports.cf',
'relay_domains = mysql:'.$config_dir.'/mysql-virtual_relaydomains.cf',
'relay_recipient_maps = mysql:'.$config_dir.'/mysql-virtual_relayrecipientmaps.cf',
'virtual_create_maildirsize = yes',
'virtual_maildir_extended = yes',
'virtual_mailbox_limit_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_mailbox_limit_maps.cf',
'virtual_mailbox_limit_override = yes',
'virtual_maildir_limit_message = "The user you are trying to reach is over quota."',
'virtual_overquota_bounce = yes',
'proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps',
'smtpd_sender_restrictions = check_sender_access mysql:'.$config_dir.'/mysql-virtual_sender.cf',
'smtpd_client_restrictions = check_client_access mysql:'.$config_dir.'/mysql-virtual_client.cf',
......@@ -622,7 +616,7 @@ class installer_base {
if(!stristr($options,'dont-create-certs')) {
//* Create the SSL certificate
$command = 'cd '.$config_dir.'; '
.'openssl req -new -outform PEM -out smtpd.cert -newkey rsa:2048 -nodes -keyout smtpd.key -keyform PEM -days 365 -x509';
.'openssl req -new -outform PEM -out smtpd.cert -newkey rsa:2048 -nodes -keyout smtpd.key -keyform PEM -days 3650 -x509';
exec($command);
$command = 'chmod o= '.$config_dir.'/smtpd.key';
......@@ -1103,7 +1097,8 @@ class installer_base {
// Check the awsatst script
if(!is_dir('/usr/share/awstats/tools')) exec('mkdir -p /usr/share/awstats/tools');
if(!file_exists('/usr/share/awstats/tools/awstats_buildstaticpages.pl') && file_exists('/usr/share/doc/awstats/examples/awstats_buildstaticpages.pl')) symlink('/usr/share/doc/awstats/examples/awstats_buildstaticpages.pl','/usr/share/awstats/tools/awstats_buildstaticpages.pl');
if(file_exists('/etc/awstats/awstats.conf.local')) replaceLine('/etc/awstats/awstats.conf.local','LogFormat=4','LogFormat=1',0,1);
//* add a sshusers group
$command = 'groupadd sshusers';
if(!is_group('sshusers')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
......
......@@ -1362,7 +1362,7 @@ INSERT INTO `sys_user` (`userid`, `sys_userid`, `sys_groupid`, `sys_perm_user`,
-- Dumping data for table `sys_config`
--
INSERT INTO sys_config VALUES ('1','db','db_version','3.0.3.1');
INSERT INTO sys_config VALUES ('1','db','db_version','3.0.3.3');
-- --------------------------------------------------------
......
......@@ -11,25 +11,25 @@
ServerAdmin webmaster@localhost
{apps_vhost_servername}
<IfModule mod_fcgid.c>
<IfModule mod_php5.c>
DocumentRoot {apps_vhost_dir}
SuexecUserGroup ispapps ispapps
AddType application/x-httpd-php .php
<Directory {apps_vhost_dir}>
Options Indexes FollowSymLinks MultiViews +ExecCGI
AllowOverride AuthConfig Indexes Limit Options FileInfo
AddHandler fcgid-script .php
FCGIWrapper {website_basedir}/php-fcgi-scripts/apps/.php-fcgi-starter .php
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</IfModule>
<IfModule mod_php5.c>
<IfModule mod_fcgid.c>
DocumentRoot {apps_vhost_dir}
AddType application/x-httpd-php .php
SuexecUserGroup ispapps ispapps
<Directory {apps_vhost_dir}>
Options FollowSymLinks
AllowOverride None
Options Indexes FollowSymLinks MultiViews +ExecCGI
AllowOverride AuthConfig Indexes Limit Options FileInfo
AddHandler fcgid-script .php
FCGIWrapper {website_basedir}/php-fcgi-scripts/apps/.php-fcgi-starter .php
Order allow,deny
Allow from all
</Directory>
......
......@@ -56,7 +56,7 @@ $revision = str_replace(array('Revision:','$',' '), '', $svn_revision);
//** Application
define('ISPC_APP_TITLE', 'ISPConfig');
define('ISPC_APP_VERSION', '3.0.3.2');
define('ISPC_APP_VERSION', '3.0.3.3');
//** Database
......@@ -143,7 +143,6 @@ $conf['theme'] = 'default';
$conf['html_content_encoding'] = 'utf-8'; // example: utf-8, iso-8859-1, ...
$conf['logo'] = 'themes/default/images/ispc_logo.png';
//** Default Language
$conf['language'] = '{language}';
$conf['debug_language'] = false;
......
......@@ -163,7 +163,7 @@ class app {
//* Load module wordbook, if it exists
if(isset($_SESSION['s']['module']['name']) && isset($_SESSION['s']['language'])) {
$lng_file = '/web/'.$_SESSION['s']['module']['name'].'/lib/lang/'.$_SESSION['s']['language'].'.lng';
if(!file_exists(ISPC_ROOT_PATH.$lng_file)) $lng_file = '/web/'.$_SESSION['s']['module']['name'].'/lib/lang/en.lng';
if(!file_exists(ISPC_ROOT_PATH.'/'.$lng_file)) $lng_file = '/web/'.$_SESSION['s']['module']['name'].'/lib/lang/en.lng';
$this->load_language_file($lng_file);
}
$this->_language_inc = 1;
......@@ -183,7 +183,7 @@ class app {
$filename = ISPC_ROOT_PATH.'/'.$filename;
if(substr($filename,-4) != '.lng') $this->error('Language file has wrong extension.');
if(file_exists($filename)) {
@include_once($filename);
@include($filename);
if(is_array($wb)) {
if(is_array($this->_wb)) {
$this->_wb = array_merge($this->_wb,$wb);
......
......@@ -87,6 +87,15 @@ class functions {
return $out;
}
public function currency_format($number) {
global $app;
$number_format_decimals = (int)$app->lng('number_format_decimals');
$number_format_dec_point = $app->lng('number_format_dec_point');
$number_format_thousands_sep = $app->lng('number_format_thousands_sep');
if($number_format_thousands_sep == 'number_format_thousands_sep') $number_format_thousands_sep = '';
return number_format((double)$number, $number_format_decimals, $number_format_dec_point, $number_format_thousands_sep);
}
}
......
......@@ -281,7 +281,7 @@ class listform {
public function decode($record)
{
global $conf;
global $conf, $app;
if(is_array($record)) {
foreach($this->listDef['item'] as $field){
$key = $field['field'];
......@@ -333,7 +333,7 @@ class listform {
break;
case 'CURRENCY':
$record[$key] = number_format($record[$key], 2, ',', '');
$record[$key] = $app->functions->currency_format($record[$key]);
break;
default:
......
......@@ -145,6 +145,18 @@ class remoting {
}
}
public function server_get_serverid_by_ip($session_id, $ipaddress)
{
global $app;
if(!$this->checkPerm($session_id, 'server_get_serverid_by_ip')) {
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
return false;
}
$sql = "SELECT server_id FROM server_ip WHERE ip_address = '$ipaddress' LIMIT 1 ";
$all = $app->db->queryAllRecords($sql);
return $all;
}
//* Get mail domain details
public function mail_domain_get($session_id, $primary_id)
{
......@@ -1029,6 +1041,91 @@ class remoting {
return $affected_rows;
}
// -----------------------------------------------------------------------------------------------
public function client_delete_everything($session_id, $client_id)
{
global $app, $conf;
if(!$this->checkPerm($session_id, 'client_delete_everything')) {
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
return false;
}
$client_id = intval($client_id);
$client_group = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = $client_id");
$tables = 'client,dns_rr,dns_soa,dns_slave,ftp_user,mail_access,mail_content_filter,mail_domain,mail_forwarding,mail_get,mail_user,mail_user_filter,shell_user,spamfilter_users,support_message,web_database,web_domain,web_traffic';
$tables_array = explode(',',$tables);
$client_group_id = intval($client_group['groupid']);
$table_list = array();
if($client_group_id > 1) {
foreach($tables_array as $table) {
if($table != '') {
$records = $app->db->queryAllRecords("SELECT * FROM $table WHERE sys_groupid = ".$client_group_id);
$number = count($records);
if($number > 0) $table_list[] = array('table' => $table."(".$number.")");
}
}
}
if($client_id > 0) {
// remove the group of the client from the resellers group
$parent_client_id = intval($this->dataRecord['parent_client_id']);
$parent_user = $app->db->queryOneRecord("SELECT userid FROM sys_user WHERE client_id = $parent_client_id");
$client_group = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = $client_id");
$app->auth->remove_group_from_user($parent_user['userid'],$client_group['groupid']);
// delete the group of the client
$app->db->query("DELETE FROM sys_group WHERE client_id = $client_id");
// delete the sys user(s) of the client
$app->db->query("DELETE FROM sys_user WHERE client_id = $client_id");