Replaced `Auth()` with `auth()`

This commit is contained in:
Igor Scheller 2018-10-31 12:48:22 +01:00 committed by msquare
parent 82b22160fd
commit 88f3bafa5e
18 changed files with 21 additions and 21 deletions

View File

@ -334,7 +334,7 @@ function shift_entry_load()
*/ */
function shift_entry_delete_controller() function shift_entry_delete_controller()
{ {
$user = Auth()->user(); $user = auth()->user();
$request = request(); $request = request();
$shiftEntry = shift_entry_load(); $shiftEntry = shift_entry_load();

View File

@ -39,7 +39,7 @@ function user_driver_license_required_hint()
*/ */
function user_driver_licenses_controller() function user_driver_licenses_controller()
{ {
$user = Auth()->user(); $user = auth()->user();
if (!$user) { if (!$user) {
redirect(page_link_to('')); redirect(page_link_to(''));
@ -97,7 +97,7 @@ function user_driver_license_load_user()
function user_driver_license_edit_controller() function user_driver_license_edit_controller()
{ {
global $privileges; global $privileges;
$user = Auth()->user(); $user = auth()->user();
$request = request(); $request = request();
$user_source = user_driver_license_load_user(); $user_source = user_driver_license_load_user();

View File

@ -14,7 +14,7 @@ use Engelsystem\ShiftsFilter;
*/ */
function users_controller() function users_controller()
{ {
$user = Auth()->user(); $user = auth()->user();
$request = request(); $request = request();
if (!$user) { if (!$user) {

View File

@ -12,7 +12,7 @@ use Engelsystem\Models\User\User;
*/ */
function engelsystem_email_to_user($recipientUser, $title, $message, $notIfItsMe = false) function engelsystem_email_to_user($recipientUser, $title, $message, $notIfItsMe = false)
{ {
if ($notIfItsMe && Auth()->user()->id == $recipientUser->id) { if ($notIfItsMe && auth()->user()->id == $recipientUser->id) {
return true; return true;
} }

View File

@ -35,7 +35,7 @@ function Message($message_id)
*/ */
function Message_send($receiver_user_id, $text) function Message_send($receiver_user_id, $text)
{ {
$user = Auth()->user(); $user = auth()->user();
$text = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($text)); $text = preg_replace("/([^\p{L}\p{P}\p{Z}\p{N}\n]{1,})/ui", '', strip_tags($text));
$receiver_user_id = preg_replace('/([^\d]{1,})/ui', '', strip_tags($receiver_user_id)); $receiver_user_id = preg_replace('/([^\d]{1,})/ui', '', strip_tags($receiver_user_id));

View File

@ -519,7 +519,7 @@ function Shift_delete($shift_id)
*/ */
function Shift_update($shift) function Shift_update($shift)
{ {
$user = Auth()->user(); $user = auth()->user();
$shift['name'] = ShiftType($shift['shifttype_id'])['name']; $shift['name'] = ShiftType($shift['shifttype_id'])['name'];
mail_shift_change(Shift($shift['SID']), $shift); mail_shift_change(Shift($shift['SID']), $shift);

View File

@ -94,7 +94,7 @@ function UserWorkLog_update($userWorkLog)
*/ */
function UserWorkLog_create($userWorkLog) function UserWorkLog_create($userWorkLog)
{ {
$user = Auth()->user(); $user = auth()->user();
$user_source = User::find($userWorkLog['user_id']); $user_source = User::find($userWorkLog['user_id']);

View File

@ -14,7 +14,7 @@ function admin_import_title()
function admin_import() function admin_import()
{ {
global $rooms_import; global $rooms_import;
$user = Auth()->user(); $user = auth()->user();
$html = ''; $html = '';
$import_dir = __DIR__ . '/../../import'; $import_dir = __DIR__ . '/../../import';
$request = request(); $request = request();

View File

@ -9,7 +9,7 @@ use Engelsystem\Models\User\User;
function admin_news() function admin_news()
{ {
global $privileges; global $privileges;
$user = Auth()->user(); $user = auth()->user();
$request = request(); $request = request();
if (!$request->has('action')) { if (!$request->has('action')) {

View File

@ -40,7 +40,7 @@ function admin_new_questions()
*/ */
function admin_questions() function admin_questions()
{ {
$user = Auth()->user(); $user = auth()->user();
$request = request(); $request = request();
if (!$request->has('action')) { if (!$request->has('action')) {

View File

@ -17,7 +17,7 @@ function admin_user_title()
function admin_user() function admin_user()
{ {
global $privileges; global $privileges;
$user = Auth()->user(); $user = auth()->user();
$tshirt_sizes = config('tshirt_sizes'); $tshirt_sizes = config('tshirt_sizes');
$request = request(); $request = request();
$html = ''; $html = '';

View File

@ -40,7 +40,7 @@ function logout_title()
function guest_register() function guest_register()
{ {
global $privileges; global $privileges;
$authUser = Auth()->user(); $authUser = auth()->user();
$tshirt_sizes = config('tshirt_sizes'); $tshirt_sizes = config('tshirt_sizes');
$enable_tshirt_size = config('enable_tshirt_size'); $enable_tshirt_size = config('enable_tshirt_size');
$min_password_length = config('min_password_length'); $min_password_length = config('min_password_length');

View File

@ -16,7 +16,7 @@ function messages_title()
*/ */
function user_unread_messages() function user_unread_messages()
{ {
$user = Auth()->user(); $user = auth()->user();
if ($user) { if ($user) {
$new_messages = count(DB::select( $new_messages = count(DB::select(

View File

@ -131,7 +131,7 @@ function display_news($news)
*/ */
function user_news_comments() function user_news_comments()
{ {
$user = Auth()->user(); $user = auth()->user();
$request = request(); $request = request();
$html = '<div class="col-md-12"><h1>' . user_news_comments_title() . '</h1>'; $html = '<div class="col-md-12"><h1>' . user_news_comments_title() . '</h1>';
@ -199,7 +199,7 @@ function user_news_comments()
function user_news() function user_news()
{ {
global $privileges; global $privileges;
$user = Auth()->user(); $user = auth()->user();
$display_news = config('display_news'); $display_news = config('display_news');
$request = request(); $request = request();

View File

@ -16,7 +16,7 @@ function questions_title()
*/ */
function user_questions() function user_questions()
{ {
$user = Auth()->user(); $user = auth()->user();
$request = request(); $request = request();
if (!$request->has('action')) { if (!$request->has('action')) {

View File

@ -128,7 +128,7 @@ function load_days()
*/ */
function load_types() function load_types()
{ {
$user = Auth()->user(); $user = auth()->user();
if (!count(DB::select('SELECT `id`, `name` FROM `AngelTypes` WHERE `restricted` = 0'))) { if (!count(DB::select('SELECT `id`, `name` FROM `AngelTypes` WHERE `restricted` = 0'))) {
error(__('The administration has not configured any angeltypes yet - or you are not subscribed to any angeltype.')); error(__('The administration has not configured any angeltypes yet - or you are not subscribed to any angeltype.'));
@ -284,7 +284,7 @@ function view_user_shifts()
*/ */
function ical_hint() function ical_hint()
{ {
$user = Auth()->user(); $user = auth()->user();
return heading(__('iCal export'), 2) return heading(__('iCal export'), 2)
. '<p>' . sprintf( . '<p>' . sprintf(

View File

@ -20,7 +20,7 @@ function page_link_to($page = '', $parameters = [])
*/ */
function header_render_hints() function header_render_hints()
{ {
$user = Auth()->user(); $user = auth()->user();
$hints_renderer = new UserHintsRenderer(); $hints_renderer = new UserHintsRenderer();

View File

@ -12,7 +12,7 @@ use Engelsystem\ShiftsFilterRenderer;
*/ */
function Room_view($room, ShiftsFilterRenderer $shiftsFilterRenderer, ShiftCalendarRenderer $shiftCalendarRenderer) function Room_view($room, ShiftsFilterRenderer $shiftsFilterRenderer, ShiftCalendarRenderer $shiftCalendarRenderer)
{ {
$user = Auth()->user(); $user = auth()->user();
$assignNotice = ''; $assignNotice = '';
if (config('signup_requires_arrival') && !$user->state->arrived) { if (config('signup_requires_arrival') && !$user->state->arrived) {