debussy007 wrote:

I will opt for the easiest one, set the view variable in the AuthController.
I think the best solution is to pass the parameter to the IndexController
since it is not the role of the AuthController to render the view of the
IndexController, but the code gets dirty since those kind of operations
demand some if statements etc.

There are a few issues here
  1. Form validation
  2. Authentication
  3. Error handling

I use HTML_quickform for form validation i.e. name and password and
I use ErrorController.php for  errors
        if ($form->validate()) {
                $name = $form->getSubmitValue('txtUsername');
                $pass = $form->getSubmitValue('txtPass');

                if ($auth->authenticate($name, $pass))    {
                     $auth_log->info("Login Succeeded, Name = $name");
                     $pass_ns->passkey = get_pass_phrase();
                     $pass_ns->setExpirationSeconds(12*3600);
                     $this->_redirector =
$this->_helper->getHelper('Redirector'); $this->_redirector->gotoUrl('/admin'); }
            else {

                    $this->_redirector =
$this->_helper->getHelper('Redirector'); $this->_redirector->gotoUrl('/error/login');
                }


cheers,
pat


Reply via email to