aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/userController.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2018-09-09 13:03:51 +0200
committerGravatar GitHub <noreply@github.com> 2018-09-09 13:03:51 +0200
commit44bd07e506ade204151c276fdc05994d51efdd7a (patch)
tree2efe48133d2c874c65a99ae3a6cd92bb0dff4fe8 /app/Controllers/userController.php
parent3306a1679c2570c30d4b662c887b4a71ce147398 (diff)
parent1802c1e9ae7d3d55a0e37e1cc2e7c0acc25f70ba (diff)
Merge pull request #2001 from FreshRSS/dev1.11.2
FreshRSS 1.11.2
Diffstat (limited to 'app/Controllers/userController.php')
-rw-r--r--app/Controllers/userController.php11
1 files changed, 11 insertions, 0 deletions
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)