Changeset 3456
- Timestamp:
- 11/04/10 11:05:39 (13 years ago)
- Location:
- branches/2.2
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/expressoAdmin1_2/inc/class.functions.inc.php
r3323 r3456 862 862 array("text" => lang("%1 telephone number", lang("Commercial")) , "acl" => 1), 863 863 array("text" => lang("%1 telephone number", lang("Mobile")) , "acl" => 2), 864 array("text" => lang("%1 telephone number", lang("Home")) , "acl" => 4)); 864 array("text" => lang("%1 telephone number", lang("Home")) , "acl" => 4), 865 array("text" => lang("Birthday") , "acl" => 8)); 865 866 $list_personal_data = "<tr>"; 866 867 -
branches/2.2/phpgwapi/inc/class.accounts_ldap.inc.php
r3299 r3456 63 63 { 64 64 /* jakjr: using justthese with ldap_search */ 65 $justthese = array("uidnumber", "gidnumber", "uid", "cn", "givenname", "sn", "mail", "phpgwaccountstatus", "phpgwaccountexpires", "phpgwaccounttype", "phpgwlastpasswdchange","phpgwagreeterm","telephonenumber","mobile","homephone" );65 $justthese = array("uidnumber", "gidnumber", "uid", "cn", "givenname", "sn", "mail", "phpgwaccountstatus", "phpgwaccountexpires", "phpgwaccounttype", "phpgwlastpasswdchange","phpgwagreeterm","telephonenumber","mobile","homephone","datanascimento"); 66 66 $sri = @ldap_search($this->ds, $this->user_context, ("(&(uidnumber=" . (int)$this->account_id.")(phpgwaccounttype=u))"), $justthese); 67 67 } … … 91 91 $this->data['telephonenumber'] = $allValues[0]['telephonenumber'][0]; 92 92 $this->data['mobile'] = $allValues[0]['mobile'][0]; 93 $this->data['homephone'] = $allValues[0]['homephone'][0]; 93 $this->data['homephone'] = $allValues[0]['homephone'][0]; 94 $this->data['datanascimento'] = $allValues[0]['datanascimento'][0]; 94 95 /* jakjr: this is not used for expressoLivre */ 95 96 /* -
branches/2.2/preferences/changepersonaldata.php
r3299 r3456 39 39 40 40 $GLOBALS['phpgw']->template->set_var('lang_commercial_telephonenumber',lang('%1 telephone number',lang('Commercial'))); 41 $GLOBALS['phpgw']->template->set_var('lang_birthday',lang('Birthday')); 41 42 $GLOBALS['phpgw']->template->set_var('lang_ps_commercial_telephonenumber', 42 43 lang('Observation') . ': ' . lang('This telephone number will apear in searches for your name, and it will be visible for all ExpressoLivre Users') . '.'); … … 46 47 $GLOBALS['phpgw']->template->set_var('lang_cancel',lang('Cancel')); 47 48 $GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/preferences/changepersonaldata.php')); 48 49 49 50 /* Get telephone number from ldap or from post */ 50 51 $ldap_conn = $GLOBALS['phpgw']->common->ldapConnect(); 51 $result = ldap_search($ldap_conn, $GLOBALS['phpgw_info']['server']['ldap_context'], 'uid='.$GLOBALS['phpgw_info']['user']['account_lid'], array('telephonenumber','mobile','homephone' ));52 $result = ldap_search($ldap_conn, $GLOBALS['phpgw_info']['server']['ldap_context'], 'uid='.$GLOBALS['phpgw_info']['user']['account_lid'], array('telephonenumber','mobile','homephone','datanascimento')); 52 53 $entrie = ldap_get_entries($ldap_conn, $result); 53 54 … … 56 57 $disabledMobile = false; 57 58 $disabledHomePhone = false; 59 $disableBirthday = false; 58 60 if ($GLOBALS['phpgw']->acl->check('blockpersonaldata',1)) { 59 61 $disabledTelephoneNumber = '"disabled=true"'; … … 64 66 if ($GLOBALS['phpgw']->acl->check('blockpersonaldata',4)) { 65 67 $disabledHomePhone = '"disabled=true"'; 68 } 69 if ($GLOBALS['phpgw']->acl->check('blockpersonaldata',8)) { 70 $disableBirthday = '"disabled=true"'; 66 71 } 67 72 /* END ACL Check for Personal Data Fields.*/ … … 70 75 $GLOBALS['phpgw']->template->set_var('mobile',($_POST['mobile'] ? $_POST['mobile'] : $entrie[0]['mobile'][0]).$disabledMobile); 71 76 $GLOBALS['phpgw']->template->set_var('homephone',($_POST['homephone'] ? $_POST['homephone'] : $entrie[0]['homephone'][0]).$disabledHomePhone); 72 77 $GLOBALS['phpgw']->template->set_var('datanascimento',$_POST['datanascimento'] ? $_POST['datanascimento'] : $entrie[0]['datanascimento'][0] != '' ? $entrie[0]['datanascimento'][0] : ''); 78 73 79 74 80 ldap_close($ldap_conn); … … 82 88 { 83 89 if ($_POST['telephonenumber'] != $GLOBALS['phpgw_info']['user']['telephonenumber'] || $_POST['mobile'] != $GLOBALS['phpgw_info']['user']['mobile'] 84 || $_POST['homephone'] != $GLOBALS['phpgw_info']['user']['homephone'] )90 || $_POST['homephone'] != $GLOBALS['phpgw_info']['user']['homephone'] || $_POST['datanascimento'] != $GLOBALS['phpgw_info']['user']['datanascimento']) 85 91 { 86 92 $pattern = '/\([0-9]{2,3}\)[0-9]{4}-[0-9]{4}$/'; … … 97 103 $errors[] = lang('Format of %1 telephone number is invalid.', lang("Home")); 98 104 } 105 106 if(!(checkdate(substr($_POST['datanascimento'],3,2),substr($_POST['datanascimento'],0,2),substr($_POST['datanascimento'],6,4)) == 1 107 || ($_POST['datanascimento'] == ''))) 108 { 109 $errors[] = lang('invalid date'); 110 } 99 111 if(!is_array($errors)) 100 112 { … … 160 172 unset($info['homephone']); 161 173 } 174 if (!$disableBirthday && ($_POST['datanascimento'] != $GLOBALS['phpgw_info']['user']['datanascimento'])) { 175 if (strlen($_POST['datanascimento']) == 0) { 176 $info['datanascimento'] = $GLOBALS['phpgw_info']['user']['datanascimento']; 177 $result = @ldap_mod_del($ldap_conn, $GLOBALS['phpgw_info']['user']['account_dn'], $info); 178 } 179 elseif(strlen($GLOBALS['phpgw_info']['user']['datanascimento']) == 0) { 180 $info['datanascimento'] = $_POST['datanascimento']; 181 $result = @ldap_mod_add($ldap_conn, $GLOBALS['phpgw_info']['user']['account_dn'], $info); 182 } 183 else { 184 $info['datanascimento'] = $_POST['datanascimento']; 185 $result = @ldap_mod_replace($ldap_conn, $GLOBALS['phpgw_info']['user']['account_dn'], $info); 186 } 187 unset($info['datanascimento']); 188 } 162 189 ldap_close($ldap_conn); 163 190 } -
branches/2.2/preferences/templates/default/changepersonaldata.tpl
r3299 r3456 35 35 </td> 36 36 </tr> 37 <tr> 38 <td>{lang_birthday}:</td> 39 <td> 40 <input style="text-align: center;" title="Data de Nascimento" name="datanascimento" maxlength="10" size="12" type="text" value="{datanascimento}" onkeyup="formatDate(this)";> 41 </td> 42 43 <td> 44 </tr> 37 45 <tr><td colspan=2 height="20px"></td></tr> 38 46
Note: See TracChangeset
for help on using the changeset viewer.