purge users
This commit is contained in:
@@ -85,14 +85,12 @@ class PurgeUsers extends Command
|
|||||||
//If the fail bit is still false, then continue
|
//If the fail bit is still false, then continue
|
||||||
if($failed === false) {
|
if($failed === false) {
|
||||||
//Get the user's role
|
//Get the user's role
|
||||||
$role = UserRole::where(['character_id' => $user->character_id])->first();
|
$role = UserRole::where(['character_id'])->first();
|
||||||
|
|
||||||
//Check if the user is allowed to login
|
//Check if the user is allowed to login
|
||||||
if(isset($corp_info->alliance_id)) {
|
if(isset($corp_info->alliance_id)) {
|
||||||
//Warped Intentions is allowed to login as users
|
//Warped Intentions is allowed to login
|
||||||
//Legacy is allowed to login as users
|
if($corp_info->alliance_id == '99004116') {
|
||||||
//Renters are allowed to login as users
|
|
||||||
if($corp_info->alliance_id == '99004116' || in_array($corp_info->alliance_id, $legacy) || in_array($corp_info->alliance_id, $renter)) {
|
|
||||||
//If the role is not Warped Intentions, then modify the role
|
//If the role is not Warped Intentions, then modify the role
|
||||||
if($role != 'User') {
|
if($role != 'User') {
|
||||||
UserRole::where([
|
UserRole::where([
|
||||||
@@ -100,6 +98,40 @@ class PurgeUsers extends Command
|
|||||||
])->update([
|
])->update([
|
||||||
'role' => 'User',
|
'role' => 'User',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
User::where([
|
||||||
|
'character_id' => $user->character_id,
|
||||||
|
])->update([
|
||||||
|
'user_type' => 'W4RP',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
} else if(in_array($corp_info->alliance_id, $legacy)) { //Legacy Users
|
||||||
|
if($role != 'User') {
|
||||||
|
UserRole::where([
|
||||||
|
'character_id' => $user->character_id,
|
||||||
|
])->update([
|
||||||
|
'role' => 'User',
|
||||||
|
]);
|
||||||
|
|
||||||
|
User::where([
|
||||||
|
'character_id' => $user->character_id,
|
||||||
|
])->update([
|
||||||
|
'user_type' => 'Legacy',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
} else if(in_array($corp_info->alliance_id, $renter)) { //Renter Users
|
||||||
|
if($role != 'Renter') {
|
||||||
|
UserRole::where([
|
||||||
|
'character_id' => $user->character_id,
|
||||||
|
])->update([
|
||||||
|
'role' => 'Renter',
|
||||||
|
]);
|
||||||
|
|
||||||
|
User::where([
|
||||||
|
'character_id' => $user->character_id,
|
||||||
|
])->update([
|
||||||
|
'user_type' => 'Renter',
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//If the user is part of no valid login group, then delete the user.
|
//If the user is part of no valid login group, then delete the user.
|
||||||
|
|||||||
Reference in New Issue
Block a user