function gestioncompteAction() { $this->user = Zend_Auth::getInstance()->getIdentity(); $this->view->title = "Modifiez votre profil"; $utilisateur = new Utilisateur(); $uti = array(); $erreurs = array(); if ($this->_request->isPost()) { Zend_Loader::loadClass('Zend_Filter_StripTags'); $filter = new Zend_Filter_StripTags(); $id = $this->user->id_utilisateur; $uti['login'] = trim($filter->filter($this->_request->getPost('login'))); $uti['pass'] = trim($filter->filter($this->_request->getPost('pass'))); $uti['pass1'] = trim($filter->filter($this->_request->getPost('pass1'))); $uti['pass2'] = $filter->filter($this->_request->getPost('pass2')); $uti['mail'] = $filter->filter($this->_request->getPost('mail')); $uti['mail1'] = trim($filter->filter($this->_request->getPost('mail1'))); $uti['mail2'] = trim($filter->filter($this->_request->getPost('mail2'))); $pass = $this->user->pass_utilisateur; if (verifInfoUtilisateur($uti, $erreurs, $utilisateur, $pass)) { $id = $this->user->id_utilisateur; $data = array('login_utilisateur' => $this->user->login_utilisateur, 'pass_utilisauter' => md5($uti['pass1']), 'mail_utilisateur' => $uti['mail1']); $where = 'id_utilisateur = ' . $id; $utilisateur->update($data, $where); $this->_redirect('/'); return; } } $this->view->action = "gestioncompte"; $this->view->utilisateur = $utilisateur->createRow(); $this->view->erreurs = $erreurs; }
function inscriptionAction() { $this->view->title = "Inscription à Magic : The Awakening"; Zend_Loader::loadClass('Zend_View'); $utilisateur = new Utilisateur(); $view = new Zend_View(); $erreurs = array(); $uti = array(); if ($this->_request->isPost()) { Zend_Loader::loadClass('Zend_Filter_StripTags'); $filter = new Zend_Filter_StripTags(); $uti['login'] = trim($filter->filter($this->_request->getPost('login'))); $uti['pass1'] = trim($filter->filter($this->_request->getPost('pass1'))); $uti['pass2'] = trim($filter->filter($this->_request->getPost('pass2'))); $uti['mail1'] = $filter->filter($this->_request->getPost('mail1')); $uti['mail2'] = $filter->filter($this->_request->getPost('mail2')); if (verifInfoUtilisateur($uti, $erreurs, $utilisateur)) { $data = array('login_utilisateur' => $uti['login'], 'pass_utilisateur' => md5($uti['pass1']), 'mail_utilisateur' => $uti['mail1']); $utilisateur->insert($data); $this->_redirect('index/inscriptionsuccess'); return; } } $utilisateuradmin = new Utilisateur(); $this->view->utilisateuradmin = $utilisateuradmin; $this->view->erreurs = $erreurs; $this->view->utilisateur = $utilisateur->createRow(); $this->view->utiltmp = $uti; $this->view->action = 'inscription'; $this->view->buttonText = 'Valider'; }