Ejemplo n.º 1
0
 public function checkoutAction()
 {
     $auth = Zend_Auth::getInstance();
     $userId = $auth->getIdentity()->guid;
     $tblUser = new Kutu_Core_Orm_Table_User();
     $userDetailInfo = $tblUser->find($userId)->current();
     $tblUserFinance = new Kutu_Core_Orm_Table_UserFinance();
     $userFinanceInfo = $tblUserFinance->find($userId)->current();
     if (empty($userFinanceInfo)) {
         $finance = $tblUserFinance->fetchNew();
         $finance->userId = $userId;
         $finance->taxNumber = '';
         $finance->taxCompany = $userDetailInfo->company;
         $finance->taxAddress = $userDetailInfo->mainAddress;
         $finance->taxCity = $userDetailInfo->city;
         $finance->taxProvince = $userDetailInfo->state;
         $finance->taxCountryId = $userDetailInfo->countryId;
         $finance->taxZip = $userDetailInfo->zip;
         $finance->save();
     }
     $userFinanceInfo = $tblUserFinance->find($userId)->current();
     //print_r($_POST);
     $cart =& $_SESSION['jCart'];
     if (!is_object($cart)) {
         $cart = new jCart();
     }
     $this->view->cart = $cart;
     //print_r($_SESSION['jCart']);
     $this->view->userInfo = $userFinanceInfo;
     //if($this->_configStore->store->isClosed)
     if ($this->_isStoreClosed()) {
         $this->_forward('closed', 'store', 'site');
     }
 }
Ejemplo n.º 2
0
 private function _checkAuth()
 {
     $auth = Zend_Auth::getInstance();
     $userId = $auth->getIdentity()->guid;
     if (!$auth->hasIdentity()) {
         $this->_redirect(KUTU_ROOT_URL . '/helper/sso/login' . '?returnTo=' . $sReturn);
     } else {
         // [TODO] else: check if user has access to admin page
         $username = $auth->getIdentity()->username;
         $this->view->username = $username;
     }
     //$userId=$auth->getIdentity()->guid;
     $tblUser = new Kutu_Core_Orm_Table_User();
     $this->_userDetailInfo = $tblUser->find($userId)->current();
     $tblUserFinance = new Kutu_Core_Orm_Table_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();
     }
 }
Ejemplo n.º 3
0
 private function _checkAuth()
 {
     $auth = Zend_Auth::getInstance();
     if (!$auth->hasIdentity()) {
         $sReturn = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
         $sReturn = base64_encode($sReturn);
         $registry = Zend_Registry::getInstance();
         $config = $registry->get('config');
         $loginUrl = $config->identity->config->local->login->url;
         $this->_redirect(KUTU_ROOT_URL . $loginUrl . '?returnTo=' . $sReturn);
     } else {
         $this->_user = $auth->getIdentity();
     }
     $modelUserFinance = new Kutu_Core_Orm_Table_UserFinance();
     $this->_userFinanceInfo = $modelUserFinance->find($this->_user->kopel)->current();
     if (empty($this->_userFinanceInfo)) {
         $finance = $modelUserFinance->fetchNew();
         $finance['userId'] = $this->_user->kopel;
         $finance->save();
         $this->_userFinanceInfo = $modelUserFinance->find($this->_user->kopel)->current();
     }
 }
Ejemplo n.º 4
0
 function upgradesubAction()
 {
     $packageId = $this->_getParam('packageId');
     $this->view->packageId = $packageId;
     $this->view->rowUser = $this->_user;
     $modelUserFinance = new Kutu_Core_Orm_Table_UserFinance();
     $userFinanceInfo = $modelUserFinance->fetchRow("userId='" . $this->_user->kopel . "'");
     if (!$userFinanceInfo) {
         $finance = $modelUserFinance->fetchNew();
         $finance->userId = $this->_user->kopel;
         $finance->taxNumber = '';
         $finance->taxCompany = $this->_user->company;
         $finance->taxAddress = $this->_user->address;
         $finance->taxCity = $this->_user->city;
         $finance->taxProvince = $this->_user->state;
         $finance->taxCountryId = $this->_user->countryId;
         $finance->taxZip = $this->_user->zip;
         $finance->save();
     }
     $userFinanceInfo = $modelUserFinance->fetchRow("userId='" . $this->_user->kopel . "'");
     $this->view->userInfo = $userFinanceInfo;
 }