event for login page

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
oxygenws
Regular
Posts: 148
Joined: Thu Jan 20, 2005 11:20 am
Location: Iran
Contact:

event for login page

Post by oxygenws »

is there any event for login page? (at serendipity_admin.php before login)

i want this for "forgot password" plugin -> http://www.s9y.org/forums/viewtopic.php?t=988
My Blog, powered by s9y is http://oxygenws.com/blog/
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: event for login page

Post by garvinhicking »

Does the 'backend_auth' hook suffice for you? (Grep through the files, don't know where exactly it is, but it's used for the login form...)

If not, just invent a hook and submit us a diff so we'll include it. :)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
oxygenws
Regular
Posts: 148
Joined: Thu Jan 20, 2005 11:20 am
Location: Iran
Contact:

Post by oxygenws »

there is only one file that has it, file "functions_config.inc.php" line 221. :D
i test it, i think it is useful :)

do you have any document on how to create events and how to use them?? what is parameters of serendipity_plugin_api::hook_event()?? first one is its name :) what about others??

and.... what is backend_auth parameters??

Code: Select all

serendipity_plugin_api::hook_event('backend_auth', $is_md5, array('username' => $username, 'password' => $password));
Best regards,
Omid
My Blog, powered by s9y is http://oxygenws.com/blog/
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi Omid!

Best you read our doc at http://www.s9y.org/43.html

Short: hook_event($hookname, $eventData, $addData) is called in the source instance.

Then each plugin which "listens" on the $hookname, can execute data. It gets the $eventData and $addData variables defined. Their input varies on which hook is used.

Like frontend_display contains $eventData with the entries, and $addData with some more properties. And frontend_comments has $eventData containing the list of comments.

A plugin may modify $eventData as it likes. $addData is read-only, that's the difference.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply