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