Index: branches/2.2/preferences/changepersonaldata.php
===================================================================
--- branches/2.2/preferences/changepersonaldata.php	(revision 3234)
+++ branches/2.2/preferences/changepersonaldata.php	(revision 3299)
@@ -42,4 +42,5 @@
 	lang('Observation') . ': ' . lang('This telephone number will apear in searches for your name, and it will be visible for all ExpressoLivre Users') . '.');
 	$GLOBALS['phpgw']->template->set_var('lang_mobile_telephonenumber',lang('%1 telephone number',lang('Mobile')));
+	$GLOBALS['phpgw']->template->set_var('lang_homephone_telephonenumber',lang('%1 telephone number',lang('Home')));
 	$GLOBALS['phpgw']->template->set_var('lang_change',lang('Change'));
 	$GLOBALS['phpgw']->template->set_var('lang_cancel',lang('Cancel'));
@@ -48,5 +49,5 @@
 	/* Get telephone number from ldap or from post */
 	$ldap_conn = $GLOBALS['phpgw']->common->ldapConnect();
-	$result = ldap_search($ldap_conn, $GLOBALS['phpgw_info']['server']['ldap_context'], 'uid='.$GLOBALS['phpgw_info']['user']['account_lid'], array('telephonenumber','mobile'));
+	$result = ldap_search($ldap_conn, $GLOBALS['phpgw_info']['server']['ldap_context'], 'uid='.$GLOBALS['phpgw_info']['user']['account_lid'], array('telephonenumber','mobile','homephone'));
 	$entrie = ldap_get_entries($ldap_conn, $result);
 
@@ -54,5 +55,5 @@
 	$disabledTelephoneNumber = false;
 	$disabledMobile = false;
-	 
+	$disabledHomePhone = false;
 	if ($GLOBALS['phpgw']->acl->check('blockpersonaldata',1)) {
 		$disabledTelephoneNumber = '"disabled=true"';
@@ -61,8 +62,13 @@
 		$disabledMobile = '"disabled=true"';
 	}
+	if ($GLOBALS['phpgw']->acl->check('blockpersonaldata',4)) {
+		$disabledHomePhone = '"disabled=true"';
+	}
 	/* END ACL Check for Personal Data Fields.*/
 	
 	$GLOBALS['phpgw']->template->set_var('telephonenumber',($_POST['telephonenumber'] ? $_POST['telephonenumber'] : $entrie[0]['telephonenumber'][0]).$disabledTelephoneNumber);
 	$GLOBALS['phpgw']->template->set_var('mobile',($_POST['mobile'] ? $_POST['mobile'] : $entrie[0]['mobile'][0]).$disabledMobile);
+	$GLOBALS['phpgw']->template->set_var('homephone',($_POST['homephone'] ? $_POST['homephone'] : $entrie[0]['homephone'][0]).$disabledHomePhone);
+	
 
 	ldap_close($ldap_conn);
@@ -75,5 +81,6 @@
 	if ($_POST['change'])
 	{
-		if ($_POST['telephonenumber'] != $GLOBALS['phpgw_info']['user']['telephonenumber'] || $_POST['mobile'] != $GLOBALS['phpgw_info']['user']['mobile'])
+		if ($_POST['telephonenumber'] != $GLOBALS['phpgw_info']['user']['telephonenumber'] || $_POST['mobile'] != $GLOBALS['phpgw_info']['user']['mobile']
+		 || $_POST['homephone'] != $GLOBALS['phpgw_info']['user']['homephone'])
 		{
 			$pattern = '/\([0-9]{2,3}\)[0-9]{4}-[0-9]{4}$/';
@@ -85,4 +92,8 @@
 			{
 				$errors[] = lang('Format of %1 telephone number is invalid.', lang("Mobile"));
+			}
+			if ((strlen($_POST['homephone']) != 0) && (!preg_match($pattern, $_POST['homephone'])))
+			{
+				$errors[] = lang('Format of %1 telephone number is invalid.', lang("Home"));
 			}
 			if(!is_array($errors))
@@ -132,4 +143,20 @@
 						$result = @ldap_mod_replace($ldap_conn, $GLOBALS['phpgw_info']['user']['account_dn'], $info);
 					}
+					unset($info['mobile']);
+				}
+				if (!$disabledHomePhone && ($_POST['homephone'] != $GLOBALS['phpgw_info']['user']['homephone'])) {
+					if (strlen($_POST['homephone']) == 0) {
+						$info['homephone'] = $GLOBALS['phpgw_info']['user']['homephone'];
+						$result = @ldap_mod_del($ldap_conn, $GLOBALS['phpgw_info']['user']['account_dn'], $info);
+					}
+					elseif(strlen($GLOBALS['phpgw_info']['user']['homephone']) == 0) {
+						$info['homephone'] = $_POST['homephone'];
+						$result = @ldap_mod_add($ldap_conn, $GLOBALS['phpgw_info']['user']['account_dn'], $info);
+					}
+					else {
+						$info['homephone'] = $_POST['homephone'];
+						$result = @ldap_mod_replace($ldap_conn, $GLOBALS['phpgw_info']['user']['account_dn'], $info);
+					}
+					unset($info['homephone']);
 				}
 				ldap_close($ldap_conn);	
