<?php
class DoLogin extends HtmlResponse {

   function TemplateModule() {
   }

   function ProcessRequest() {
//		print_r($_REQUEST);exit;
      if (Security::Instance()->Login($_REQUEST['username'].'', $_REQUEST['password'].'', $_REQUEST['hashed'].'' == 1)) {
         // redirect to proper place
         $module = 'home';
         $submodule = 'home';
         $action = 'view';
         $type = 'html';
         $this->RedirectTo(Dispatcher::Instance()->GetUrl($module, $submodule, $action, $type));
         return;
      } else {
         $this->RedirectTo(Dispatcher::Instance()->GetUrl('login_default', 'login', 'view', 'html') . '&fail=1');
         return;
      }
      return NULL;
   }

   function ParseTemplate($data = NULL) {
   }
}
?>
