MkFramework
 All Data Structures Functions
plugin_auth.php
1 <?php
2 /*
3 This file is part of Mkframework.
4 
5 Mkframework is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License.
8 
9 Mkframework is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
13 
14 You should have received a copy of the GNU Lesser General Public License
15 along with Mkframework. If not, see <http://www.gnu.org/licenses/>.
16 
17 */
23 class plugin_auth extends abstract_auth{
24 
25  private $oAccount=null;
26 
27  public function setAccount($oAccount){
28  $_SESSION['oAccount']=serialize($oAccount);
29  $this->oAccount=$oAccount;
30  }
31 
32  public function getAccount(){
33  return $this->oAccount;
34  }
35 
41  public function isConnected(){
42  if(!$this->_isConnected()){
43  return false;
44  }
45 
46  $this->setAccount(unserialize($_SESSION['oAccount']));
47 
48  //ajouter critere supp pour verification de l'authentification
49  return true;
50  }
59  public function checkLoginPass($tElements,$sLogin,$sPass){
60  return $this->verifLoginPass($tElements,$sLogin,$sPass);
61  }
70  public function verifLoginPass($tElements,$sLogin,$sPass){
71  if(isset($tElements[$sLogin][$sPass])){
72  $this->_connect();
73  $this->setAccount($tElements[$sLogin][$sPass]);
74 
75  return true;
76  }
77  return false;
78  }
79 
84  public function logout(){
85  $this->_disconnect();
86  _root::redirect('auth::login');
87  }
88 
89 }
verifLoginPass($tElements, $sLogin, $sPass)
Definition: plugin_auth.php:70
static redirect($uNav, $tParam=null)
Definition: class_root.php:727
checkLoginPass($tElements, $sLogin, $sPass)
Definition: plugin_auth.php:59