Skip to content

Commit

Permalink
fix: display cron/version warnings only to admins
Browse files Browse the repository at this point in the history
  • Loading branch information
blt950 committed Oct 4, 2023
1 parent d00f3e8 commit 3a01859
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ public function index()

$studentTrainings = \Auth::user()->mentoringTrainings();

$cronJobError = ((App::environment('production')) && (\Carbon\Carbon::parse(Setting::get('_lastCronRun', '2000-01-01')) <= \Carbon\Carbon::now()->subMinutes(5)));
$cronJobError = (($user->isAdmin() && App::environment('production')) && (\Carbon\Carbon::parse(Setting::get('_lastCronRun', '2000-01-01')) <= \Carbon\Carbon::now()->subMinutes(5)));

$oudatedVersionWarning = Setting::get('_updateAvailable');
$oudatedVersionWarning = $user->isAdmin() && Setting::get('_updateAvailable');

return view('dashboard', compact('data', 'trainings', 'statuses', 'types', 'dueInterestRequest', 'atcInactiveMessage', 'completedTrainingMessage', 'activeVote', 'atcHours', 'workmailRenewal', 'studentTrainings', 'cronJobError', 'oudatedVersionWarning'));
}
Expand Down
2 changes: 1 addition & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
|
*/

'version' => '4.2.1',
'version' => '4.2.2',

/*
|--------------------------------------------------------------------------
Expand Down

0 comments on commit 3a01859

Please sign in to comment.