Exemplo n.º 1
0
 function confirmorderAction()
 {
     if (!is_object($_SESSION['jCart'])) {
         //forward to somewhere
         echo "FORWARDED";
         $this->_helper->redirector('cartempty', 'store_payment', 'hol-site');
     }
     if (count($_SESSION['jCart']->items) == 0) {
         //forward to somewhere
         echo "SHOULD BE FORWARDED";
         $this->_helper->redirector('cartempty', 'store', 'hol-site');
     }
     $cart =& $_SESSION['jCart'];
     if (!is_object($cart)) {
         $cart = new jCart();
     }
     $this->view->cart = $cart;
     $data = array();
     foreach ($this->_request->getParams() as $key => $value) {
         $data[$key] = $value;
     }
     //$this->view->cart = $result;
     $this->view->data = $data;
     if ($data['method'] == 'postpaid') {
         $tblUserFinance = new Pandamp_Modules_Identity_UserFinance_Model_UserFinance();
         $userFinanceInfo = $tblUserFinance->find($this->_userId)->current();
         if (!$userFinanceInfo->isPostPaid) {
             echo 'Not Post Paid Customer';
             return $this->_helper->redirector('notpostpaid', 'store_payment', 'hol-site');
         }
     }
 }
Exemplo n.º 2
0
 private function _checkAuth()
 {
     $sReturn = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
     $sReturn = base64_encode($sReturn);
     $identity = Pandamp_Application::getResource('identity');
     $loginUrl = $identity->loginUrl;
     //$loginUrl = ROOT_URL.'/helper/synclogin/generate/?returnTo='.$sReturn;
     $auth = Zend_Auth::getInstance();
     $userId = $auth->getIdentity()->guid;
     if (!$auth->hasIdentity()) {
         //$this->_redirect($loginUrl);
         $this->_redirect($loginUrl . '?returnTo=' . $sReturn);
     } else {
         // [TODO] else: check if user has access to admin page
         $username = $auth->getIdentity()->username;
         $this->view->username = $username;
     }
     $tblUser = new Pandamp_Modules_Identity_User_Model_User();
     $this->_userDetailInfo = $tblUser->find($userId)->current();
     $tblUserFinance = new Pandamp_Modules_Identity_UserFinance_Model_UserFinance();
     $this->_userInfo = $tblUserFinance->find($userId)->current();
     if (empty($this->_userInfo)) {
         $finance = $tblUserFinance->fetchNew();
         $finance['userId'] = $userId;
         $finance->save();
         $this->_userInfo = $tblUserFinance->find($userId)->current();
     }
 }