Esempio n. 1
0
 public function executeOrder(GWF_Module $module, GWF_User $user)
 {
     $token = $this->getVar('your_token');
     if (false === GWF_DownloadToken::insertToken($module, $this, $user, $token)) {
         return false;
     }
     if (false === $this->increase('dl_purchases', 1)) {
         # Euh nvm
     }
     if ($this->expires()) {
         $module->message('msg_purchased', array($token, GWF_Time::humanDuration($this->getVar('dl_expire')), $this->hrefDownload()), true, true);
     } else {
         $module->message('msg_purchased2', array($token, $this->hrefDownload()), true, true);
     }
     return true;
 }
Esempio n. 2
0
 public function validate_token(Module_Download $m, $arg)
 {
     $this->user = GWF_Session::getUser();
     if (GWF_DownloadToken::checkToken($m, $this->dl, $this->user, $arg)) {
         return false;
     }
     return $m->lang('err_token');
 }