Fixed: FS#1520 - Customer can set webspace unlimit with a limit.
| | |
| | | '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' => '', |
| | |
| | | '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' => '', |
| | |
| | | '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' => '', |
| | |
| | | $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'; |
| | | ?> |
| | |
| | | $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';
|
| | | ?> |
| | |
| | | $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>"; |
| | |
| | | $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>"; |