Add function isLog for testing identity struct is fill
This commit is contained in:
parent
b4e285b30a
commit
97f456f286
@ -6,7 +6,22 @@ class Scores_Utilisateur
|
||||
public function __construct()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$this->identity = $auth->getIdentity();
|
||||
if ( $auth->hasIdentity() ) {
|
||||
$this->identity = $auth->getIdentity();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if user is log in
|
||||
* @return boolean
|
||||
*/
|
||||
public function isLog()
|
||||
{
|
||||
if ( $this->identity === null ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -195,7 +210,7 @@ class Scores_Utilisateur
|
||||
}
|
||||
return $hasPref;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retourne la langue par défaut du client
|
||||
*/
|
||||
@ -212,7 +227,7 @@ class Scores_Utilisateur
|
||||
{
|
||||
$this->identity->lang = $lang;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get browser information
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user