Index: /branches/2.2/phpgwapi/inc/class.accounts_ldap.inc.php
===================================================================
--- /branches/2.2/phpgwapi/inc/class.accounts_ldap.inc.php	(revision 3299)
+++ /branches/2.2/phpgwapi/inc/class.accounts_ldap.inc.php	(revision 3456)
@@ -63,5 +63,5 @@
 			{
 				/* jakjr: using justthese with ldap_search */
-				$justthese = array("uidnumber", "gidnumber", "uid", "cn", "givenname", "sn", "mail", "phpgwaccountstatus", "phpgwaccountexpires", "phpgwaccounttype", "phpgwlastpasswdchange","phpgwagreeterm","telephonenumber","mobile","homephone");
+				$justthese = array("uidnumber", "gidnumber", "uid", "cn", "givenname", "sn", "mail", "phpgwaccountstatus", "phpgwaccountexpires", "phpgwaccounttype", "phpgwlastpasswdchange","phpgwagreeterm","telephonenumber","mobile","homephone","datanascimento");
 				$sri = @ldap_search($this->ds, $this->user_context, ("(&(uidnumber=" . (int)$this->account_id.")(phpgwaccounttype=u))"), $justthese);
 			}
@@ -91,5 +91,6 @@
 				$this->data['telephonenumber']   = $allValues[0]['telephonenumber'][0];
 				$this->data['mobile']   = $allValues[0]['mobile'][0];
-				$this->data['homephone']   = $allValues[0]['homephone'][0];				
+				$this->data['homephone']   = $allValues[0]['homephone'][0];
+				$this->data['datanascimento']   = $allValues[0]['datanascimento'][0];			
 				/* jakjr: this is not used for expressoLivre */
 				/*
Index: /branches/2.2/expressoAdmin1_2/inc/class.functions.inc.php
===================================================================
--- /branches/2.2/expressoAdmin1_2/inc/class.functions.inc.php	(revision 3323)
+++ /branches/2.2/expressoAdmin1_2/inc/class.functions.inc.php	(revision 3456)
@@ -862,5 +862,6 @@
 					array("text" => lang("%1 telephone number", lang("Commercial"))	, "acl" => 1),
 					array("text" => lang("%1 telephone number", lang("Mobile"))		, "acl" => 2),
-					array("text" => lang("%1 telephone number", lang("Home"))		, "acl" => 4));
+					array("text" => lang("%1 telephone number", lang("Home"))		, "acl" => 4),
+					array("text" => lang("Birthday")								, "acl" => 8));
 			$list_personal_data = "<tr>";
 						
Index: /branches/2.2/preferences/changepersonaldata.php
===================================================================
--- /branches/2.2/preferences/changepersonaldata.php	(revision 3299)
+++ /branches/2.2/preferences/changepersonaldata.php	(revision 3456)
@@ -39,4 +39,5 @@
 
 	$GLOBALS['phpgw']->template->set_var('lang_commercial_telephonenumber',lang('%1 telephone number',lang('Commercial')));
+	$GLOBALS['phpgw']->template->set_var('lang_birthday',lang('Birthday'));
 	$GLOBALS['phpgw']->template->set_var('lang_ps_commercial_telephonenumber',
 	lang('Observation') . ': ' . lang('This telephone number will apear in searches for your name, and it will be visible for all ExpressoLivre Users') . '.');
@@ -46,8 +47,8 @@
 	$GLOBALS['phpgw']->template->set_var('lang_cancel',lang('Cancel'));
 	$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/preferences/changepersonaldata.php'));
-
+	
 	/* 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','homephone'));
+	$result = ldap_search($ldap_conn, $GLOBALS['phpgw_info']['server']['ldap_context'], 'uid='.$GLOBALS['phpgw_info']['user']['account_lid'], array('telephonenumber','mobile','homephone','datanascimento'));
 	$entrie = ldap_get_entries($ldap_conn, $result);
 
@@ -56,4 +57,5 @@
 	$disabledMobile = false;
 	$disabledHomePhone = false;
+	$disableBirthday = false;
 	if ($GLOBALS['phpgw']->acl->check('blockpersonaldata',1)) {
 		$disabledTelephoneNumber = '"disabled=true"';
@@ -64,4 +66,7 @@
 	if ($GLOBALS['phpgw']->acl->check('blockpersonaldata',4)) {
 		$disabledHomePhone = '"disabled=true"';
+	}
+	if ($GLOBALS['phpgw']->acl->check('blockpersonaldata',8)) {
+		$disableBirthday = '"disabled=true"';
 	}
 	/* END ACL Check for Personal Data Fields.*/
