Index: trunk/extensions/LdapAuthentication/LdapAuthentication.php |
— | — | @@ -326,8 +326,10 @@ |
327 | 327 | * @param string $preference |
328 | 328 | * @return mixed |
329 | 329 | */ |
330 | | - public function getConf( $preference ) { |
331 | | - $domain = $this->getSessionDomain(); |
| 330 | + public function getConf( $preference, $domain='' ) { |
| 331 | + if ( !$domain ) { |
| 332 | + $domain = $this->getSessionDomain(); |
| 333 | + } |
332 | 334 | switch ( $preference ) { |
333 | 335 | case 'ServerNames': |
334 | 336 | global $wgLDAPServerNames; |
— | — | @@ -532,11 +534,6 @@ |
533 | 535 | * @return bool |
534 | 536 | */ |
535 | 537 | public function connect( $domain='' ) { |
536 | | - // FIXME: $domain isn't used |
537 | | - if ( $domain == '' ) { |
538 | | - $domain = $this->getSessionDomain(); |
539 | | - } |
540 | | - |
541 | 538 | $this->printDebug( "Entering Connect", NONSENSITIVE ); |
542 | 539 | |
543 | 540 | if ( !function_exists( 'ldap_connect' ) ) { |
— | — | @@ -547,7 +544,7 @@ |
548 | 545 | } |
549 | 546 | |
550 | 547 | // Set the server string depending on whether we use ssl or not |
551 | | - $encryptionType = $this->getConf( 'EncryptionType' ); |
| 548 | + $encryptionType = $this->getConf( 'EncryptionType', $domain ); |
552 | 549 | switch( $encryptionType ) { |
553 | 550 | case "ldapi": |
554 | 551 | $this->printDebug( "Using ldapi", SENSITIVE ); |
— | — | @@ -565,10 +562,10 @@ |
566 | 563 | // Make a space separated list of server strings with the connection type |
567 | 564 | // string added. |
568 | 565 | $servers = ""; |
569 | | - $tmpservers = $this->getConf( 'ServerNames' ); |
| 566 | + $tmpservers = $this->getConf( 'ServerNames', $domain ); |
570 | 567 | $tok = strtok( $tmpservers, " " ); |
571 | 568 | while ( $tok ) { |
572 | | - $servers = $servers . " " . $serverpre . $tok . ":" . $this->getConf( 'Port' ); |
| 569 | + $servers = $servers . " " . $serverpre . $tok . ":" . $this->getConf( 'Port', $domain ); |
573 | 570 | $tok = strtok( " " ); |
574 | 571 | } |
575 | 572 | $servers = rtrim( $servers ); |