From 00c4c02b822a277054929cdc5735f1ca3e8412be Mon Sep 17 00:00:00 2001 From: Lavd <34172363+lavdnone@users.noreply.github.com> Date: Sat, 30 Mar 2019 23:45:04 -0400 Subject: [PATCH] Update base.php imap groups via domain-part Signed-off-by: none --- lib/base.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/base.php b/lib/base.php index c4da57f..549d4c2 100644 --- a/lib/base.php +++ b/lib/base.php @@ -6,6 +6,7 @@ * See the COPYING-README file. */ namespace OCA\user_external; +use \OC_DB; /** * Base class for external auth implementations that stores users @@ -182,7 +183,21 @@ abstract class Base extends \OC\User\Backend{ 'backend' => $query->createNamedParameter($this->backend), ]); $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) + ); + } } + } /**