PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Authentication » LiveUser » Bug #3275

Please add event 'onFailedLogin'

Details

Request #3275Please add event 'onFailedLogin'
Submitted2005-01-23 20:04 UTC
Fromroehr at zilleon dot com
StatusClosed
PackageLiveUser
PHP VersionIrrelevant
OSirrelevant
Roadmaps(Not assigned)

Comments

[2005-01-23 20:04 UTC] roehr at zilleon dot com

Description:
------------
Hi,

please add an event for 'onFailedLogin'. See below.

Thank you very much!

Best regards, Torsten Roehr

Reproduce code:
---------------
Just add the following code in LiveUser.php:

Line 300:
'onFailedLogin', // unsuccessful login

Line 985:
$this->triggerEvent('onFailedLogin');

[2005-01-23 20:46 UTC] smith at backendmedia dot com

Seems sensible. Could you use a unified diff in the future? As the code in LiveUsers on your line numbers will become meaningless.

[2005-01-23 22:36 UTC] roehr at zilleon dot com

Here's the diff:

@@ -295,14 +295,15 @@
* @access protected
* @var array
*/
var $events = array(
- 'onLogin', // successfully logged in
- 'forceLogin', // login required -> you could display a login form
- 'onLogout', // before logout -> can be used to cleanup own stuff
- 'postLogout', // after logout -> e.g. do a redirect to another page
- 'onIdled', // maximum idle time is reached
- 'onExpired' // authentication session is expired
+ 'onLogin', // successfully logged in
+ 'onFailedLogin', // unsuccessful login
+ 'forceLogin', // login required -> you could display a login form
+ 'onLogout', // before logout -> can be used to cleanup own stuff
+ 'postLogout', // after logout -> e.g. do a redirect to another page
+ 'onIdled', // maximum idle time is reached
+ 'onExpired' // authentication session is expired
);

/**
* Used to store attached observers.
@@ -979,8 +980,9 @@
}

if (!$this->isLoggedIn()) {
$this->_stack->push(LIVEUSER_ERROR_WRONG_CREDENTIALS, 'error');
+ $this->triggerEvent('onFailedLogin');
return false;
}

// user has just logged in

[2005-01-25 10:27 UTC] smith at backendmedia dot com

This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pear.php.net.

In case this was a pear.php.net website problem, the change will show
up on the website in short time.

Thank you for the report, and for helping us make PEAR better.