Liveuser status

Michi <[email protected]> Tue, 30 Aug 2005 09:36:49 +0200
Newsgroups gmane.comp.php.pear.liveuser
Message-ID <[email protected]>
Hello,

I just started to fix my app for liveuser-0.16.5.
In my login script I used to show to users messages using
liveuser->getStatus();

here's a small snippet:
--------

 switch ($status) {
        case LIVEUSER_STATUS_ISINACTIVE: // inactive            
            $loginMsg = _("Your account has been deactivated. Please contact the webmaster!");            
        break;
            
        case LIVEUSER_STATUS_IDLED: // idled                        
            $loginMsg = _("You are idled.");            
        break;
        
        case LIVEUSER_STATUS_EXPIRED: // expired
            $loginMsg = _("You are expired.");
        break;

        case LIVEUSER_STATUS_OK:
            $loginMsg = _("Please login.");            
        break;

        case LIVEUSER_STATUS_LOGGEDOUT:
            $loginMsg = _("You have been succesfully logged out!");
        break;
        
        case LIVEUSER_STATUS_AUTHFAILED:
            $loginMsg = _("Username or password wrong. Please try it again!");            
        break;

        case LIVEUSER_STATUS_UNKNOWN:
            $loginMsg = _("Please login!");            
        break;
 }

I found out, that I get LIVEUSER_STATUS_AUTHFAILED by default, ie.
only when initing liveuser (not sending any auth data).

$handle = isset($_REQUEST['handle']) ? $_REQUEST['handle'] : null;
$password = isset($_REQUEST['password']) ? $_REQUEST['password'] : null;
$logout = isset($_REQUEST['logout']) ? $_REQUEST['logout'] : null;
$remember = isset($_REQUEST['remember']) ? $_REQUEST['remember'] : null;
if (!$liveuser->init($handle, $password, $logout, $remember)) {
       var_dump($liveuser->getErrors());
        die();
}

I don't know how to distinguish the case that auth failed and the
default case.

When using older LiveUser this works. Do you have an idea how to fix
this?

Thank you in advance.

Michi.