[pmwiki-devel] minor(?) inefficiency in CondAuth function
Thomas Pitschel
th.pitschel at gmx.de
Mon Feb 26 00:39:01 CST 2007
Hello,
I just came again across the authentication functions and have seen the line
return (boolean)RetrieveAuthPage($pn, $level, false, READPAGE_CURRENT);
in function CondAuth in pmwiki.php.
Isn't a bit waste to retrieve the page content just for finding out whether there the user is authenticated on the specified level? If there are many (:if auth ... :) clauses in the markup, this slows down the server response unnecessarily.
As I am currently working on an alternative auth module, my preferred solution would be to have an additional permission check handle similar to $AuthFunction, but now with two arguments (authprompt always false):
$CurrUserHasPermFor($pagename, $level).
It's is of course uncritical though - one can always define a custom Conditions['auth'] function and do whatever optimization one likes.
Any comments about it?
Thomas
--
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser
More information about the pmwiki-devel
mailing list