From 44ee5ec70cfac8860dc5c2af9cc5e7518b147d07 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Mon, 18 Jun 2018 22:55:41 +0200 Subject: [#1928] Login user automatically after creation (#1941) --- app/Controllers/userController.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'app/Controllers/userController.php') diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php index 47f0ecc62..75a4303d6 100644 --- a/app/Controllers/userController.php +++ b/app/Controllers/userController.php @@ -230,6 +230,17 @@ class FreshRSS_user_Controller extends Minz_ActionController { $_POST['new_user_passwordPlain'] = ''; invalidateHttpCache(); + // If the user has admin access, it means he's already logged in + // and we don't want to login with the new account. Otherwise, the + // user just created its account himself so he probably wants to + // get started immediately. + if ($ok && !FreshRSS_Auth::hasAccess('admin')) { + $user_conf = get_user_configuration($new_user_name); + Minz_Session::_param('currentUser', $new_user_name); + Minz_Session::_param('passwordHash', $user_conf->passwordHash); + FreshRSS_Auth::giveAccess(); + } + $notif = array( 'type' => $ok ? 'good' : 'bad', 'content' => _t('feedback.user.created' . (!$ok ? '.error' : ''), $new_user_name) -- cgit v1.2.3