mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-05-31 03:34:18 +00:00
Those damn numeric usernames will get you every time.
This commit is contained in:
parent
a555fdad40
commit
c846104d94
@ -570,16 +570,19 @@ function sync_LDAP(){
|
|||||||
// deactivating all users
|
// deactivating all users
|
||||||
$params = array();
|
$params = array();
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
$paramstring = '';
|
||||||
foreach( $users_to_deactivate AS $v ) {
|
foreach( $users_to_deactivate AS $v ) {
|
||||||
if ( isset($c->do_not_sync_from_ldap) && isset($c->do_not_sync_from_ldap[$v]) ) continue;
|
if ( isset($c->do_not_sync_from_ldap) && isset($c->do_not_sync_from_ldap[$v]) ) continue;
|
||||||
|
if ( $i > 0 ) $paramstring .= ',';
|
||||||
|
$paramstring .= ':u'.$i.'::text';
|
||||||
$params[':u'.$i++] = strtolower($v);
|
$params[':u'.$i++] = strtolower($v);
|
||||||
}
|
}
|
||||||
if ( count($params) > 0 ) {
|
if ( count($params) > 0 ) {
|
||||||
$c->messages[] = sprintf(i18n('- deactivating users : %s'),join(', ',$users_to_deactivate));
|
$c->messages[] = sprintf(i18n('- deactivating users : %s'),join(', ',$users_to_deactivate));
|
||||||
$qry = new AwlQuery( 'UPDATE usr SET active = FALSE WHERE lower(username) IN ('.implode(',',array_keys($params)).')', $params);
|
$qry = new AwlQuery( 'UPDATE usr SET active = FALSE WHERE lower(username) IN ('.$paramstring.')', $params);
|
||||||
$qry->Exec('sync_LDAP',__LINE__,__FILE__);
|
$qry->Exec('sync_LDAP',__LINE__,__FILE__);
|
||||||
|
|
||||||
Principal::cacheFlush('lower(username) IN ('.implode(',',array_keys($params)).')', $params);
|
Principal::cacheFlush('lower(username) IN ('.$paramstring.')', $params);
|
||||||
}
|
}
|
||||||
|
|
||||||
// updating all users
|
// updating all users
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user