Andreas Gohr wrote:
We should think if this can be improved.
Is a die() call the correct way if the new file isn't writable? I think it should be fatal only if ACL is enabled. Or should it never be fatal?
Note that it will only fatal when there actually is a users.auth or acl.auth file. These files are not in the distribution, and the admin has to create them manually to support acl.
I think this behavior is appropriate, to avoid any chance confusion. However, the die message could be improved to explicitly request the intervention of the admin, asking to make the copy manually.
Is the init.php file the right place to handle it? Or should this be moved to another file? Maybe auth.php?
If it is now certain that only *.auth files will need to be handled, perhaps yes. On the other hand, this code will likely be thrown out after a few more releases so this "prominent" place may not be a bad idea (in order not to forget about it).
Is there a simple way to avoid this function being called on every page? After all it just needs to be called once for each file ever. I guess not but we should think about it.
I guess it would be easy to do something about this with session variables or cookies. However, these need to be checked and handled also. Note that the function bails out (almost) immediately based on a file existence check. So - would it actually make a difference?
Jan
-- Jan Decaluwe - Resources bvba - http://jandecaluwe.com Losbergenlaan 16, B-3010 Leuven, Belgium
-- DokuWiki mailing list - more info at http://wiki.splitbrain.org/wiki:mailinglist