[pmwiki-users] set default password according to a ptv
noskule at gmx.net
noskule at gmx.net
Fri Jan 9 18:12:56 CST 2009
hi list
I stuck with a problem setting default password according to ptv's .
The ptv's are used to define the type ( Blog, Article, Issue, Comment.
...) of a page. So, for example I would like to set the default
password for blog-post to @authors and @nopass for comments.
wikipage: - - - - - - - - - - - - - - - - - - - - - - - - - - -
[[#Text]]
content content content content content content content
content content content content content content content
[[#Textend]]
(:pagetype:Blog:)
config.php - - - - - - - - - - - - - - - - - - - - - - - - - - -
$AuthUser['Admin'] = array('$1$jNIek901$0gu4ogNsl2xX6hsS4JGJL/', '@admins');
$AuthUser['Author'] = array('$1$jNIek901$0gu4ogNsl2xX6hsS4JGJL/',
'@authors');
// $DefaultPasswords['read'] = '@authors'; // read access only for
authors
$DefaultPasswords['admin'] = array('@admins', 'id:Admin');
$DefaultPasswords['attr'] = '@admins';
$DefaultPasswords['upload'] = '@authors';
// $DefaultPasswords['edit'] = '@authors';
$page = FmtPageName($pagename, '$Group.$Name' );
$SelfPagetype = PageTextVar($page, "pagetype");
if ( $SelfPagetype == '' )
$DefaultPasswords['edit'] = '@admins';
elseif ( $SelfPagetype == 'SiteStructure' )
$DefaultPasswords['edit'] = '@admins';
elseif ( $SelfPagetype == 'Blog' )
$DefaultPasswords['edit'] = '@authors';
elseif ( $SelfPagetype == 'Comment' )
$DefaultPasswords['edit'] = '@nopass';
include_once("$FarmD/scripts/authuser.php");
$FoxAuth = 'edit';
$FoxPagePermissions['*.*'] = 'all';
include_once("$FarmD/cookbook/fox/fox.php");
include_once("$FarmD/cookbook/fox/foxedit.php");
the code above don't work, means pmwiki don't ask for a password no
matter what pagetype is defined on the page. It seams that the functions
FmtPageName and PageTextVar works only if called after authuser is
configured. Does anyone have and idea how to get around this or do it
another way?
Thans for any hints
nos
More information about the pmwiki-users
mailing list