diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2018-08-20 20:58:51 +0200 |
---|---|---|
committer | Igor Scheller <igor.scheller@igorshp.de> | 2018-08-20 21:07:57 +0200 |
commit | d6c8f1a61475fefa9594141aaf12a28d220bdaf8 (patch) | |
tree | 905051fdb1307f947c3a3a7be240609f8bc00e59 /includes/controller/users_controller.php | |
parent | bf6efe532c8f2de84e95b090911280a9b1b61ce8 (diff) | |
parent | 2f41b9e4418def9b69cf237312bc592364585025 (diff) |
Merge branch 'master' to 'rebuild-database'
Diffstat (limited to 'includes/controller/users_controller.php')
-rw-r--r-- | includes/controller/users_controller.php | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/includes/controller/users_controller.php b/includes/controller/users_controller.php index 8a325621..b6334803 100644 --- a/includes/controller/users_controller.php +++ b/includes/controller/users_controller.php @@ -190,7 +190,7 @@ function user_controller() $user_source = $user; if ($request->has('user_id')) { $user_source = User($request->input('user_id')); - if ($user_source == null) { + if (empty($user_source)) { error(_('User not found.')); redirect(page_link_to('/')); } @@ -220,12 +220,12 @@ function user_controller() ); } } - + if ($user_source['api_key'] == '') { User_reset_api_key($user_source, false); } - - if($user_source['force_active']) { + + if ($user_source['force_active']) { $tshirt_score = _('Enough'); } else { $tshirt_score = sprintf('%.2f', User_tshirt_score($user_source)) . ' h'; @@ -297,7 +297,7 @@ function user_password_recovery_set_new_controller() { $request = request(); $user_source = User_by_password_recovery_token($request->input('token')); - if ($user_source == null) { + if (empty($user_source)) { error(_('Token is not correct.')); redirect(page_link_to('login')); } @@ -343,7 +343,7 @@ function user_password_recovery_start_controller() $email = strip_request_item('email'); if (check_email($email)) { $user_source = User_by_email($email); - if ($user_source == null) { + if (empty($user_source)) { $valid = false; error(_('E-mail address is not correct.')); } @@ -412,8 +412,7 @@ function load_user() } $user = User($request->input('user_id')); - - if ($user == null) { + if (empty($user)) { error(_('User doesn\'t exist.')); redirect(page_link_to()); } |