Commit 2c761cce authored by Fjen Undso's avatar Fjen Undso
Browse files

initialize groupbackend seperately

parent 25702710
......@@ -2,3 +2,6 @@
$userBackend = new OCA\user_wcf\User_WCF();
\OC_User::useBackend($userBackend);
$groupBackend = new OCA\user_wcf\Group_WCF();
\OC::$server->getGroupManager()->addBackend($groupBackend);
......@@ -6,9 +6,12 @@
<licence>AGPL</licence>
<author>Fritz Webering</author>
<require>5</require>
<shipped>true</shipped>
<version>1.0.0</version>
<types>
<type>authentication</type>
<type>prelogin</type>
<authentication/>
<prelogin/>
</types>
<dependencies>
<nextcloud min-version="10" max-version="20"/>
</dependencies>
</info>
......@@ -19,8 +19,11 @@ namespace OCA\user_wcf;
class Group_WCF extends \OC_Group_Backend {
protected $db;
public function __construct($wcfPath, $authorizedGroups) {
public function __construct() {
require(\OC_App::getAppPath('user_wcf').'/config/config.php');
if (!file_exists($wcfPath) || !is_dir($wcfPath)) throw new \Exception('Not a valid WCF path: "'.$wcfPath.'"');
$this->db = lib\WCF_DB::getInstance($wcfPath);
$this->db->setAuthorizedGroups($authorizedGroups);
}
/**
* @brief Check if backend implements actions
......
......@@ -26,9 +26,6 @@ class User_WCF extends \OC_User_Backend {
if (!file_exists($wcfPath) || !is_dir($wcfPath)) throw new \Exception('Not a valid WCF path: "'.$wcfPath.'"');
$this->db = lib\WCF_DB::getInstance($wcfPath);
$this->db->setAuthorizedGroups($authorizedGroups);
$groupBackend = new Group_WCF($wcfPath, $authorizedGroups);
\OC_Group::useBackend($groupBackend);
}
public function getSupportedActions() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment