diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2018-10-08 21:15:56 +0200 |
---|---|---|
committer | msquare <msquare@notrademark.de> | 2018-10-31 13:43:23 +0100 |
commit | 2dcb7cc2de448c664bbc9a7112f9cb13dc15c516 (patch) | |
tree | e409cf77e97c91ff27b0e61f2a982519fdfdf76f /includes/pages/user_questions.php | |
parent | d15946df2dfb0ae2f0ca9371e5c8071df91ab45a (diff) |
Replaced some global `$user` variables
Diffstat (limited to 'includes/pages/user_questions.php')
-rw-r--r-- | includes/pages/user_questions.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/includes/pages/user_questions.php b/includes/pages/user_questions.php index ea255a3d..94922141 100644 --- a/includes/pages/user_questions.php +++ b/includes/pages/user_questions.php @@ -15,18 +15,18 @@ function questions_title() */ function user_questions() { - global $user; + $user = Auth()->user(); $request = request(); if (!$request->has('action')) { $open_questions = DB::select( 'SELECT * FROM `Questions` WHERE `AID` IS NULL AND `UID`=?', - [$user['UID']] + [$user->id] ); $answered_questions = DB::select( 'SELECT * FROM `Questions` WHERE NOT `AID` IS NULL AND `UID`=?', - [$user['UID']] + [$user->id] ); foreach ($answered_questions as &$question) { $answer_user_source = User($question['AID']); @@ -47,7 +47,7 @@ function user_questions() INSERT INTO `Questions` (`UID`, `Question`) VALUES (?, ?) ', - [$user['UID'], $question] + [$user->id, $question] ); success(__('You question was saved.')); @@ -69,7 +69,7 @@ function user_questions() 'SELECT `UID` FROM `Questions` WHERE `QID`=? LIMIT 1', [$question_id] ); - if (!empty($question) && $question['UID'] == $user['UID']) { + if (!empty($question) && $question['UID'] == $user->id) { DB::delete( 'DELETE FROM `Questions` WHERE `QID`=? LIMIT 1', [$question_id] |