Post a patch to the list and the developers will adjust it,
if it breaks the code.
OK, so here we go!
I have added a new config variable in conf.php, named
DEFAULT_QUOTA_OVERWRITEABLE. In validate.inc.php it will be allowed to
create mailboxes bigger than default quota if this variable is set to
something true.
For that i had to include the conf.php in validate.inc.php. Maybe there
is a finer solution but mine works fine for me.
I would be happy if the devs would have a look on it and tell me what i
made wrong :)
See attatched file.
Greets
Christian
--- config/conf.php.dist 2005-07-28 15:53:22.000000000 +0200
+++ config/conf.php.dist 2005-10-09 20:23:22.000000000 +0200
@@ -69,6 +69,9 @@ $DEFAULT_DOMAIN_QUOTA = 0;
# On what quota level mark accounts on accounts list (in %)
$QUOTA_WARN_LEVEL = 90;
+# Allow create mailboxes bigger than $DEFAULT_QUOTA to domain administrators
+$DEFAULT_QUOTA_OVERWRITEABLE = 1;
+
# Defines if passwords are encrypted or not.
# Valid Values:
# - plain 0 No encription is used
--- validate.inc.php 2005-08-05 22:33:40.000000000 +0200
+++ validate.inc.php 2005-10-09 20:17:20.000000000 +0200
@@ -6,6 +6,14 @@ if ($ref!=$_SERVER['SCRIPT_FILENAME']){
exit();
}
+
+$wc_configured = @file_exists(WC_BASE . '/config/conf.php');
+
+if ($wc_configured){
+ #include "DB.php";
+ include WC_BASE . "/config/conf.php";
+ }
+
################# Temporary fix for PHP 4.2.0 a better solution has to found #######################
$_get_vars = array(
'adminuser', 'newadminuser', 'newadmintype', 'newusername',
@@ -481,7 +489,7 @@ if (! empty($action)){
#When the requuested quota is higher that the default quota, we need to check if
#admin NOT superuser AND when submitting the request
- if ($_POST['quota'] > $row['quota'] && $_SESSION['admintype'] != 0) {
+ if ($_POST['quota'] > $row['quota'] && $_SESSION['admintype'] != 0 && !$DEFAULT_QUOTA_OVERWRITEABLE) {
$authorized = FALSE;
$err_msg = _("Quota exeedes the maximum allowed quota for this domain.");
}
@@ -599,7 +607,7 @@ if (! empty($action)){
}
if ($result->numRows()) {
- if (!empty($_POST['quota']) && $_POST['quota'] > $max_quota && $_SESSION['admintype']!=0) {
+ if (!empty($_POST['quota']) && $_POST['quota'] > $max_quota && $_SESSION['admintype']!=0 && !$DEFAULT_QUOTA_OVERWRITEABLE) {
$authorized = FALSE;
$err_msg=_("Quota exeedes the maximum allowed quota for this domain.");
} else {
_______________________________________________
This mailing list is hosted and supported
by bit-heads GmbH | http://www.bit-heads.ch
_______________________________________________
Web-cyradm mailing list
[email protected]
http://www.web-cyradm.org/mailman/listinfo/web-cyradm