r109593 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109592‎ | r109593 | r109594 >
Date:00:41, 20 January 2012
Author:laner
Status:ok
Tags:openstack 
Comment:
Change search for inGlobalRole to work for virtual static groups
Modified paths:
  • /trunk/extensions/OpenStackManager/OpenStackNovaUser.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenStackManager/OpenStackNovaUser.php
@@ -237,11 +237,11 @@
238238 if ( $wgOpenStackManagerLDAPGlobalRoles["$role"] ) {
239239 # Check global role
240240 $roledn = $wgOpenStackManagerLDAPGlobalRoles["$role"];
241 - $filter = "(member=$this->userDN)";
242 - $result = LdapAuthenticationPlugin::ldap_search( $wgAuth->ldapconn, $roledn, $filter );
 241+ $filter = "(objectclass=*)";
 242+ $result = LdapAuthenticationPlugin::ldap_read( $wgAuth->ldapconn, $roledn, $filter );
243243 if ( $result ) {
244244 $entries = LdapAuthenticationPlugin::ldap_get_entries( $wgAuth->ldapconn, $result );
245 - return ( (int)$entries['count'] > 0 );
 245+ return ( in_array( $this->userDN, $entries[0]['member'] ) );
246246 }
247247 }
248248 return false;

Status & tagging log