On 6/27/07, <b class="gmail_sendername">Patrick R. Michaud</b> <<a href="mailto:pmichaud@pobox.com">pmichaud@pobox.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Wed, Jun 27, 2007 at 04:49:24PM -1000, Sivakatirswami wrote:<br>> OK, we are planning to "ditch" Apache Basic Authentication and<br>> use PMwiki password protection (not AuthUser, just simple passwords)
<br>><br>> What will the CURL URL access strings be now?<br>><br>> something like<br>><br>> (wild guess, but to give an idea of what we might expect:)<br>><br>> <a href="http://my.wiki.org/ProtectedGroup.DataPage?action=login&password=">
http://my.wiki.org/ProtectedGroup.DataPage?action=login&password=</a>"bananas"<br><br>If you're using curl as a command-line tool, try the -d option:<br><br> curl -d authpw=banana <a href="http://my.wiki.org/ProtectedGroup.DataPage">
http://my.wiki.org/ProtectedGroup.DataPage</a><br><br>This generates a POST request for the page, exactly as if someone<br>had filled in the authorization form.<br><br>This can also be done with the password as part of the url, but be aware
<br>that the password will appear (in cleartext) in the server logs<br>as part of the request string. If you're okay with that, then you<br>can do a local customization like:<br><br> if (@$_GET['authpw']) SDV($_POST['authpw'], $_GET['authpw']);
<br><br>This allows passwords to come from url strings as well as forms.<br>Then a url like the following should work:<br><br> <a href="http://my.wiki.org/ProtectedGroup.DataPage?authpw=bananas">http://my.wiki.org/ProtectedGroup.DataPage?authpw=bananas
</a><br><br>No need to go through a separate "log in" step, just provide the<br>password as part of the request.</blockquote><div><br>When I requested this, around a year ago, PM provided the following, which I keep (commented out) in my template wiki, and include here in case a variation is needed or desired:
<br> ## allow append ?action=login?authpw=password to url<br> # if (!isset($_POST['authpw']) && @$_GET['authpw'])<br> # $_POST['authpw'] = $_GET['authpw'];<br><br><br>
</div><br></div>