Hi,

We are looking to use PHPmyFAQ to use as an internal knowledge base and I'm having trouble with getting LDAP and SSO working. The support from the website is very limited.

I have it configured with LDAP and this is working fine. When I enable the SSO section, only users who have logged in previously are logged in automatically. From reading on the site it would appear that the only check for SSO is on the username and not domain\username

The code below is part of the SSO.php Is anyone able to help me debug the PHP?

Code:
/**
     * Checks if the username of the remote user is equal to the login name
     *
     * @param string $login        Loginname
     * @param string $pass         Password
     * @param array  $optionalData Optional data
     *
     * @return boolean
     */
    public function checkPassword($login, $pass, Array $optionalData = null)
    {
        if (!isset($_SERVER['REMOTE_USER'])) {
            return false;
        } else {
            // Check if "DOMAIN\user", "user@DOMAIN" or only "user"
            $remoteUser = explode('\\', $_SERVER['REMOTE_USER']);
            if (is_array($remoteUser) && count($remoteUser) > 1) {
                $user = $remoteUser[1];
            } else {
                $remoteUser = explode('@', $_SERVER['REMOTE_USER']);
                if (is_array($remoteUser) && count($remoteUser) > 1) {
                    $user = $remoteUser[0];
                } else {
                    $user = $_SERVER['REMOTE_USER'];
                }
            }
            if ($user === $login) {
                return true;
            } else {
                return false;
            }
        }
    }

    /**
     * Returns true, if $_SERVER['REMOTE_USER'] is set.
     *
     * @param string $login        Loginname
     * @param array  $optionalData Optional data
     *
     * @return boolean
     */
    public function checkLogin($login, Array $optionalData = null)
    {
        return isset($_SERVER['REMOTE_USER']) ? true : false;
    }
}
Thanks,

Michael