Skip to content

Commit

Permalink
Push/Pop the PHP session in order to keep OC and DW separated.
Browse files Browse the repository at this point in the history
  • Loading branch information
rotdrop committed Nov 18, 2013
1 parent 09dc1bc commit 321dcc1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions auth.php
Expand Up @@ -13,7 +13,12 @@ class auth_plugin_authowncloud extends DokuWiki_Auth_Plugin {

public function __construct() {
parent::__construct();
$savedSession = session_name();
session_write_close();
require_once($this->getConf('pathtoowncloud').'/lib/base.php');
session_write_close();
session_name($savedSession);
session_start();
// Check if ownCloud is installed or in maintenance (update) mode
if (!OC_Config::getValue('installed', false)) {
global $conf;
Expand Down Expand Up @@ -260,9 +265,14 @@ public function addGroup($group) {
public function logOff(){
/* Doesn't work, i don't no why. If I run this 3 lines in an
* external script, it works. Within DokuWiki not */
$savedSession = session_name();
session_write_close();
session_name(OC_Util::getInstanceId());
session_start();
OC_User::logout();
session_write_close();
session_name($savedSession);
session_start();
}


Expand Down

0 comments on commit 321dcc1

Please sign in to comment.