2005-07-17
cjj
Hello,
a possible solution for the #FIXME in the function admin_acl_del in inc/admin_acl.php
==========================
function admin_acl_del($acl_scope, $acl_user){
$acl_config = file(DOKU_INC.'conf/acl.auth.php');
$acl_pattern = '^'.preg_quote($acl_scope,'/').'\\s+'.$acl_user.'\\s+[0-8].*$';
if (phpversion()>"4.1.9")
{
// New PHP Version
// save all non!-matching #FIXME invert is available from 4.2.0 only!
$new_config = preg_grep("/$acl_pattern/", $acl_config, PREG_GREP_INVERT);
}
else
{
// Old PHP Version, we have to emulate the invert Parameter by hand
foreach ($acl_config as $cjjkey => $cjjvalue)
{
if (! preg_match("/$acl_pattern/", $cjjvalue))
{
$new_config[$cjjkey]=$cjjvalue;
}
}
}
return io_saveFile(DOKU_INC.'conf/acl.auth.php', join('',$new_config));
}
====================