Skip to content

Commit

Permalink
Fix user group isssue
Browse files Browse the repository at this point in the history
Closes #3363
  • Loading branch information
partydragen committed May 9, 2023
1 parent 2640314 commit 6cfd5ff
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/classes/Core/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Samerton
* @author Partydragen
* @author Aberdeener
* @version 2.0.2
* @version 2.1.1
* @license MIT
*/
class User {
Expand Down Expand Up @@ -130,7 +130,7 @@ private function find(string $value, string $field = 'id'): bool {
* @return bool True on success, false if they already have it.
*/
public function addGroup(int $group_id, int $expire = 0): bool {
if (array_key_exists($group_id, $this->_groups ?? [])) {
if (array_key_exists($group_id, $this->getGroups())) {
return false;
}

Expand Down Expand Up @@ -545,6 +545,7 @@ public function getGroups(): array {
$default_group = Group::find(1, 'default_group');
$default_group_id = $default_group->id ?? 1;

$this->_groups = [];
$this->addGroup($default_group_id);
}

Expand Down

0 comments on commit 6cfd5ff

Please sign in to comment.