Hi, After one more day of frustration and not succeeding I am going to bug you one more
time with some code of my attempts of the day:
$apiRequest =
'http://www.mywebsite.net/wiki/api.php?action=login&lgname='.$activedirectoryuser.'&lgpassword='.$activedirectorypwd.'&lgdomain=MYDOMAIN&format=php$
$login = unserialize(file_get_contents($apiRequest));
if($login['login']['result'] == 'Success') {
setcookie("wiki_wikiUserID", $login['login']['lguserid']
, 0, "/", ".mywebsite.net");
setcookie("wiki_wikiUserName",
$login['login']['lgusername'] , 0, "/",
".mywebsite.net");
setcookie("wiki_wiki_token", $login['login']['lgtoken']
, 0, "/", ".mywebsite.net");
header('Location:
http://www.mywebsite.net/wiki/index.php/Main_Page'
<http://www.mywebsite.net/wiki/index.php/Main_Page'> );
} else {
...
Thus: I can authenticate using the api. In return I get a page with some php array
(mentioning success!). Now I need to somehow redirect the browser to the main page of the
wiki to benifit from the succeeded login. This is where I am lost. I obivously somehow
need to start some session. Hopefully one of you can be a little more verbose in his or
her reaction, because I seem to need it ;-) I also tried the FauxRequest approach
described on the wiki and even experimented with libcurl but all without succes... I hope
someone has the heart (and time) to save me from this ordeal. -- Jac
Ah, so I should somehow post the variables to the
Special:Userpage? Meaning the instantiation of a FauxWebRequest? Or should I take a
different approach? Sorry for dragging on but I spend quite some time on this and got
pretty much lost in the class structure of mediawiki, promise to pay back by documenting
my scenario and solution on the mediawiki wiki somewhere
Note that you can also
login through the API:
http://en.wikipedia.org/w/api.php?action=login&lgname=user&lgpasswo…
<http://en.wikipedia.org/w/api.php?action=login&lgname=user&lgpassword=password>
Roan Kattouw (Catrope)