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); $emailClean = clean_string($email, true);
$password = password_hash($password, PASSWORD_BCRYPT); $password = password_hash($password, PASSWORD_BCRYPT);
if (!$ranks) { // make sure the user is always in the primary rank
$ranks[] = config('rank.regular'); $ranks = array_unique(array_merge($ranks, [intval(config('rank.regular'))]));
}
$userId = DB::table('users') $userId = DB::table('users')
->insertGetId([ ->insertGetId([