예제 #1
0
 public function requestformAction()
 {
     $tokenObj = new TokenGenerator();
     try {
         $userID = $this->_getParam("userID");
         $token = $tokenObj->getToken($userID);
         $this->view->pToken = DataFormat::hexstr($token->pToken);
         $this->view->timestamp = $token->timestamp;
         $warmupObj = new Warmup();
         $warmupObj->warmup($userID);
     } catch (Exception $e) {
         print_r($e);
     }
     $this->view->formaction = "/billing/bill";
     $this->render('billingex');
 }
예제 #2
0
 private function generateToken()
 {
     //get from memcached first
     $key = $this->getCachedKey();
     $dataToken = $this->_cache->getTokenCache($key);
     if ($dataToken == FALSE) {
         $tokenObj = new TokenGenerator();
         $token = $tokenObj->getToken($this->userID);
         $pToken = DataFormat::hexstr($token->pToken);
         $this->view->pToken = $pToken;
         $dataToken = array('billstat' => 0, 'tokenkey' => $pToken);
         //billstat:0-chua xac nhan,1-hoan thanh xac nhan
         $this->_cache->setTokenCache($key, $dataToken);
         return true;
     } else {
         if ($dataToken['billstat'] == "1") {
             return false;
         }
         $this->view->pToken = $dataToken['tokenkey'];
         return true;
     }
 }