/**
 * Sets up the auto-authentication piece of the LDAP plugin.
 *
 * @access public
 */
function AutoAuthSetup()
{
    global $wgHooks;
    global $wgAuth;
    $wgAuth = new LdapAuthenticationPlugin();
    $wgAuth->printDebug("Entering AutoAuthSetup.", NONSENSITIVE);
    if (!$wgAuth->getConf('AutoAuthUsername')) {
        $wgAuth->printDebug("wgLDAPAutoAuthUsername is not null, adding hooks.", NONSENSITIVE);
        $wgHooks['UserLoadAfterLoadFromSession'][] = 'LdapAutoAuthentication::Authenticate';
        $wgHooks['PersonalUrls'][] = 'LdapAutoAuthentication::NoLogout';
        /* Disallow logout link */
    }
}
Пример #2
0
/**
 * Sets up the auto-authentication piece of the LDAP plugin.
 *
 * @access public
 */
function AutoAuthSetup()
{
    global $wgHooks;
    global $wgAuth;
    $wgAuth = new LdapAuthenticationPlugin();
    $wgAuth->printDebug("Entering AutoAuthSetup.", NONSENSITIVE);
    # We need both authentication username and domain (bug 34787)
    if ($wgAuth->getConf("AutoAuthUsername") !== "" && $wgAuth->getConf("AutoAuthDomain") !== "") {
        $wgAuth->printDebug("wgLDAPAutoAuthUsername and wgLDAPAutoAuthDomain is not null, adding hooks.", NONSENSITIVE);
        $wgHooks['UserLoadAfterLoadFromSession'][] = 'LdapAutoAuthentication::Authenticate';
        $wgHooks['PersonalUrls'][] = 'LdapAutoAuthentication::NoLogout';
        /* Disallow logout link */
    }
}