summaryrefslogtreecommitdiff
path: root/app/Controllers
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2017-04-11 17:31:07 +0200
committerGravatar GitHub <noreply@github.com> 2017-04-11 17:31:07 +0200
commitaa75cebbfe3dd2a6f8d8c9f3dfe72091e8381376 (patch)
treecc0907d84ec5ad72baed8e0fb6fe7d81176bbb3c /app/Controllers
parente849de7296efbece490447cdceeed9726f10b33c (diff)
parent510045b3c554261a0a6434bfe73adac32b12cc81 (diff)
Merge pull request #1493 from Alkarex/multiuser-token
Multi-user token
Diffstat (limited to 'app/Controllers')
-rw-r--r--app/Controllers/authController.php9
-rw-r--r--app/Controllers/userController.php4
2 files changed, 6 insertions, 7 deletions
diff --git a/app/Controllers/authController.php b/app/Controllers/authController.php
index 1398e4e49..5ad1a51d9 100644
--- a/app/Controllers/authController.php
+++ b/app/Controllers/authController.php
@@ -27,11 +27,6 @@ class FreshRSS_auth_Controller extends Minz_ActionController {
if (Minz_Request::isPost()) {
$ok = true;
- $current_token = FreshRSS_Context::$user_conf->token;
- $token = Minz_Request::param('token', $current_token);
- FreshRSS_Context::$user_conf->token = $token;
- $ok &= FreshRSS_Context::$user_conf->save();
-
$anon = Minz_Request::param('anon_access', false);
$anon = ((bool)$anon) && ($anon !== 'no');
$anon_refresh = Minz_Request::param('anon_refresh', false);
@@ -123,7 +118,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController {
$challenge = Minz_Request::param('challenge', '');
$conf = get_user_configuration($username);
- if (is_null($conf)) {
+ if ($conf == null) {
Minz_Error::error(403, array(_t('feedback.auth.login.invalid')), false);
return;
}
@@ -164,7 +159,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController {
}
$conf = get_user_configuration($username);
- if (is_null($conf)) {
+ if ($conf == null) {
return;
}
diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php
index ddc0c6fe4..ed30eb69f 100644
--- a/app/Controllers/userController.php
+++ b/app/Controllers/userController.php
@@ -74,6 +74,10 @@ class FreshRSS_user_Controller extends Minz_ActionController {
FreshRSS_Context::$user_conf->apiPasswordHash = $passwordHash;
}
+ $current_token = FreshRSS_Context::$user_conf->token;
+ $token = Minz_Request::param('token', $current_token);
+ FreshRSS_Context::$user_conf->token = $token;
+
$ok &= FreshRSS_Context::$user_conf->save();
if ($ok) {