Пример #1
0
 function action()
 {
     $auth = owa_auth::get_instance();
     $status = $auth->authenticateUser();
     $go = owa_sanitize::cleanUrl($this->getParam('go'));
     // if authentication is successfull
     if ($status['auth_status'] == true) {
         if (!empty($go)) {
             // redirect to url if present
             $url = urldecode($go);
             $this->e->debug("redirecting browser to...:" . $url);
             owa_lib::redirectBrowser($url);
         } else {
             //else redirect to home page
             // these need to be unset as they were set previously by the doAction method.
             // need to refactor this out.
             $this->set('auth_status', '');
             $this->set('params', '');
             $this->set('site_id', '');
             $this->setRedirectAction($this->config['start_page']);
         }
     } else {
         // return login form with error msg
         $this->setView('base.loginForm');
         $this->set('go', $go);
         $this->set('error_code', 2002);
         $this->set('user_id', $this->getParam('user_id'));
     }
 }
Пример #2
0
 function construct($data)
 {
     $this->setTitle("Login");
     $this->t->set_template('wrapper_public.tpl');
     $this->body->set_template('login_form.tpl');
     $this->body->set('headline', 'Please login using the from below');
     $this->body->set('user_id', $this->get('user_id'));
     $this->body->set('go', owa_sanitize::cleanUrl($this->get('go')));
     $this->setJs("owa", "base/js/owa.js");
 }