summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGunnar Wrobel <wrobel@pardus.de>2007-07-12 05:17:31 (GMT)
committerGunnar Wrobel <wrobel@pardus.de>2007-07-12 05:17:31 (GMT)
commitcae2580e3fa19b14b49d552a3fbe4f0008c8cb4b (patch)
treef4719b5b9fa4b06833b990cc53b451655d967e73
parent3f6b1b803a8433eb9d9c1299d1497e642b2134e3 (diff)
downloadkolab-webadmin-cae2580e3fa19b14b49d552a3fbe4f0008c8cb4b.tar.gz
* www/admin/domainmaintainer/domainmaintainer.php.in:
* www/admin/sharedfolder/sf.php.in: * www/admin/addressbook/addr.php.in: * www/admin/user/user.php.in: fixed kolab/issue932 (Illegal values in webadmin cause LDAP errors) https://intevation.de/roundup/kolab/issue932
-rw-r--r--ChangeLog10
-rw-r--r--www/admin/addressbook/addr.php.in13
-rw-r--r--www/admin/domainmaintainer/domainmaintainer.php.in1
-rw-r--r--www/admin/sharedfolder/sf.php.in15
-rw-r--r--www/admin/user/user.php.in27
5 files changed, 60 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index ed848b1..c00c17b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2007-07-12 Gunnar Wrobel <p@rdus.de>
+
+ * www/admin/domainmaintainer/domainmaintainer.php.in:
+ * www/admin/sharedfolder/sf.php.in:
+ * www/admin/addressbook/addr.php.in:
+ * www/admin/user/user.php.in:
+
+ fixed kolab/issue932 (Illegal values in webadmin cause LDAP errors)
+ https://intevation.de/roundup/kolab/issue932
+
2007-07-11 Gunnar Wrobel <p@rdus.de>
* www/admin/sharedfolder/sf.php.in:
diff --git a/www/admin/addressbook/addr.php.in b/www/admin/addressbook/addr.php.in
index 5cd56cd..934f9ad 100644
--- a/www/admin/addressbook/addr.php.in
+++ b/www/admin/addressbook/addr.php.in
@@ -91,6 +91,13 @@ function checkuniquealias( $form, $key, $value ) {
return $str;
}
+function checkphone( $form, $key, $value )
+{
+ if( empty($value) ) return ''; // OK
+ else if( !preg_match('/^[a-zA-Z0-9()-+\/.=?:]*$/',$value) ) return _('Phone entries may only contain a-z, numbers and the characters ()-+/.=?:');
+ else return '';
+}
+
/**** Submenu for current page ***/
$menuitems[$sidx]['selected'] = 'selected';
$heading = '';
@@ -129,8 +136,10 @@ $entries = array( 'firstname' => array( 'name' => _('First Name'),
'postalCode' => array( 'name' => _('Postal Code') ),
'l' => array( 'name' => _('City') ),
'c' => array( 'name' => _('Country') ),
- 'telephoneNumber' => array( 'name' => _('Telephone Number') ),
- 'facsimileTelephoneNumber' => array( 'name' => _('Fax Number') ));
+ 'telephoneNumber' => array( 'name' => _('Telephone Number'),
+ 'validation' => 'checkphone' ),
+ 'facsimileTelephoneNumber' => array( 'name' => _('Fax Number'),
+ 'validation' => 'checkphone' ));
$entries['action'] = array( 'name' => 'action',
'type' => 'hidden' );
diff --git a/www/admin/domainmaintainer/domainmaintainer.php.in b/www/admin/domainmaintainer/domainmaintainer.php.in
index 501bd23..c84fdff 100644
--- a/www/admin/domainmaintainer/domainmaintainer.php.in
+++ b/www/admin/domainmaintainer/domainmaintainer.php.in
@@ -46,6 +46,7 @@ function domain_dn()
// Check that a uid is unique
function checkuniquemail( $form, $key, $value ) {
debug("checkuniquemail( $form, $key, $value )");
+ if( $value == '' ) return _('Please enter an uid value');
if( is_unique( 'uid', $value ) ) {
return '';
} else {
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',
diff --git a/www/admin/user/user.php.in b/www/admin/user/user.php.in
index 009fede..ef125ea 100644
--- a/www/admin/user/user.php.in
+++ b/www/admin/user/user.php.in
@@ -228,6 +228,24 @@ 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 '';
+}
+
+function checkfreebusyfuture( $form, $key, $value )
+{
+ if( empty($value) ) return ''; // OK
+ else if( $value < 0 ) return _('Free/Busy future can not be negative');
+ else if( !is_numeric($value) ) return _('Free/Busy future must be a number');
+ else if( (int) $value != $value ) return _('Free/Busy future must be an integer');
+ else return '';
+}
+
+function checkphone( $form, $key, $value )
+{
+ if( empty($value) ) return ''; // OK
+ else if( !preg_match('/^[a-zA-Z0-9()-+\/.=?:]*$/',$value) ) return _('Phone entries may only contain a-z, numbers and the characters ()-+/.=?:');
else return '';
}
@@ -512,8 +530,10 @@ $entries['postOfficeBox_0'] = array( 'name' => _('Postbox') );
$entries['postalCode_0'] = array( 'name' => _('Postal Code') );
$entries['l_0'] = array( 'name' => _('City') );
$entries['c_0'] = array( 'name' => _('Country') );
-$entries['telephoneNumber_0'] = array( 'name' => _('Telephone Number') );
-$entries['facsimileTelephoneNumber_0'] = array( 'name' => _('Fax Number') );
+$entries['telephoneNumber_0'] = array( 'name' => _('Telephone Number'),
+ 'validation' => 'checkphone' );
+$entries['facsimileTelephoneNumber_0'] = array( 'name' => _('Fax Number'),
+ 'validation' => 'checkphone' );
if( $auth->group() == 'admin' || $auth->group() == 'maintainer' || $auth->group() == 'domain-maintainer' ) {
$entries['cyrus-userquota'] = array( 'name' => _('User Quota in MBytes'),
'comment' => _('Leave blank for unlimited'),
@@ -529,7 +549,8 @@ if( $auth->group() == 'admin' || $auth->group() == 'maintainer' || $auth->group(
$entries['uid']['attrs'] = 'readonly';
}
$entries['kolabFreeBusyFuture_0'] = array( 'name' => _('Free/Busy interval in days'),
- 'comment' => _('Leave blank for default (60 days)') );
+ 'comment' => _('Leave blank for default (60 days)'),
+ 'validation' => 'checkfreebusyfuture' );
$entries['action'] = array( 'name' => 'action',
'type' => 'hidden' );