Skip to content

Commit

Permalink
Dont use isSyncMaintained
Browse files Browse the repository at this point in the history
  • Loading branch information
mrow4a committed Mar 11, 2018
1 parent b24aae4 commit 707ac94
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 29 deletions.
4 changes: 0 additions & 4 deletions lib/private/Group/Backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,4 @@ public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) {
public function isVisibleForScope($scope) {
return true;
}

public function isSyncMaintained() {
return false;
}
}
7 changes: 0 additions & 7 deletions lib/private/Group/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,4 @@ public function groupExists($groupName) {
$stmt->closeCursor();
return isset($data['exists']);
}

/**
* Groups and memberships of this backend are maintained by the users
*/
public function isSyncMaintained() {
return false;
}
}
4 changes: 1 addition & 3 deletions lib/private/User/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,7 @@ public function tryBasicAuthLogin(IRequest $request) {
private function updateUserMemberships(IUser $user) {
// Update only the backends which are sync maintained
foreach($this->groupManager->getBackends() as $groupBackend) {
if ($groupBackend->isSyncMaintained()) {
$this->groupSyncService->syncUserMemberships($groupBackend, $user->getUID());
}
$this->groupSyncService->syncUserMemberships($groupBackend, $user->getUID());
};
}

Expand Down
8 changes: 0 additions & 8 deletions lib/public/GroupInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,4 @@ public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0);
*/
public function isVisibleForScope($scope);

/**
* Returns whether the groups and memberships are to be maintained by core
* and sync mechanism to be used.
*
* @since 10.0.0
*/
public function isSyncMaintained();

}
1 change: 0 additions & 1 deletion tests/Core/Command/Group/SyncBackendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ protected function setUp() {
'addToGroup',
'removeFromGroup',
'isVisibleForScope',
'isSyncMaintained',
])
->getMock();
$this->userBackend1 = $this->getMockBuilder(UserInterface::class)
Expand Down
3 changes: 1 addition & 2 deletions tests/lib/Group/ManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ private function getTestBackend($implementedActions = null, $visibleForScopes =
'deleteGroup',
'addToGroup',
'removeFromGroup',
'isVisibleForScope',
'isSyncMaintained'
'isVisibleForScope'
])
->getMock();
$backend->expects($this->any())
Expand Down
1 change: 0 additions & 1 deletion tests/lib/Group/SyncServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public function setUp() {
'addToGroup',
'removeFromGroup',
'isVisibleForScope',
'isSyncMaintained',
])
->getMock();

Expand Down
3 changes: 0 additions & 3 deletions tests/lib/User/SessionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ protected function setUp() {
$this->groupSyncService = $this->createMock(\OC\Group\SyncService::class);

$groupBackend = $this->createMock(GroupInterface::class);
$groupBackend->expects($this->any())
->method('isSyncMaintained')
->willReturn(true);
$this->groupManager->expects($this->any())
->method('getBackends')
->willReturn([$groupBackend]);
Expand Down

0 comments on commit 707ac94

Please sign in to comment.