mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-19 07:53:14 +00:00
Add a get_last_connection method
This commit is contained in:
@@ -1180,6 +1180,23 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
|||||||
return $this->geonameid;
|
return $this->geonameid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function get_last_connection()
|
||||||
|
{
|
||||||
|
$sql = 'SELECT last_conn FROM usr WHERE usr_id = :usr_id';
|
||||||
|
|
||||||
|
$stmt = $this->appbox->get_connection()->prepare($sql);
|
||||||
|
|
||||||
|
$stmt->execute(array(':usr_id' => $this->get_id()));
|
||||||
|
|
||||||
|
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
$stmt->closeCursor();
|
||||||
|
|
||||||
|
$date_obj = new DateTime($row['last_conn']);
|
||||||
|
|
||||||
|
return $date_obj;
|
||||||
|
}
|
||||||
|
|
||||||
public function get_applied_template()
|
public function get_applied_template()
|
||||||
{
|
{
|
||||||
$template = '';
|
$template = '';
|
||||||
@@ -1214,7 +1231,6 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
|||||||
protected function load_preferences()
|
protected function load_preferences()
|
||||||
{
|
{
|
||||||
if ($this->_prefs)
|
if ($this->_prefs)
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
$sql = 'SELECT prop, value FROM usr_settings WHERE usr_id= :id';
|
$sql = 'SELECT prop, value FROM usr_settings WHERE usr_id= :id';
|
||||||
$stmt = $this->appbox->get_connection()->prepare($sql);
|
$stmt = $this->appbox->get_connection()->prepare($sql);
|
||||||
@@ -1459,7 +1475,6 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
|||||||
{
|
{
|
||||||
$this->load_preferences();
|
$this->load_preferences();
|
||||||
if (isset($this->_prefs[$prop]) && $this->_prefs[$prop] === $value)
|
if (isset($this->_prefs[$prop]) && $this->_prefs[$prop] === $value)
|
||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
|
|
||||||
$ok = true;
|
$ok = true;
|
||||||
@@ -1497,7 +1512,6 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
|||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance();
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
if (!$session->is_authenticated())
|
if (!$session->is_authenticated())
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$ses_id = $session->get_ses_id();
|
$ses_id = $session->get_ses_id();
|
||||||
@@ -1773,7 +1787,6 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
|||||||
public function get_nonce()
|
public function get_nonce()
|
||||||
{
|
{
|
||||||
if ($this->nonce)
|
if ($this->nonce)
|
||||||
|
|
||||||
return $this->nonce;
|
return $this->nonce;
|
||||||
$nonce = false;
|
$nonce = false;
|
||||||
|
|
||||||
@@ -1791,7 +1804,6 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
|||||||
return $this->nonce;
|
return $this->nonce;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function __sleep()
|
public function __sleep()
|
||||||
{
|
{
|
||||||
$vars = array();
|
$vars = array();
|
||||||
|
Reference in New Issue
Block a user