summaryrefslogtreecommitdiff
path: root/www/admin/user/user.php.in
diff options
context:
space:
mode:
Diffstat (limited to 'www/admin/user/user.php.in')
-rw-r--r--www/admin/user/user.php.in27
1 files changed, 24 insertions, 3 deletions
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' );