Skip to content
Snippets Groups Projects
Commit 5d87b2cc authored by Andreas Gohr's avatar Andreas Gohr
Browse files

ACL user wildcard changed to %USER% FS#1504 :!:

DokuWiki supports a wildcard which gets replaced with the currently loggedin
user in its ACL configuration file.

This patch changes the wildcard from @USER@ to %USER% (case sensitive) and
also makes sure the ACL Manager does not replace the wildcard when displaying
the currently set rules.

The change was needed for better compatibility with the User Manager without
complicating the code. The old @USER@ wildcard is still supported, but
changing an ACL rule using it, through the ACL manager will fail.

It is recommended to update ACL rules using the @USER@ wildchar to use the
new %USER% one instead.

darcs-hash:20081216171126-7ad00-94ce0c2afa411abc936f13572efd0e31941901ee.gz
parent a3a4e862
No related branches found
No related tags found
No related merge requests found
......@@ -84,7 +84,8 @@
if(is_readable(DOKU_CONF.'acl.auth.php')){
$AUTH_ACL = file(DOKU_CONF.'acl.auth.php');
if(isset($_SERVER['REMOTE_USER'])){
$AUTH_ACL = str_replace('@USER@',$_SERVER['REMOTE_USER'],$AUTH_ACL);
$AUTH_ACL = str_replace('%USER%',$_SERVER['REMOTE_USER'],$AUTH_ACL);
$AUTH_ACL = str_replace('@USER@',$_SERVER['REMOTE_USER'],$AUTH_ACL); //legacy
}
}else{
$AUTH_ACL = array();
......
......@@ -63,6 +63,9 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
global $AUTH_ACL;
global $ID;
// fresh 1:1 copy without replacements
$AUTH_ACL = file(DOKU_CONF.'acl.auth.php');
// namespace given?
if($_REQUEST['ns'] == '*'){
$this->ns = '*';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment