diff --git a/interface/web/client/client_message.php b/interface/web/client/client_message.php index 2617bbe67d9408a711933d6a68229022be4ed64b..a46aefa6b4426b1d8648de06ca1a6868883ba7c5 100644 --- a/interface/web/client/client_message.php +++ b/interface/web/client/client_message.php @@ -71,18 +71,18 @@ if(isset($_POST) && count($_POST) > 1) { $where[] = 'client_id = '.$app->functions->intval($tmp_client_id); } if(!empty($where)) $where_clause = ' AND ('.implode(' OR ', $where).')'; - $sql = "SELECT * FROM client WHERE email != ''".$where_clause; + $sql = "SELECT * FROM client WHERE canceled != 'y' AND email != ''".$where_clause; } else { - $sql = "SELECT * FROM client WHERE 0"; + $sql = "SELECT * FROM client WHERE canceled != 'y'"; } } else { //* Select all clients and resellers if($_SESSION["s"]["user"]["typ"] == 'admin'){ - $sql = "SELECT * FROM client WHERE email != ''"; + $sql = "SELECT * FROM client WHERE email != '' AND canceled != 'y'"; } else { $client_id = $app->functions->intval($_SESSION['s']['user']['client_id']); if($client_id == 0) die('Invalid Client ID.'); - $sql = "SELECT * FROM client WHERE email != '' AND parent_client_id = '$client_id'"; + $sql = "SELECT * FROM client WHERE email != '' AND canceled != 'y' AND parent_client_id = '$client_id'"; } } diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php index 8ebe11d92a836e6e9b1d023200400b1ba5002ce4..3aa851f649d302641e3734ce3a617267412444e0 100644 --- a/server/plugins-available/apache2_plugin.inc.php +++ b/server/plugins-available/apache2_plugin.inc.php @@ -1801,21 +1801,23 @@ class apache2_plugin { //* Create .htaccess and .htpasswd file for website statistics //if(!is_file($data['new']['document_root'].'/' . $web_folder . '/stats/.htaccess') or $data['old']['document_root'] != $data['new']['document_root']) { - if(!is_dir($data['new']['document_root'].'/' . $web_folder . '/stats')) $app->system->mkdir($data['new']['document_root'].'/' . $web_folder . '/stats'); - $ht_file = "AuthType Basic\nAuthName \"Members Only\"\nAuthUserFile ".$data['new']['document_root']."/web/stats/.htpasswd_stats\nrequire valid-user"; - $app->system->file_put_contents($data['new']['document_root'].'/' . $web_folder . '/stats/.htaccess', $ht_file); - $app->system->chmod($data['new']['document_root'].'/' . $web_folder . '/stats/.htaccess', 0755); - unset($ht_file); - //} - if(!is_file($data['new']['document_root'].'/web/stats/.htpasswd_stats') || $data['new']['stats_password'] != $data['old']['stats_password']) { - if(trim($data['new']['stats_password']) != '') { - $htp_file = 'admin:'.trim($data['new']['stats_password']); - $app->system->web_folder_protection($data['new']['document_root'], false); - $app->system->file_put_contents($data['new']['document_root'].'/web/stats/.htpasswd_stats', $htp_file); - $app->system->web_folder_protection($data['new']['document_root'], true); - $app->system->chmod($data['new']['document_root'].'/web/stats/.htpasswd_stats', 0755); - unset($htp_file); + if($data['new']['stats_type'] != '') { + if(!is_dir($data['new']['document_root'].'/' . $web_folder . '/stats')) $app->system->mkdir($data['new']['document_root'].'/' . $web_folder . '/stats'); + $ht_file = "AuthType Basic\nAuthName \"Members Only\"\nAuthUserFile ".$data['new']['document_root']."/web/stats/.htpasswd_stats\nrequire valid-user"; + $app->system->file_put_contents($data['new']['document_root'].'/' . $web_folder . '/stats/.htaccess', $ht_file); + $app->system->chmod($data['new']['document_root'].'/' . $web_folder . '/stats/.htaccess', 0755); + unset($ht_file); + + if(!is_file($data['new']['document_root'].'/web/stats/.htpasswd_stats') || $data['new']['stats_password'] != $data['old']['stats_password']) { + if(trim($data['new']['stats_password']) != '') { + $htp_file = 'admin:'.trim($data['new']['stats_password']); + $app->system->web_folder_protection($data['new']['document_root'], false); + $app->system->file_put_contents($data['new']['document_root'].'/web/stats/.htpasswd_stats', $htp_file); + $app->system->web_folder_protection($data['new']['document_root'], true); + $app->system->chmod($data['new']['document_root'].'/web/stats/.htpasswd_stats', 0755); + unset($htp_file); + } } } @@ -1824,6 +1826,11 @@ class apache2_plugin { $this->awstats_update($data, $web_config); } + //* Remove Stats-Folder when Statistics set to none + if($data['new']['stats_type'] == '' && ($data['new']['type'] == 'vhost' || $data['new']['type'] == 'vhostsubdomain' || $data['new']['type'] == 'vhostalias')) { + $app->file->removeDirectory($data['new']['document_root'].'/web/stats'); + } + $this->php_fpm_pool_update($data, $web_config, $pool_dir, $pool_name, $socket_dir, $web_folder); $this->hhvm_update($data, $web_config); diff --git a/server/plugins-available/nginx_plugin.inc.php b/server/plugins-available/nginx_plugin.inc.php index adac20c78ab4a1a0d2429c53fa922de316f2eb29..189a6f88ea70c01cc592913623137419df1bf895 100644 --- a/server/plugins-available/nginx_plugin.inc.php +++ b/server/plugins-available/nginx_plugin.inc.php @@ -1889,6 +1889,11 @@ class nginx_plugin { $this->awstats_update($data, $web_config); } + //* Remove Stats-Folder when Statistics set to none + if($data['new']['stats_type'] == '' && ($data['new']['type'] == 'vhost' || $data['new']['type'] == 'vhostsubdomain' || $data['new']['type'] == 'vhostalias')) { + $app->file->removeDirectory($data['new']['document_root'].'/web/stats'); + } + $this->php_fpm_pool_update($data, $web_config, $pool_dir, $pool_name, $socket_dir, $web_folder); $this->hhvm_update($data, $web_config);