mirror of
https://github.com/netzbegruenung/user_saml.git
synced 2024-05-02 17:14:53 +02:00
Add SAML prefix to migration
Signed-off-by: Giuliano Mele <giuliano.mele@verdigado.com>
This commit is contained in:
parent
a40e812512
commit
e380b24720
|
@ -111,8 +111,16 @@ class MigrateGroups extends QueuedJob {
|
|||
if($affected === 0) {
|
||||
throw new \RuntimeException('Could not delete group from local backend');
|
||||
}
|
||||
|
||||
if(!$this->ownGroupBackend->createGroup($gid)) {
|
||||
$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)) {
|
||||
throw new \RuntimeException('Could not create group in SAML backend');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue