[pmwiki-users] write ptv to profiles page is a user logout

Peter Bowers pbowers at pobox.com
Fri Mar 6 01:28:20 CST 2009

> yes, that's exactly the main problem, action login does not work cause
> it is true before the user entered the login data.
> any idea?

PROBLEM: Identifying when a user has *just* successfully logged in (i.e., a
trigger to do something a single time immediately after a user logs in)

You could check if a value is set in $_SESSION['mynewkey'].  If that session
value is not set and $AuthId is set then you have a successful new login --
set the various PTVs AND this value in $_SESSION['mynewkey'].  If that
session value is set then you've already handled setting the PTVs for this
login and so you do nothing.

if (!isset($_SESSION['mynewkey']) && isset($AuthId)) {
   # session_start() //is this necessary?
   $_SESSION['mynewkey'] = true;

You *may* have to do a session_start() or something -- I don't remember if
pmwiki handles that before or after config.php.


More information about the pmwiki-users mailing list