/**
  * main action
  */
 public function mainAction()
 {
     /**
      * include node configuration
      */
     require_once 'models/common/common_node.php';
     $node_conf = common_node::initConfiguration();
     //$this->tpl->assign('NODE_CONF', $node_conf);
     /**
      * customer detail
      */
     require_once 'models/client/client_customer.php';
     $Customer = new client_customer();
     $Customer->setCacheable(false);
     if ($_POST['register']) {
         //check validation of submited fields
         if ($Customer->checkLoginId($_POST['client']['customer'])) {
             $_SESSION['r_client'] = $_POST['client'];
             $this->dispatchToRegistration($node_conf);
         } else {
             msg("User email {$_POST['client']['customer']['email']} is already registered", 'error', 0, 'account_exists');
             $this->tpl->assign('CLIENT', $_POST['client']);
         }
     }
     return true;
 }
 /**
  * main action
  */
 public function mainAction()
 {
     /**
      * include node configuration
      */
     require_once 'models/common/common_node.php';
     $node_conf = common_node::initConfiguration();
     /**
      * customer detail
      */
     require_once 'models/client/client_customer.php';
     $Customer = new client_customer();
     $Customer->setCacheable(false);
     if ($_POST['register'] || $_POST['login']) {
         //check validation of submited fields
         if ($Customer->checkLoginId($_POST['client']['customer'])) {
             $_SESSION['r_client'] = $_POST['client'];
             $this->dispatchToRegistration($node_conf);
         } else {
             $this->tpl->assign('CLIENT', $_POST['client']);
             $this->tpl->parse('content.login');
         }
     } else {
         $this->tpl->parse('content.form');
     }
     /**
      * check status
      */
     if ($_SESSION['client']['customer']['id'] > 0 && is_numeric($_SESSION['client']['customer']['id'])) {
         $this->actionAfterLogin();
     }
     return true;
 }