[Pmwiki-users] query to verify if user is "logged on" as editor

Patrick R. Michaud pmichaud
Tue Oct 12 11:14:02 CDT 2004


On Tue, Oct 12, 2004 at 03:07:38PM +0200, Knut Alboldt wrote:
> how can I query (e.g. in config.php) whether a user is logged on as an 
> editor, i.e. is a user authorized to edit the displayed page (v1 and v2) ?

if (RetrieveAuthPage($pagename,'edit',false)) {
   # user is authorized to edit
} else {
   # user is not yet authorized to edit
}

This will generally not work if you're using HTTP-based authentication,
because browsers typically send authentication information only in
response to a request for it.  It should work with session-based
authentication, however.  It will work especially nicely under v2's
session-based authentication, which keeps track of all of the passwords
entered during a particular browsing session (instead of just the most
recent one).

Pm



More information about the pmwiki-users mailing list