Changeset 3299
- Timestamp:
- 09/28/10 14:25:33 (14 years ago)
- Location:
- branches/2.2
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/expressoAdmin1_2/inc/class.functions.inc.php
r3251 r3299 855 855 // Com restrição apenas na edição do Tel. Celular => $acl=2; 856 856 // Com restrição na edição do Tel. Comercial e Celular => $acl=3; 857 // Com restricao apenas na edicao do Tel. Residencial => $acl=4; 858 // .... 859 // Com restricao de edição em todos os campos pessoais => $acl=7; 857 860 858 861 $personal_data_fields = array( 859 862 array("text" => lang("%1 telephone number", lang("Commercial")) , "acl" => 1), 860 array("text" => lang("%1 telephone number", lang("Mobile")) , "acl" => 2)); 863 array("text" => lang("%1 telephone number", lang("Mobile")) , "acl" => 2), 864 array("text" => lang("%1 telephone number", lang("Home")) , "acl" => 4)); 861 865 $list_personal_data = "<tr>"; 862 866 -
branches/2.2/phpgwapi/inc/class.accounts_ldap.inc.php
r3234 r3299 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" );65 $justthese = array("uidnumber", "gidnumber", "uid", "cn", "givenname", "sn", "mail", "phpgwaccountstatus", "phpgwaccountexpires", "phpgwaccounttype", "phpgwlastpasswdchange","phpgwagreeterm","telephonenumber","mobile","homephone"); 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 94 /* jakjr: this is not used for expressoLivre */ 94 95 /* -
branches/2.2/preferences/changepersonaldata.php
r3234 r3299 42 42 lang('Observation') . ': ' . lang('This telephone number will apear in searches for your name, and it will be visible for all ExpressoLivre Users') . '.'); 43 43 $GLOBALS['phpgw']->template->set_var('lang_mobile_telephonenumber',lang('%1 telephone number',lang('Mobile'))); 44 $GLOBALS['phpgw']->template->set_var('lang_homephone_telephonenumber',lang('%1 telephone number',lang('Home'))); 44 45 $GLOBALS['phpgw']->template->set_var('lang_change',lang('Change')); 45 46 $GLOBALS['phpgw']->template->set_var('lang_cancel',lang('Cancel')); … … 48 49 /* Get telephone number from ldap or from post */ 49 50 $ldap_conn = $GLOBALS['phpgw']->common->ldapConnect(); 50 $result = ldap_search($ldap_conn, $GLOBALS['phpgw_info']['server']['ldap_context'], 'uid='.$GLOBALS['phpgw_info']['user']['account_lid'], array('telephonenumber','mobile' ));51 $result = ldap_search($ldap_conn, $GLOBALS['phpgw_info']['server']['ldap_context'], 'uid='.$GLOBALS['phpgw_info']['user']['account_lid'], array('telephonenumber','mobile','homephone')); 51 52 $entrie = ldap_get_entries($ldap_conn, $result); 52 53 … … 54 55 $disabledTelephoneNumber = false; 55 56 $disabledMobile = false; 56 57 $disabledHomePhone = false; 57 58 if ($GLOBALS['phpgw']->acl->check('blockpersonaldata',1)) { 58 59 $disabledTelephoneNumber = '"disabled=true"'; … … 61 62 $disabledMobile = '"disabled=true"'; 62 63 } 64 if ($GLOBALS['phpgw']->acl->check('blockpersonaldata',4)) { 65 $disabledHomePhone = '"disabled=true"'; 66 } 63 67 /* END ACL Check for Personal Data Fields.*/ 64 68 65 69 $GLOBALS['phpgw']->template->set_var('telephonenumber',($_POST['telephonenumber'] ? $_POST['telephonenumber'] : $entrie[0]['telephonenumber'][0]).$disabledTelephoneNumber); 66 70 $GLOBALS['phpgw']->template->set_var('mobile',($_POST['mobile'] ? $_POST['mobile'] : $entrie[0]['mobile'][0]).$disabledMobile); 71 $GLOBALS['phpgw']->template->set_var('homephone',($_POST['homephone'] ? $_POST['homephone'] : $entrie[0]['homephone'][0]).$disabledHomePhone); 72 67 73 68 74 ldap_close($ldap_conn); … … 75 81 if ($_POST['change']) 76 82 { 77 if ($_POST['telephonenumber'] != $GLOBALS['phpgw_info']['user']['telephonenumber'] || $_POST['mobile'] != $GLOBALS['phpgw_info']['user']['mobile']) 83 if ($_POST['telephonenumber'] != $GLOBALS['phpgw_info']['user']['telephonenumber'] || $_POST['mobile'] != $GLOBALS['phpgw_info']['user']['mobile'] 84 || $_POST['homephone'] != $GLOBALS['phpgw_info']['user']['homephone']) 78 85 { 79 86 $pattern = '/\([0-9]{2,3}\)[0-9]{4}-[0-9]{4}$/'; … … 85 92 { 86 93 $errors[] = lang('Format of %1 telephone number is invalid.', lang("Mobile")); 94 } 95 if ((strlen($_POST['homephone']) != 0) && (!preg_match($pattern, $_POST['homephone']))) 96 { 97 $errors[] = lang('Format of %1 telephone number is invalid.', lang("Home")); 87 98 } 88 99 if(!is_array($errors)) … … 132 143 $result = @ldap_mod_replace($ldap_conn, $GLOBALS['phpgw_info']['user']['account_dn'], $info); 133 144 } 145 unset($info['mobile']); 146 } 147 if (!$disabledHomePhone && ($_POST['homephone'] != $GLOBALS['phpgw_info']['user']['homephone'])) { 148 if (strlen($_POST['homephone']) == 0) { 149 $info['homephone'] = $GLOBALS['phpgw_info']['user']['homephone']; 150 $result = @ldap_mod_del($ldap_conn, $GLOBALS['phpgw_info']['user']['account_dn'], $info); 151 } 152 elseif(strlen($GLOBALS['phpgw_info']['user']['homephone']) == 0) { 153 $info['homephone'] = $_POST['homephone']; 154 $result = @ldap_mod_add($ldap_conn, $GLOBALS['phpgw_info']['user']['account_dn'], $info); 155 } 156 else { 157 $info['homephone'] = $_POST['homephone']; 158 $result = @ldap_mod_replace($ldap_conn, $GLOBALS['phpgw_info']['user']['account_dn'], $info); 159 } 160 unset($info['homephone']); 134 161 } 135 162 ldap_close($ldap_conn); -
branches/2.2/preferences/templates/default/changepersonaldata.tpl
r3234 r3299 28 28 </tr> 29 29 <tr> 30 <td> 31 {lang_homephone_telephonenumber}: 32 </td> 33 <td> 34 <input type="input" autocomplete="off" name="homephone" size=12 value="{homephone}" maxlength="13" onkeyUp="FormatTelephoneNumber(event, this);"> (xx)xxxx-xxxx 35 </td> 36 </tr> 37 <tr><td colspan=2 height="20px"></td></tr> 38 39 <tr> 30 40 <td colspan="3"> 31 41 <table cellspacing="0"><tr><br>
Note: See TracChangeset
for help on using the changeset viewer.