public function indexAction() { $login = $this->_request->getPost('login'); if ($this->_request->isPost() == true) { $user = $this->_request->getPost('username'); $pass = md5($this->_request->getPost('passwd')); $tbluser = new Manager_Model_checkuser(); $row = $tbluser->check($user, $pass); if (count($row) > 0) { $ns = new Zend_Session_Namespace('login'); $ns->user = $user; $ns->id = $row[0]['id']; $this->_redirect('manager/index/controlpanel'); } else { $this->view->error = "Username and password do not match"; } } }
public function indexAction() { if ($this->_request->isPost() == true) { $user = $this->_request->getPost('username'); $pass = md5($this->_request->getPost('passwd')); $tbluser = new Manager_Model_checkuser(); $row = $tbluser->check($user, $pass); if (count($row) > 0) { $ns = new Zend_Session_Namespace('login'); $ns->user = $user; $ns->id = $row[0]['id']; $this->_redirect('index'); } else { $this->_redirect('index/login'); } } $ns = new Zend_Session_Namespace('login'); if (isset($ns->id) == false) { $this->_redirect('index/login'); } }