On 6/27/07, <b class="gmail_sendername">Patrick R. Michaud</b> &lt;<a href="mailto:pmichaud@pobox.com">pmichaud@pobox.com</a>&gt; 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>&gt; OK, we are planning to &quot;ditch&quot; Apache Basic Authentication and<br>&gt; use PMwiki password protection (not AuthUser, just simple passwords)
<br>&gt;<br>&gt; What will the CURL URL access strings be now?<br>&gt;<br>&gt; something like<br>&gt;<br>&gt; (wild guess, but to give an idea of what we might expect:)<br>&gt;<br>&gt; <a href="http://my.wiki.org/ProtectedGroup.DataPage?action=login&amp;password=">
http://my.wiki.org/ProtectedGroup.DataPage?action=login&amp;password=</a>&quot;bananas&quot;<br><br>If you&#39;re using curl as a command-line tool, try the -d option:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;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.&nbsp;&nbsp;If you&#39;re okay with that, then you<br>can do a local customization like:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;if (@$_GET[&#39;authpw&#39;]) SDV($_POST[&#39;authpw&#39;], $_GET[&#39;authpw&#39;]);
<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>&nbsp;&nbsp;&nbsp;&nbsp;<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 &quot;log in&quot; 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>&nbsp;&nbsp;&nbsp; ## allow append ?action=login?authpw=password to url<br>&nbsp;&nbsp;&nbsp; # &nbsp;&nbsp; if (!isset($_POST[&#39;authpw&#39;]) &amp;&amp; @$_GET[&#39;authpw&#39;])<br>&nbsp;&nbsp;&nbsp; # &nbsp;&nbsp;&nbsp; $_POST[&#39;authpw&#39;] = $_GET[&#39;authpw&#39;];<br><br><br>
</div><br></div>