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?
Thanks in advance, Sean Prunka
On Wed, Oct 31, 2012 at 10:13 AM, Prunka, Sean PRUNKAS@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
Thanks!
-----Original Message----- From: mediawiki-api-bounces@lists.wikimedia.org [mailto:mediawiki-api-bounces@lists.wikimedia.org] On Behalf Of Chad Sent: Wednesday, October 31, 2012 10:35 AM To: MediaWiki API announcements & discussion Subject: Re: [Mediawiki-api] Curious about logins...
On Wed, Oct 31, 2012 at 10:13 AM, Prunka, Sean PRUNKAS@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
_______________________________________________ Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
mediawiki-api@lists.wikimedia.org