summaryrefslogtreecommitdiff
path: root/includes/controller/user_driver_licenses_controller.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-10-08 21:15:56 +0200
committermsquare <msquare@notrademark.de>2018-10-31 13:43:23 +0100
commit2dcb7cc2de448c664bbc9a7112f9cb13dc15c516 (patch)
treee409cf77e97c91ff27b0e61f2a982519fdfdf76f /includes/controller/user_driver_licenses_controller.php
parentd15946df2dfb0ae2f0ca9371e5c8071df91ab45a (diff)
Replaced some global `$user` variables
Diffstat (limited to 'includes/controller/user_driver_licenses_controller.php')
-rw-r--r--includes/controller/user_driver_licenses_controller.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/includes/controller/user_driver_licenses_controller.php b/includes/controller/user_driver_licenses_controller.php
index 6621866d..422ad382 100644
--- a/includes/controller/user_driver_licenses_controller.php
+++ b/includes/controller/user_driver_licenses_controller.php
@@ -37,9 +37,9 @@ function user_driver_license_required_hint()
*/
function user_driver_licenses_controller()
{
- global $user;
+ $user = Auth()->user();
- if (!isset($user)) {
+ if (!$user) {
redirect(page_link_to(''));
}
@@ -94,12 +94,13 @@ function user_driver_license_load_user()
*/
function user_driver_license_edit_controller()
{
- global $privileges, $user;
+ global $privileges;
+ $user = Auth()->user();
$request = request();
$user_source = user_driver_license_load_user();
// only privilege admin_user can edit other users driver license information
- if ($user['UID'] != $user_source['UID'] && !in_array('admin_user', $privileges)) {
+ if ($user->id != $user_source['UID'] && !in_array('admin_user', $privileges)) {
redirect(user_driver_license_edit_link());
}