make sure user is always in primary rank

This commit is contained in:
flash 2016-12-08 21:21:35 +01:00
parent e5197f4092
commit 0a4b9de9d7

View file

@ -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([