[pmwiki-users] (:if construction

lists at basel-inside.ch lists at basel-inside.ch
Wed Jan 15 03:45:03 CST 2014


Hello

I cannot exactly answer your questions, but here how I implemnted auth:

I was inpired by
http://www.pmwiki.org/wiki/Cookbook/LoginLogout
(but usually a login is not necessary, because it is prompted, when  
you do an action  which is not authorized, but sometimes it's  
necessary for example to find all pages when searching).

on the following site I use pmwiki auth:
http://wprj.net/wprj/chor/index.php/ABC/HomePage

a valid user woulde be: chormatt/chormatt

(for some reasons I have a default user, which is assigned  
automatically, same logik but different authorisations for any user).

(:if authgroup id:surfer:)
*[[Profiles/{$AuthId}|Gast User]] [[http:?action=login|login]]
(:elseif authid:)
*[[Profiles/{$AuthId}|Home {$AuthId}]] [[http:?action=logout|logout]]
(:ifend:)
(:if authgroup id:pogay:)
*[-%green%''{$Version} {$userlang}''%%-]
... options for my user, not iteresting for others.
(:ifend:)

Interestingy I had to check the user with (authgroup id:user)

I hope my implementation can help you to implement your auth correctly.

--- my farmconfig

     /* relevant auth config */
     $AuthUser['pogay']    = '....';  /* can  be defined locally */

[..] other config and plugins

   /* after execution local configs */
     $DefaultPasswords['read']   = 'id:pogay';
     $DefaultPasswords['edit']   = 'id:pogay';
     $DefaultPasswords['upload'] = 'id:pogay';
     $DefaultPasswords['admin']  = 'id:pogay';
     $DefaultPasswords['guest']  = '';
     $DefaultPasswords['auth']  = '';

     $HandleAuth['source'] = 'guest';


     require_once("$FarmD/scripts/authuser.php");   /* User based Auth */

---------------------------------------------------

regards
Patrick Ogay


Quoting Jont Allen <jontalle at illinois.edu>:

> Dear list,
>
> I'm having a problem that I cannot understand. In order to describe  
> this problem I have tried to simplify the environment as much as  
> possible.
>
> I installed the default and latest version of pmwiki-2.2.58, and
> edited the local/config.php log file so that it defined the admin  
> password variable:
>
> $DefaultPasswords['admin'] = crypt('mysecret');
>
> Next I added the following construction to the default home page:
>
> (:if enabled AuthId:)
> body text
> (:ifend:)
>
> I then logged in as admin:
>    ...?action=admin
> The login appeared to be successful.
>
> 1) How do you know if the login is successful?
>
> 2) Once logged in, my test construction failed to display "body text"
>
> Summary: using the default pmwiki download, I am not able to  
> successfully use the
>   (:if enabled AuthId:)...(:ifend:)
> construction.
>
> I suspect that the variable $AuthId is not "true" for some reason.
>
> Please advise. For example:
>
> 1) how can I print out the value of AuthId?
>
> 2) How do I verify I'm logged in so that AuthId==true?
>
> 3) How can I debug this problem?
>
> Jont Allen
>
>
> On 01/13/2014 10:23 AM, Jont Allen wrote:
>> I'm trying to use the (:if :ifend) construction along with edit headers ====
>> like this:
>>
>> ====
>> (:if enabled AuthId:)
>> body
>> (:ifend:)
>>
>> I am using the cookbook script
>>   sectionedit.php
>> (which may be old). This php script removeds the ==== from the page.
>>
>> When I login as admin (login on the left, not as an edit login), I do
>> not see the "body" between the conditional construction.
>>
>> Summary:
>> *It appears that the sectionedit.php script is working (it removes ====) but
>> *I cannot see the body when logged in as admin
>>
>> I defined the admin passwd via the
>>   wiki/local/config.php
>> rather than as described in
>>   wiki/pmwiki.php?n=SiteAdmin/AuthUser
>>
>> There are too many places were something could go wrong, and too little
>> information for me to debug this. I need some help.
>>
>> Suggestions?
>>
>> Thanks,
>>
>> Jont allen
>>
>
>
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
>





More information about the pmwiki-users mailing list