probleme Créer un module d'authentification avec inscription
Bonjour Mr,
SVP je veux Créer un module d'authentification avec inscription dont il est sur la page:
http://imikado.developpez.com/tutori...t-googleMaps/#
j'ai fais tous le etapes mais lors de m'inscrirt ds formulaire tjrs j'ai une erreur:
( ! ) Fatal error: Class 'row_member' not found in C:\wamp\www\mkframework_v4_129_0_r320\data\genere\projetBootstrap\module\auth\main.php on line 56
Call Stack
# Time Memory Function Location
1 0.0020 142368 {main}( ) ...\index.php:0
2 0.0070 287392 _root->run( ) ...\index.php:47
3 0.0230 436632 module_auth->_inscription( ) ...\class_root.php:263
mon main.php:
<?php
class module_auth extends abstract_module{
protected $sClassRow='row_member';
//longueur maximum du mot de passe
private $maxPasswordLength=100;
public function before(){
//on active l'authentification
_root::getAuth()->enable();
$this->oLayout=new _layout('bootstrap');
}
public function _login(){
$sMessage=$this->checkLoginPass();
$oView=new _view('auth::login');
$oView->sError=$sMessage;
$this->oLayout->add('main',$oView);
}
private function checkLoginPass(){
//si le formulaire n'est pas envoye on s'arrete la
if(!_root::getRequest()->isPost() ){
return null;
}
$sLogin=_root::getParam('login');
$sPassword=_root::getParam('password');
if(strlen($sPassword) > $this->maxPasswordLength){
return 'Mot de passe trop long';
}
//on stoque les mots de passe hashe dans la classe model_member
$sHashPassword=model_member::getInstance()->hashPassword($sPassword);
$tAccount=model_member::getInstance()->getListAccount();
//on va verifier que l'on trouve dans le tableau retourne par notre model
//l'entree $tAccount[ login ][ mot de passe hashe ]
if(!_root::getAuth()->checkLoginPass($tAccount,$sLogin,$sHashPassword)){
return 'Mauvais login/mot de passe';
}
_root::redirect('contacte::index');
}
public function _inscription(){
$tMessage=$this->processInscription();
$oView=new _view('auth::inscription');
$oView->tMessage=$tMessage;
$oView->oUser=new row_member;
$this->oLayout->add('main',$oView);
}
private function processInscription(){
if(!_root::getRequest()->isPost()){
return null;
}
$tAccount=model_member::getInstance()->getListAccount();
$sLogin=_root::getParam('memb_username');
$sPassword=_root::getParam('password');
if($sPassword!=_root::getParam('password2')){
return array('memb_username'=>array('Les deux mots de passe doivent etre identiques'));
}elseif($sLogin==''){
return array('memb_username'=>array('Vous devez remplir le nom d utilisateur'));
}elseif($sPassword==''){
return array('memb_username'=>array('Vous devez remplir le mot de passe'));
}elseif(strlen($sPassword) > $this->maxPasswordLength){
return array('memb_username'=>array('Mot de passe trop long'));
}elseif(isset($tAccount[$sLogin]) ){
return array('memb_username'=>array('Utilisateur déjà existant'));
}
$oMember=new row_member;
$oMember->memb_username=$sLogin;
$oMember->memb_password=model_member::getInstance()->hashPassword($sPassword);
if($oMember->save()==false){
return $oMember->getListError();
}
return array('success'=>array('Votre compte a bien été créé'));
}
public function _logout(){
_root::getAuth()->logout();
}
public function after(){
$this->oLayout->show();
}
}