Hi, I'm new with Dokuwiki. It's awesome :cool:
I have a problem using backend authentication.
I'm using MySQL Authentification Backend to integrate dokuwiki with an information system. I want that a user, when log in the system, automatically log in also dokuwiki.
Make sense using dokuwiki.login from XMLRPC to achieve that? I tried that, but seems like cookies are not setted.
This is the code i tried to use:
<?php
include('xmlrpc-3.0.0.beta/lib/xmlrpc.inc'); // or whereever you habe downloaded and put the XML-RPC
// for PHP libraries
// create a new client instance
$c = new xmlrpc_client('/dokuwiki/lib/exe/xmlrpc.php', 'localhost', 80);
// enable debugging to see more infos :-) (well, not for production code)
$c->setDebug(1);
// create the XML message to send
$m = new xmlrpcmsg('dokuwiki.login');
$m->addParam(new xmlrpcval("alz@prova.it", "string"));
$m->addParam(new xmlrpcval("test2", "string"));
// send the message and wait for response
$r = $c->send($m);
if($r == false) die('error');
if(!$r->faultCode()){
// seems good. Now do whatever you want with the data
$v = php_xmlrpc_decode($r->value());
if ($v) echo "OK";
else echo "Wrong password!";
}
I have to take the cookies from somewhere? The code return only result of operation.
I tried to see also here:
http://forum.dokuwiki.org/thread/4656, but it seems a different problem. I don't want to go on dokuwiki when log in the system, i want log in the system and, afterwards, join dokuwiki without re-login there.
Thanks and sorry for my poor english... :-p