r24893 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24892‎ | r24893 | r24894 >
Date:08:05, 18 August 2007
Author:laner
Status:old
Tags:
Comment:
* Added a check for php-ldap in the connect method. The plugin will now fail gracefully, and tell the user to either compile support in, or add the module.
Modified paths:
  • /trunk/extensions/LdapAuthentication/LdapAuthentication.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LdapAuthentication/LdapAuthentication.php
@@ -138,6 +138,11 @@
139139
140140 $this->printDebug( "Entering Connect", self::NONSENSITIVE );
141141
 142+ if ( !extension_loaded( 'ldap' ) ) {
 143+ $this->printDebug( "Missing LDAP support; please ensure you have either compiled LDAP support in, or have enabled the module.", self::SENSITIVE );
 144+ return;
 145+ }
 146+
142147 //If the admin didn't set an encryption type, we default to tls
143148 if ( isset( $wgLDAPEncryptionType[$_SESSION['wsDomain']] ) ) {
144149 $encryptionType = $wgLDAPEncryptionType[$_SESSION['wsDomain']];

Status & tagging log