mirror of
https://github.com/netzbegruenung/user_saml.git
synced 2024-05-02 17:14:53 +02:00
Revert "Append SAML_ prefix to groups"
This reverts commit 48f331ff32
.
Signed-off-by: Giuliano Mele <giuliano.mele@verdigado.com>
This commit is contained in:
parent
e380b24720
commit
1b6cd24a21
|
@ -50,13 +50,8 @@ class GroupBackend extends ABackend implements IAddToGroupBackend, ICountUsersBa
|
|||
|
||||
$groups = [];
|
||||
while( $row = $cursor->fetch()) {
|
||||
if (strlen($row['gid']) < 6 || substr($row['gid'], 0, 5) !== 'SAML_') {
|
||||
$groups[] = 'SAML_' . $row['gid'];
|
||||
$this->groupCache[$row['gid']] = 'SAML_' . $row['gid'];
|
||||
} else {
|
||||
$groups[] = $row['gid'];
|
||||
$this->groupCache[$row['gid']] = $row['gid'];
|
||||
}
|
||||
$groups[] = $row['gid'];
|
||||
$this->groupCache[$row['gid']] = $row['gid'];
|
||||
}
|
||||
$cursor->closeCursor();
|
||||
|
||||
|
|
|
@ -111,16 +111,8 @@ class MigrateGroups extends QueuedJob {
|
|||
if($affected === 0) {
|
||||
throw new \RuntimeException('Could not delete group from local backend');
|
||||
}
|
||||
$samlGid = $gid;
|
||||
if (strlen($gid) < 6 || substr($gid, 0, 5) !== 'SAML_') {
|
||||
$samlGid = 'SAML_'.$gid;
|
||||
$query = $this->dbc->getQueryBuilder();
|
||||
$query->update(GroupBackend::TABLE_MEMBERS)
|
||||
->set('gid', $query->createNamedParameter($samlGid))
|
||||
->where($query->expr()->eq('gid', $query->createNamedParameter($gid)))
|
||||
->execute();
|
||||
}
|
||||
if(!$this->ownGroupBackend->createGroup($samlGid, $gid)) {
|
||||
|
||||
if(!$this->ownGroupBackend->createGroup($gid)) {
|
||||
throw new \RuntimeException('Could not create group in SAML backend');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue