Index: trunk/extensions/OpenStackManager/OpenStackNovaUser.php |
— | — | @@ -495,8 +495,13 @@ |
496 | 496 | */ |
497 | 497 | static function LDAPSetNovaInfo( $auth ) { |
498 | 498 | OpenStackNovaUser::connect(); |
499 | | - if ( !isset( $auth->userInfo[0]['accesskey'] ) or !isset( $auth->userInfo[0]['secretkey'] ) ) { |
500 | | - $objectclasses = $auth->userInfo[0]['objectclass']; |
| 499 | + $dn = $auth->userInfo[0]['dn']; |
| 500 | + wfSuppressWarnings(); |
| 501 | + $result = ldap_read( $auth->ldapconn, $auth->userInfo[0]['dn'], '(objectclass=*)', array( 'secretkey', 'accesskey', 'objectclass' ) ); |
| 502 | + $userInfo = ldap_get_entries( $auth->ldapconn, $result ); |
| 503 | + wfRestoreWarnings(); |
| 504 | + if ( !isset( $userInfo[0]['accesskey'] ) or !isset( $userInfo[0]['secretkey'] ) ) { |
| 505 | + $objectclasses = $userInfo[0]['objectclass']; |
501 | 506 | # First entry is a count |
502 | 507 | array_shift( $objectclasses ); |
503 | 508 | if ( !in_array( 'novauser', $objectclasses ) ) { |
— | — | @@ -523,6 +528,9 @@ |
524 | 529 | # Always return true, other hooks should still run, even if this fails |
525 | 530 | return true; |
526 | 531 | } |
| 532 | + } else { |
| 533 | + $auth->printDebug( "User has accesskey and secretkey set.", NONSENSITIVE ); |
| 534 | + return true; |
527 | 535 | } |
528 | 536 | } |
529 | 537 | |