summaryrefslogtreecommitdiff
path: root/app/Model/User.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-11-15 12:50:33 -0500
committerFrederic Guillot <fred@kanboard.net>2015-11-15 12:50:33 -0500
commita675271ad71b7713d1b33bdba3c51b2b04813229 (patch)
treee54d8a95e16ca521193b9fd5a5eb071aa2910823 /app/Model/User.php
parent2fc402f6733573627ad25394d109b9f848ef04f6 (diff)
Rewrite of session management
Diffstat (limited to 'app/Model/User.php')
-rw-r--r--app/Model/User.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/Model/User.php b/app/Model/User.php
index dc00c0c5..88361ce8 100644
--- a/app/Model/User.php
+++ b/app/Model/User.php
@@ -5,7 +5,7 @@ namespace Kanboard\Model;
use PicoDb\Database;
use SimpleValidator\Validator;
use SimpleValidator\Validators;
-use Kanboard\Core\Session;
+use Kanboard\Core\Session\SessionManager;
use Kanboard\Core\Security\Token;
/**
@@ -320,8 +320,8 @@ class User extends Base
$result = $this->db->table(self::TABLE)->eq('id', $values['id'])->update($values);
// If the user is connected refresh his session
- if (Session::isOpen() && $this->userSession->getId() == $values['id']) {
- $this->userSession->refresh();
+ if (SessionManager::isOpen() && $this->userSession->getId() == $values['id']) {
+ $this->userSession->initialize($this->getById($this->userSession->getId()));
}
return $result;
@@ -587,7 +587,7 @@ class User extends Base
if ($v->execute()) {
// Check password
- if ($this->authentication->authenticate($this->session['user']['username'], $values['current_password'])) {
+ if ($this->authentication->authenticate($this->userSession->getUsername(), $values['current_password'])) {
return array(true, array());
} else {
return array(false, array('current_password' => array(t('Wrong password'))));