Fix XML-RPC login method FS#2324
The login wasn't able to modify the session as it was already closed earlier. This patch also executes the correct event when logins via XMLRPC are done.
This commit is contained in:
parent
a533b44005
commit
fe13bd81bd
1 changed files with 13 additions and 2 deletions
|
@ -858,11 +858,22 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
|
||||||
global $auth;
|
global $auth;
|
||||||
if(!$conf['useacl']) return 0;
|
if(!$conf['useacl']) return 0;
|
||||||
if(!$auth) return 0;
|
if(!$auth) return 0;
|
||||||
|
|
||||||
|
@session_start(); // reopen session for login
|
||||||
if($auth->canDo('external')){
|
if($auth->canDo('external')){
|
||||||
return $auth->trustExternal($user,$pass,false);
|
$ok = $auth->trustExternal($user,$pass,false);
|
||||||
}else{
|
}else{
|
||||||
return auth_login($user,$pass,false,true);
|
$evdata = array(
|
||||||
|
'user' => $user,
|
||||||
|
'password' => $pass,
|
||||||
|
'sticky' => false,
|
||||||
|
'silent' => true,
|
||||||
|
);
|
||||||
|
$ok = trigger_event('AUTH_LOGIN_CHECK', $evdata, 'auth_login_wrapper');
|
||||||
}
|
}
|
||||||
|
session_write_close(); // we're done with the session
|
||||||
|
|
||||||
|
return $ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue