[pmwiki-users] Always logged in for my IP (no password requested) : how to ?

ABClf languefrancaise at gmail.com
Fri Sep 7 09:19:57 CDT 2012


Well, I'm sure it's my fault, but I still dont see. Sorry. I guess i
am not clear either.

In my config, password stuff is set using

$DefaultPasswords['admin'] = crypt('xxx');
$DefaultPasswords['attr'] = crypt('xxx');
$DefaultPasswords['edit'] = crypt('yyy');
$DefaultPasswords['upload'] = crypt('xxx');

Nothing more related to password (no authuser, no userauth) ; plus
have a visible edit password.
And a few private pages are specially passworded (attr action).

Now, I would like my home ip to be recognized as gb's IP, and given
admin rights (can do everything) ;)
Because I use my wiki a lot, I would like to get free of password
access when I am at home (still being recognized as gb).

I have seen two ways :

## authdns ##

As for now, I dont know how to get it to work. I am not sure this...

# IP addresses and ranges
 89.00.00.00: id:gb @admin

...is the good way : what is @admin ? I have no "admin group" I guess.
All site is passworded in the most basic way.
I would like to say : consider this IP as gb and give him admin rights.

## config should be the second way ##

Yes, I guess the trick...

 Put these lines to local/config.php:
## Allow passwordless editing from own turf, pass for others.
if ($action=='edit'
 && !preg_match("/^90\\.68\\./", $_SERVER['REMOTE_ADDR']) )
 { $DefaultPasswords['edit'] = crypt('foobar'); }
Replace 90.68. with the preferred network prefix and foobar with the
default password for others.

... is working ; but how to mix this with my config ? before, or after ?

$DefaultPasswords['admin'] = crypt('xxx');
$DefaultPasswords['attr'] = crypt('xxx');
$DefaultPasswords['edit'] = crypt('yyy');

Should I write :

$DefaultPasswords['admin'] = crypt('xxx');
$DefaultPasswords['attr'] = crypt('xxx');
if ($action=='edit'
 && !preg_match("/^90\\.68\\./", $_SERVER['REMOTE_ADDR']) )
 { $DefaultPasswords['edit'] = crypt('yyy'); }

And by the way, in my case (just have passwordless usage for my home
IP), what solution is the best ?

Thank you,
Gilles.

2012/9/7 Petko Yotov <5ko at 5ko.fr>:
> ABClf writes:
>>
>> but I would like something just easy, as mentioned in PmWiki/Security (1):
>>
>> How do I take a whitelist approach where users from known or trusted
>> IP addresses can edit, and others require a password?
>>
>> Put these lines to local/config.php:
>> ## Allow passwordless editing from own turf, pass for others.
>> if ($action=='edit'
>>  && !preg_match("/^90\\.68\\./", $_SERVER['REMOTE_ADDR']) )
>>  { $DefaultPasswords['edit'] = crypt('foobar'); }
>> Replace 90.68. with the preferred network prefix and foobar with the
>> default password for others.
>
>
> This looks good, doesn't it work?
>
>
>> As for now, in my config, I have (2) :
>>
>> $DefaultPasswords['admin'] = crypt('xxx');
>> $DefaultPasswords['attr'] = crypt('xxx');
>> $DefaultPasswords['edit'] = crypt('yyy');
>>
>> I would like mix (1) & (2), but not sure how to do, nor what order...
>
>
> To mix 1 and 2, you could have
>
>   $DefaultPasswords['admin'] = $DefaultPasswords['attr'] = crypt('xxx');
>
>   $DefaultPasswords['edit'] = crypt('yyy');
>
> And to make it work in the above setting, place this block in place of the
> "$DefaultPasswords['edit'] = crypt('foobar');" line above, inside the
> {curly} brackets.
>
>
>> I tried to use AuthDNS cookbook but still dont have found how to do :
>> what should i write in SiteAdmin.AuthDNS to have no password for my ip ?
>>
>> This doesnt work (my mistake, for sure, but havent found the good way
>> ; --fake ip here--) :
>>  # IP addresses and ranges
>>   89.00.00.00: id:gb @admin
>
>
> This looks good too, if your IP address is fixed, you'll be able to login
> with no password and be added as user "gb" to the group @admin.
>
> Note that there is a login step/action, just go to AnyPage?action=authdns.
>
> Petko
>
>
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users



-- 

---------------------------------------
| A | de la langue française
| B | http://www.languefrancaise.net/
| C | languefrancaise at gmail.com
---------------------------------------



More information about the pmwiki-users mailing list