Skip to content

Commit

Permalink
allow update if there is no login and password set in the database
Browse files Browse the repository at this point in the history
  • Loading branch information
ildyria committed Nov 23, 2020
1 parent f711fc1 commit bb9e3a6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/Http/Controllers/UpdateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,15 @@ public function force(Request $request)
return redirect()->route('home');
}

if ($this->sessionFunctions->is_admin() || $this->sessionFunctions->log_as_admin($request['username'] ?? '', $request['password'] ?? '', $request->ip())) {
if (
$this->sessionFunctions->is_admin() || $this->sessionFunctions->noLogin() ||
$this->sessionFunctions->log_as_admin($request['username'] ?? '', $request['password'] ?? '', $request->ip())
) {
$output = [];
$this->applyUpdate->artisan($output);
$this->applyUpdate->filter($output);

return '<pre>' . implode('\n', $output) . '</pre>';
return '<pre>' . implode("\n", $output) . '</pre>';
} else {
return view('error.update', ['code' => '403', 'message' => 'Incorrect username or password']);
}
Expand Down

0 comments on commit bb9e3a6

Please sign in to comment.