On Fri, Apr 24, 2009 at 01:08, Daniel Roesler <diaf...@gmail.com> wrote: > Howdy all, > > I'm starting to look into writing a patch/recipe for implementing a > cookie-based option for authorizations. Basically, you can stay logged > in during multiple visits. This is fairly common on other sites (with > the "Remember Me?" checkbox and whatnot), so I thought I'd check here > first to see if anything already exists in PmWiki. I've read through > the SessionAuth() function in /pmwiki.php, but I don't see any spot > for checking to see if authorizations are in cookies. So what it looks > like now, is adding a step in SessionAuth() that looks for cookies if > a config.php variable (say $CookieAuth) is set to 1. Obviously, other > variables could be implemented (default cookie lifespan, etc.), but > that's further down the road. Anyone have a better idea for patching > PmWiki to add persistent authorizations? > > Avast! > Daniel Roesler > diaf...@gmail.com > > _______________________________________________ > pmwiki-devel mailing list > pmwiki-devel@pmichaud.com > http://www.pmichaud.com/mailman/listinfo/pmwiki-devel >
Hi, IMHO, I would be nice to have this implemented as a full wrapper function. Ie. this new function would only have to handle the user password via cookie persistence/encryption/... and provide it to the regular auth function itself. No need to patch anything: ## recipe.php $OriginalAuthFunction = $AuthFunction; $AuthFunction = 'CookiePersistentPmWikiAuth'; function CookiePersistentPmWikiAuth($pagename, $level, $authprompt=true, $since=0) { global $OriginalAuthFunction; # [do there what you need to retrieve and make persist the user password...] # [...then provide it to the original function] $_POST['authpw'] = 'user_password'; return $OriginalAuthFunction($pagename, $level, $authprompt, $since); } -- Dominique _______________________________________________ pmwiki-devel mailing list pmwiki-devel@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-devel