@@ -70,5 +75,6 @@
 	$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);
-	
+	$GLOBALS['phpgw']->template->set_var('datanascimento',$_POST['datanascimento'] ? $_POST['datanascimento'] : $entrie[0]['datanascimento'][0] != '' ? $entrie[0]['datanascimento'][0] : '');
+
 
 	ldap_close($ldap_conn);
@@ -82,5 +88,5 @@
 	{
 		if ($_POST['telephonenumber'] != $GLOBALS['phpgw_info']['user']['telephonenumber'] || $_POST['mobile'] != $GLOBALS['phpgw_info']['user']['mobile']
-		 || $_POST['homephone'] != $GLOBALS['phpgw_info']['user']['homephone'])
+		 || $_POST['homephone'] != $GLOBALS['phpgw_info']['user']['homephone'] || $_POST['datanascimento'] != $GLOBALS['phpgw_info']['user']['datanascimento'])
 		{
 			$pattern = '/\([0-9]{2,3}\)[0-9]{4}-[0-9]{4}$/';
@@ -97,4 +103,10 @@
 				$errors[] = lang('Format of %1 telephone number is invalid.', lang("Home"));
 			}
+
+			if(!(checkdate(substr($_POST['datanascimento'],3,2),substr($_POST['datanascimento'],0,2),substr($_POST['datanascimento'],6,4)) == 1 
+				|| ($_POST['datanascimento'] == '')))
+			{
+				$errors[] = lang('invalid date');
+			}				
 			if(!is_array($errors))
 			{
@@ -160,4 +172,19 @@
 					unset($info['homephone']);
 				}
+				if (!$disableBirthday && ($_POST['datanascimento'] != $GLOBALS['phpgw_info']['user']['datanascimento'])) {
+					if (strlen($_POST['datanascimento']) == 0) {
+						$info['datanascimento'] = $GLOBALS['phpgw_info']['user']['datanascimento'];
+						$result = @ldap_mod_del($ldap_conn, $GLOBALS['phpgw_info']['user']['account_dn'], $info);
+					}
+					elseif(strlen($GLOBALS['phpgw_info']['user']['datanascimento']) == 0) {
+						$info['datanascimento'] = $_POST['datanascimento'];
+						$result = @ldap_mod_add($ldap_conn, $GLOBALS['phpgw_info']['user']['account_dn'], $info);
+					}
+					else {
+						$info['datanascimento'] = $_POST['datanascimento'];
+						$result = @ldap_mod_replace($ldap_conn, $GLOBALS['phpgw_info']['user']['account_dn'], $info);
+					}
+					unset($info['datanascimento']);
+				}
 				ldap_close($ldap_conn);	
 			}
Index: /branches/2.2/preferences/templates/default/changepersonaldata.tpl
===================================================================
--- /branches/2.2/preferences/templates/default/changepersonaldata.tpl	(revision 3299)
+++ /branches/2.2/preferences/templates/default/changepersonaldata.tpl	(revision 3456)
@@ -35,4 +35,12 @@
        </td>
      </tr>
+	 <tr>
+       <td>{lang_birthday}:</td>
+			<td>
+				<input style="text-align: center;" title="Data de Nascimento" name="datanascimento" maxlength="10" size="12" type="text" value="{datanascimento}" onkeyup="formatDate(this)";>				
+			</td>
+       
+       <td>       
+     </tr>
 	<tr><td colspan=2 height="20px"></td></tr>
      
