tbrehm
2011-02-22 090935b5d150a74d9c5660c188e2f07182684a48
Fixed: FS#1520 - Customer can set webspace unlimit with a limit.
5 files modified
16 ■■■■ changed files
interface/web/sites/form/ftp_user.tform.php 3 ●●●●● patch | view | raw | blame | history
interface/web/sites/form/web_domain.tform.php 6 ●●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/en_ftp_user.lng 1 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/en_web_domain.lng 2 ●●●●● patch | view | raw | blame | history
interface/web/sites/web_domain_edit.php 4 ●●●● patch | view | raw | blame | history
interface/web/sites/form/ftp_user.tform.php
@@ -108,6 +108,9 @@
            'formtype'    => 'TEXT',
            'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
                                                        'errmsg'=> 'quota_size_error_empty'),
                                        1 => array (    'type'    => 'REGEX',
                                                        'regex' => '/^(\-1|[0-9]{1,10})$/',
                                                        'errmsg'=> 'quota_size_error_regex'),
                                    ),
            'default'    => '-1',
            'value'        => '',
interface/web/sites/form/web_domain.tform.php
@@ -133,6 +133,9 @@
            'formtype'    => 'TEXT',
            'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
                                                        'errmsg'=> 'hd_quota_error_empty'),
                                        1 => array (    'type'    => 'REGEX',
                                                        'regex' => '/^(\-1|[0-9]{1,10})$/',
                                                        'errmsg'=> 'hd_quota_error_regex'),
                                    ),
            'default'    => '-1',
            'value'        => '',
@@ -144,6 +147,9 @@
            'formtype'    => 'TEXT',
            'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
                                                        'errmsg'=> 'traffic_quota_error_empty'),
                                        1 => array (    'type'    => 'REGEX',
                                                        'regex' => '/^(\-1|[0-9]{1,10})$/',
                                                        'errmsg'=> 'traffic_quota_error_regex'),
                                    ),
            'default'    => '-1',
            'value'        => '',
interface/web/sites/lib/lang/en_ftp_user.lng
@@ -25,4 +25,5 @@
$wb["directory_error_empty"] = 'Directory empty.';
$wb['directory_error_notinweb'] = 'Directory not inside of web root directory.';
$wb["parent_domain_id_error_empty"] = 'No website selected.';
$wb["quota_size_error_regex"] = 'Quota: enter a -1 for unlimited or a number > 0';
?>
interface/web/sites/lib/lang/en_web_domain.lng
@@ -65,4 +65,6 @@
$wb["stats_user_txt"] = 'Webstatistics username';
$wb["stats_type_txt"] = 'Webstatistics program';
$wb["custom_php_ini_txt"] = 'Custom php.ini settings';
$wb["hd_quota_error_regex"] = 'Harddisk quota: enter a -1 for unlimited or a number > 0';
$wb["traffic_quota_error_regex"] = 'Traffic quota: enter a -1 for unlimited or a number > 0';
?>
interface/web/sites/web_domain_edit.php
@@ -283,7 +283,7 @@
                $tmp = $app->db->queryOneRecord("SELECT sum(hd_quota) as webquota FROM web_domain WHERE domain_id != ".intval($this->id)." AND ".$app->tform->getAuthSQL('u'));
                $webquota = $tmp["webquota"];
                $new_web_quota = intval($this->dataRecord["hd_quota"]);
                if(($webquota + $new_web_quota > $client["limit_web_quota"]) || ($new_web_quota == -1 && $client["limit_web_quota"] != -1)) {
                if(($webquota + $new_web_quota > $client["limit_web_quota"]) || ($new_web_quota < 0 && $client["limit_web_quota"] >= 0)) {
                    $max_free_quota = floor($client["limit_web_quota"] - $webquota);
                    if($max_free_quota < 0) $max_free_quota = 0;
                    $app->tform->errorMessage .= $app->tform->lng("limit_web_quota_free_txt").": ".$max_free_quota." MB<br>";
@@ -299,7 +299,7 @@
                $tmp = $app->db->queryOneRecord("SELECT sum(traffic_quota) as trafficquota FROM web_domain WHERE domain_id != ".intval($this->id)." AND ".$app->tform->getAuthSQL('u'));
                $trafficquota = $tmp["trafficquota"];
                $new_traffic_quota = intval($this->dataRecord["traffic_quota"]);
                if(($trafficquota + $new_traffic_quota > $client["limit_traffic_quota"]) || ($new_traffic_quota == -1 && $client["limit_traffic_quota"] != -1)) {
                if(($trafficquota + $new_traffic_quota > $client["limit_traffic_quota"]) || ($new_traffic_quota < 0 && $client["limit_traffic_quota"] >= 0)) {
                    $max_free_quota = floor($client["limit_traffic_quota"] - $trafficquota);
                    if($max_free_quota < 0) $max_free_quota = 0;
                    $app->tform->errorMessage .= $app->tform->lng("limit_traffic_quota_free_txt").": ".$max_free_quota." MB<br>";