Ejemplo n.º 1
0
 /**
  * Retourne la dernière connexion valide
  *
  * @return un objet Secure ou un accès @ALL [public]
  */
 public static function getConnect()
 {
     //-- retourne un accès authentifié si existe
     //-- on contrôle le token, ip  et agent
     $token = new Token();
     self::$_getconnect_ok = false;
     //authentifie l'accès getConnect()
     if (isset($_SESSION[self::getIdSecure()]) && $token->isOkTokenIpAgent()) {
         self::$_getconnect_ok = true;
         //authentifie l'accès getConnect()
         return new Secure($token);
     }
     //Authentification anonyme instanciée @ALL
     self::$_getconnect_ok = true;
     return Secure::connect("ALL", "ALL");
 }