On Wed, Oct 31, 2012 at 10:13 AM, Prunka, Sean <PRUNKAS(a)battelle.org> wrote:
Our wiki (running 1.15.3) has a requirement to be
logged in to view any
pages other than login and the Main_Page.
By default this extends to the API, but I’m having trouble understanding how
to do the logins from an external PHP app w/ fopen. (can’t get the cookies
set up.)
(We cannot use Snoopy, and the mangmt would prefer to not use cURL.)
I am allowed to allow API calls w/o a login, given that our environment is
closed, and not accessible to (or from) the Internet.
Is there a way to leave the required login in place for direct visits to our
wiki, but turn it off for API calls?
Alternately, is there an example login script for PHP that uses fopen,
instead of cURL or Snoopy that I could modify for our needs?
If cURL is absolutely not an option, you could accomplish what you're
getting at by using PHP's stream_context_create[0].
-Chad
[0]
http://www.php.net/manual/en/function.stream-context-create.php