summaryrefslogtreecommitdiffstats
path: root/includes/concert.php
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2021-09-04 10:58:07 +0200
committerHarald Eilertsen <haraldei@anduin.net>2021-09-04 10:58:07 +0200
commitf57acecbae89a2782acf6f6b539025385c198366 (patch)
tree3ef5130f4229d248d55e44aa0caa8bb1ab1dc6cd /includes/concert.php
parent4f7cfd164d8200d586334fdc5d6eada2a219565e (diff)
downloadgigologadmin-f57acecbae89a2782acf6f6b539025385c198366.tar.gz
gigologadmin-f57acecbae89a2782acf6f6b539025385c198366.tar.bz2
gigologadmin-f57acecbae89a2782acf6f6b539025385c198366.zip
Make click to unassign from concert work again.
As a user can only be assigned to one role at the time, we remove the current user from any role that they may have when clearing the assignment.
Diffstat (limited to 'includes/concert.php')
-rw-r--r--includes/concert.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/includes/concert.php b/includes/concert.php
index f0c69c8..dce15f0 100644
--- a/includes/concert.php
+++ b/includes/concert.php
@@ -299,6 +299,11 @@ if ( !class_exists('GiglogAdmin_Concert') ) {
{
$this->roles[$role] = $username;
}
+
+ public function remove_user_from_roles( string $username ) : void
+ {
+ $this->roles = array_filter($this->roles, fn($u) => $u != $username);
+ }
}
}
?>