From 0a4b9de9d721517e45ffd3bcf7c25a5cd2eb19e8 Mon Sep 17 00:00:00 2001 From: flashwave Date: Thu, 8 Dec 2016 21:21:35 +0100 Subject: [PATCH] make sure user is always in primary rank --- app/User.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/User.php b/app/User.php index e293673..fdfe096 100644 --- a/app/User.php +++ b/app/User.php @@ -295,9 +295,8 @@ class User $emailClean = clean_string($email, true); $password = password_hash($password, PASSWORD_BCRYPT); - if (!$ranks) { - $ranks[] = config('rank.regular'); - } + // make sure the user is always in the primary rank + $ranks = array_unique(array_merge($ranks, [intval(config('rank.regular'))])); $userId = DB::table('users') ->insertGetId([