summaryrefslogtreecommitdiff
path: root/www/admin/sharedfolder/sf.php.in
diff options
context:
space:
mode:
Diffstat (limited to 'www/admin/sharedfolder/sf.php.in')
-rw-r--r--www/admin/sharedfolder/sf.php.in15
1 files changed, 14 insertions, 1 deletions
diff --git a/www/admin/sharedfolder/sf.php.in b/www/admin/sharedfolder/sf.php.in
index 0cf38a7..b36fccc 100644
--- a/www/admin/sharedfolder/sf.php.in
+++ b/www/admin/sharedfolder/sf.php.in
@@ -25,6 +25,18 @@ if( $group != 'maintainer' && $group != 'admin' && $group != 'domain-maintainer'
array_push($errors, _("Error: You don't have Permissions to access this Menu"));
}
+// Due to a cyrus imapd bug we can't currently
+// support quotas over 4095 MB, see issue1262
+function checkquota( $form, $key, $value )
+{
+ if( empty($value) ) return ''; // OK
+ else if( $value >= 4096 ) return _('Quota must be smaller than 4096');
+ else if( $value < 0 ) return _('Quota can not be negative');
+ else if( !is_numeric($value) ) return _('Quota must be a number');
+ else if( (int) $value != $value ) return _('Quota must be an integer');
+ else return '';
+}
+
require_once('@kolab_php_module_prefix@admin/include/menu.php');
function fill_form_for_modify( &$form, &$ldap_object ) {
@@ -130,7 +142,8 @@ $entries = array( 'cn' => array( 'name' => _('Folder Name'),
'value' => '' ),
'cyrus-userquota' => array( 'name' => _('Quota Limit'),
- 'comment' => _('MBytes (empty for unlimited)') ),
+ 'comment' => _('MBytes (empty for unlimited)'),
+ 'validation' => 'checkquota' ),
'acl_0' => array( 'name' => _('Permission for UID/GID'),
'type' => 'aclselect',
'user' => 'anyone',