One thing: > $page = FmtPageName($pagename, '$Group.$Name' ); > $SelfPagetype = PageTextVar($page, "pagetype");
Not sure what FmtPageName returns, but try removing that line and do this instead: $SelfPagetype = PageTextVar($pagename, "pagetype"); Are you sure $SelfPagetype is being set okay? ~ ~ Dave [email protected] wrote: > 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 > > > > _______________________________________________ > pmwiki-users mailing list > [email protected] > http://www.pmichaud.com/mailman/listinfo/pmwiki-users > _______________________________________________ pmwiki-users mailing list [email protected] http://www.pmichaud.com/mailman/listinfo/pmwiki-users
