Skip to content

Commit

Permalink
converted to getGroupManager()->createGroup from OC_DB
Browse files Browse the repository at this point in the history
  • Loading branch information
lavdnone authored Apr 15, 2019
1 parent ec6cbd6 commit 97257ef
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions lib/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* See the COPYING-README file.
*/
namespace OCA\user_external;
use \OC_DB;

/**
* Base class for external auth implementations that stores users
Expand Down Expand Up @@ -185,16 +184,8 @@ protected function storeUser($uid)
$query->execute();
$pieces = explode('@',$uid,2);
if($pieces[1]) {
OC_DB::executeAudited(
'INSERT IGNORE INTO `*PREFIX*groups` ( `gid` )'
. ' VALUES( ? )',
array($pieces[1])
);
OC_DB::executeAudited(
'INSERT INTO `*PREFIX*group_user` ( `gid`, `uid` )'
. ' VALUES( ?, ? )',
array($pieces[1], $uid)
);
$createduser = \OC::$server->getUserManager()->get($uid);
\OC::$server->getGroupManager()->createGroup($pieces[1])->addUser($createduser);
}
}

Expand Down

0 comments on commit 97257ef

Please sign in to comment.