--- /root/trunk2diff/gui/reseller/domain_edit.php 2009-03-13 10:14:03.000000000 +0000
+++ /var/www/ispcp/gui/reseller/domain_edit.php 2009-03-13 10:03:47.000000000 +0000
@@ -65,6 +65,7 @@
'TR_SQL_USERS' => tr('SQL users limit <br /><i>(-1 disabled, 0 unlimited)</i>'),
'TR_TRAFFIC' => tr('Traffic limit [MB] <br /><i>(0 unlimited)</i>'),
'TR_DISK' => tr('Disk limit [MB] <br /><i>(0 unlimited)</i>'),
+ 'TR_MAIL_QUOTA' => tr('Mailbox Quota [MB]'),
'TR_USER_NAME' => tr('Username'),
'TR_UPDATE_DATA' => tr('Submit changes'),
'TR_CANCEL' => tr('Cancel'),
@@ -118,7 +119,7 @@
function load_user_data($user_id, $domain_id) {
$sql = Database::getInstance();
- global $domain_name, $domain_ip, $php_sup;
+ global $domain_name, $domain_ip, $php_sup, $mailquota;
global $cgi_supp , $sub, $als;
global $mail, $ftp, $sql_db;
global $sql_user, $traff, $disk;
@@ -154,6 +155,7 @@
) = generate_user_props($domain_id);;
load_additional_data($user_id, $domain_id);
+
} //End of load_user_data()
// Load additional data
@@ -216,6 +218,22 @@
$data = $res->FetchRow();
$username = $data['admin_name'];
+
+ //Mailbox Quotas
+ // Get domain data
+ $query = <<<SQL_QUERY
+ SELECT
+ quota
+ FROM
+ mail_users
+ WHERE
+ domain_id = ?
+SQL_QUERY;
+
+ $res = exec_query($sql, $query, array($domain_id));
+ $data = $res->FetchRow();
+
+ $mailquota = $data['quota']/1024/1024;
} //End of load_additional_data()
// Show user data
@@ -224,7 +242,7 @@
global $cgi_supp , $sub, $als;
global $mail, $ftp, $sql_db;
global $sql_user, $traff, $disk;
- global $username;
+ global $username, $mailquota;
// Fill in the fields
$domain_name = decode_idna($domain_name);
@@ -276,6 +294,7 @@
'VL_SQL_USERS' => $sql_user,
'VL_TRAFFIC' => $traff,
'VL_DOM_DISK' => $disk,
+ 'VL_MAIL_QUOTA' => $mailquota,
'VL_USER_NAME' => $username
)
);
@@ -283,7 +302,7 @@
// Check input data
function check_user_data(&$tpl, &$sql, $reseller_id, $user_id) {
- global $sub, $als, $mail, $ftp, $sql_db, $sql_user, $traff, $disk, $sql, $domain_ip, $domain_php, $domain_cgi;
+ global $sub, $als, $mail, $ftp, $sql_db, $sql_user, $traff, $disk, $sql, $domain_ip, $domain_php, $domain_cgi, $mailquota;
$sub = clean_input($_POST['dom_sub']);
$als = clean_input($_POST['dom_alias']);
@@ -296,6 +315,7 @@
// $domain_ip = $_POST['domain_ip'];
$domain_php = $_POST['domain_php'];
$domain_cgi = $_POST['domain_cgi'];
+ $mailquota = clean_input($_POST['mailboxquota']);
$ed_error = '';
@@ -329,6 +349,12 @@
if (!ispcp_limit_check($disk, null)) {
$ed_error .= tr('Incorrect disk quota limit!');
}
+ if (!ispcp_limit_check($mailquota, null)) {
+ $ed_error .= tr('Incorrect mailbox quota limit!');
+ }
+ else if ($mailquota < 10) {
+ $ed_error .= tr('mailbox quota should be minimum 10MB!');
+ }
// $user_props = generate_user_props($user_id);
// $reseller_props = generate_reseller_props($reseller_id);
@@ -424,6 +450,10 @@
return false;
}
+ // update mailbox quotas
+ $mailquota = $mailquota*1024*1024;
+ $query = "UPDATE `mail_users` SET `quota` = '$mailquota' WHERE `domain_id` = ?";
+ $rs = exec_query($sql, $query, array($user_id));
// update the sql quotas too
$query = "SELECT domain_name FROM domain WHERE domain_id=?";
@@ -588,4 +618,4 @@
unset_messages();
-?>
\ No newline at end of file
+?>