ensure integer value sent to avoid badfilter

This commit is contained in:
Miles Lott 2004-01-26 03:24:40 +00:00
parent 4f724bc9b1
commit 0d23f90fd4

View File

@ -60,7 +60,7 @@
return False; return False;
} }
/* find the dn for this uid, the uid is not always in the dn */ /* find the dn for this uid, the uid is not always in the dn */
$attributes = array( "uid", "dn" ); $attributes = array('uid', 'dn');
if ($GLOBALS['phpgw_info']['server']['account_repository'] == 'ldap') if ($GLOBALS['phpgw_info']['server']['account_repository'] == 'ldap')
{ {
$filter = "(&(uid=$username)(phpgwaccountstatus=A))"; $filter = "(&(uid=$username)(phpgwaccountstatus=A))";
@ -118,7 +118,7 @@
} }
$ds = $GLOBALS['phpgw']->common->ldapConnect(); $ds = $GLOBALS['phpgw']->common->ldapConnect();
$sri = ldap_search($ds, $GLOBALS['phpgw_info']['server']['ldap_context'], "uidnumber=$_account_id"); $sri = ldap_search($ds, $GLOBALS['phpgw_info']['server']['ldap_context'], 'uidnumber=' . (int)$_account_id);
$allValues = ldap_get_entries($ds, $sri); $allValues = ldap_get_entries($ds, $sri);
$entry['userpassword'] = $this->encrypt_password($new_passwd); $entry['userpassword'] = $this->encrypt_password($new_passwd);
@ -153,7 +153,7 @@
$entry['phpgwaccountlastloginfrom'] = $ip; $entry['phpgwaccountlastloginfrom'] = $ip;
$ds = $GLOBALS['phpgw']->common->ldapConnect(); $ds = $GLOBALS['phpgw']->common->ldapConnect();
$sri = ldap_search($ds, $GLOBALS['phpgw_info']['server']['ldap_context'], 'uidnumber=' . $_account_id); $sri = ldap_search($ds, $GLOBALS['phpgw_info']['server']['ldap_context'], 'uidnumber=' . (int)$_account_id);
$allValues = ldap_get_entries($ds, $sri); $allValues = ldap_get_entries($ds, $sri);
$dn = $allValues[0]['dn']; $dn = $allValues[0]['dn'];