Formatting

This commit is contained in:
Nabeel Shahzad 2019-05-12 18:05:36 -05:00
parent dbd7c5e90b
commit 2ca1f33e68
4 changed files with 32 additions and 13 deletions

View File

@ -683,14 +683,22 @@ class Importer
// Decide which state they will be in accordance with v7
if ($state === $phpvms_classic_states['ACTIVE']) {
return UserState::ACTIVE;
} elseif ($state === $phpvms_classic_states['INACTIVE']) {
}
if ($state === $phpvms_classic_states['INACTIVE']) {
// TODO: Make an inactive state?
return UserState::REJECTED;
} elseif ($state === $phpvms_classic_states['BANNED']) {
}
if ($state === $phpvms_classic_states['BANNED']) {
return UserState::SUSPENDED;
} elseif ($state === $phpvms_classic_states['ON_LEAVE']) {
}
if ($state === $phpvms_classic_states['ON_LEAVE']) {
return UserState::ON_LEAVE;
}
$this->error('Unknown status: '.$state);
return UserState::ACTIVE;
}
}

View File

@ -59,9 +59,13 @@ class LoginController extends Controller
// Redirect to one of the error pages
if ($user->state === UserState::PENDING) {
return view('auth.pending');
} elseif ($user->state === UserState::REJECTED) {
}
if ($user->state === UserState::REJECTED) {
return view('auth.rejected');
} elseif ($user->state === UserState::SUSPENDED) {
}
if ($user->state === UserState::SUSPENDED) {
return view('auth.suspended');
}
}

View File

@ -113,7 +113,9 @@ class GeoService extends Service
if ($size === 0) {
continue;
} elseif ($size === 1) {
}
if ($size === 1) {
$point = $points[0];
Log::debug('name: '.$point->id.' - '.$point->lat.'x'.$point->lon);
$coords[] = $point;

View File

@ -276,23 +276,28 @@ class PirepService extends Service
if ($pirep->state === PirepState::PENDING) {
if ($new_state === PirepState::ACCEPTED) {
return $this->accept($pirep);
} elseif ($new_state === PirepState::REJECTED) {
}
if ($new_state === PirepState::REJECTED) {
return $this->reject($pirep);
}
return $pirep;
} /*
}
/*
* Move from a ACCEPTED to REJECTED status
*/
elseif ($pirep->state === PirepState::ACCEPTED) {
if ($pirep->state === PirepState::ACCEPTED) {
$pirep = $this->reject($pirep);
return $pirep;
} /*
}
/*
* Move from REJECTED to ACCEPTED
*/
elseif ($pirep->state === PirepState::REJECTED) {
if ($pirep->state === PirepState::REJECTED) {
$pirep = $this->accept($pirep);
return $pirep;
}