[pmwiki-users] Hi there: how do I show a password field?

Petko Yotov 5ko at 5ko.fr
Sun Nov 15 07:40:54 CST 2009


On Thursday 12 November 2009 19:27:08, Gene Horodecki wrote :
> 2009/11/13 Gene Horodecki <geneh at shaw.ca>
> >     One tiny question.  I have just gotten my wiki going and I have a
> >     public
> >     section and a private section.  The links from the public to the
> >     private
> >     are hidden via auth conditionals.  Is there a way to show a password
> >     prompt in the sidebar or on top so that a person can sign in without
> >     first clicking on a restricted link?  Thanks.

Hello. You can place such markup in the SideBar page:

(:if auth edit RestrictedGroup.RestrictedPage:)
[[{*$FullName}?action=logout|Logout]]
(:else:)
(:input form method=post action="{*$PageUrl}?action=login":)
(:input hidden n {*$FullName}:)
(:input hidden action login:)
(:if2 enabled EnableAuthUser:)$[Name]: (:input text name=authid:)\\
(:if2:)$[Password]: (:input password name=authpw:)
(:input submit value='OK':)
(:input end:)
(:if:)

If you want your users, after entering the password, directly to go to 
RestrictedGroup.RestrictedPage, change the "input form" line and the next one 
to:

(:input form method=post 
action="{RestrictedGroup.RestrictedPage$PageUrl}?action=login":)
(:input hidden n RestrictedGroup.RestrictedPage:)

Note that on most servers the lines with "input hidden" are not required, but 
on some, they are.

For more information about if, if2 conditionals and input forms, refer to :
  http://www.pmwiki.org/wiki/PmWiki/ConditionalMarkup
  http://www.pmwiki.org/wiki/PmWiki/Forms
  http://www.pmwiki.org/wiki/PmWiki/PageVariables about the {*$FullName} stuff.

Petko



More information about the pmwiki-users mailing list