Esempio n. 1
0
 function redirectSubscriptionUrlAction()
 {
     $this->_helper->layout()->disableLayout();
     $guid = $this->_getParam('guid') ? $this->_getParam('guid') : '';
     $tblUser = new Pandamp_Modules_Identity_User_Model_User();
     $rowset = $tblUser->find($guid)->current();
     $this->view->rowUser = $rowset;
     $modelUserFinance = new Pandamp_Modules_Identity_UserFinance_Model_UserFinance();
     $userFinanceInfo = $modelUserFinance->fetchRow("userId='" . $guid . "'");
     if (!$userFinanceInfo) {
         $finance = $modelUserFinance->fetchNew();
         $finance->userId = $guid;
         $finance->taxNumber = '';
         $finance->taxCompany = $userDetailInfo->company;
         $finance->taxAddress = $userDetailInfo->address;
         $finance->taxCity = $userDetailInfo->city;
         $finance->taxProvince = $userDetailInfo->state;
         $finance->taxCountryId = $userDetailInfo->countryId;
         $finance->taxZip = $userDetailInfo->zip;
         $finance->save();
     }
     $userFinanceInfo = $modelUserFinance->fetchRow("userId='" . $guid . "'");
     $this->view->userInfo = $userFinanceInfo;
 }
Esempio n. 2
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');
         }
     }
 }
Esempio n. 3
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();
     }
 }