From f57acecbae89a2782acf6f6b539025385c198366 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sat, 4 Sep 2021 10:58:07 +0200 Subject: 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. --- includes/concert.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'includes/concert.php') 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); + } } } ?> -- cgit v1.2.3