Esempio n. 1
0
 function indexAction()
 {
     /*
      *  First check user's login. user can be logged in plugin or user's login info can be in cookies.
      *  Result does not matter here so skip it;
      *
      */
     if (!$this->getDi()->auth->getUserId() && $this->_request->isGet()) {
         $result = $this->getDi()->auth->checkExternalLogin($this->_request);
     }
     /*==TRIAL_SPLASH==*/
     if (!$this->getDi()->auth->getUserId() && $this->getDi()->config->get('signup_disable')) {
         $e = new Am_Exception_InputError(___('New Signups is Disabled'));
         $e->setLogError(false);
         throw $e;
     }
     $this->loadForm();
     $this->view->title = $this->record->title;
     $this->form = new Am_Form_Signup();
     $this->form->setParentController($this);
     $this->form->initFromSavedForm($this->record);
     try {
         $this->form->run();
     } catch (Am_Exception_QuietError $e) {
         $e->setPublicTitle($this->record->title);
         throw $e;
     }
 }
Esempio n. 2
0
 function indexAction()
 {
     if (!$this->getDi()->auth->getUserId()) {
         $this->getDi()->auth->checkExternalLogin($this->getRequest());
     }
     if ($this->getDi()->auth->getUserId()) {
         $this->_redirect('aff/aff');
     }
     // there are no reasons to use this form if logged-in
     $form = $this->getDi()->savedFormTable->getByType(SavedForm::D_AFF);
     if (!$form) {
         throw new Am_Exception_QuietError(___('There are no form available for affiliate signup.'));
     }
     $this->record = $form;
     $this->view->title = $this->record->title;
     if ($this->record->meta_title) {
         $this->view->meta_title = $this->record->meta_title;
     }
     if ($this->record->meta_keywords) {
         $this->view->headMeta()->setName('keywords', $this->record->meta_keywords);
     }
     if ($this->record->meta_description) {
         $this->view->headMeta()->setName('description', $this->record->meta_description);
     }
     $this->form = new Am_Form_Signup();
     $this->form->setParentController($this);
     $this->form->initFromSavedForm($this->record);
     $this->form->run();
 }
 function indexAction()
 {
     /*==TRIAL_SPLASH==*/
     $this->loadForm();
     $this->view->title = $this->record->title;
     $this->form = new Am_Form_Signup();
     $this->form->setParentController($this);
     $this->form->initFromSavedForm($this->record);
     $this->form->run();
 }
 function indexAction()
 {
     if ($this->getDi()->auth->getUserId()) {
         $this->_redirect('aff/aff');
     }
     // there are no reasons to use this form if logged-in
     $this->record = $this->getDi()->savedFormTable->getByType(SavedForm::D_AFF);
     $this->view->title = $this->record->title;
     $this->form = new Am_Form_Signup();
     $this->form->setParentController($this);
     $this->form->initFromSavedForm($this->record);
     $this->form->run();
 }
Esempio n. 5
0
 function indexAction()
 {
     if (!$this->getDi()->auth->getUserId()) {
         $this->getDi()->auth->checkExternalLogin($this->getRequest());
     }
     if ($this->getDi()->auth->getUserId() && $this->getDi()->auth->getUser()->is_affiliate) {
         $this->_redirect('aff/aff');
     }
     // there are no reasons to use this form if logged-in
     $form = $this->getDi()->savedFormTable->getByType(SavedForm::D_AFF);
     if (!$form) {
         throw new Am_Exception_QuietError(___('There are no form available for affiliate signup.'));
     }
     $this->record = $form;
     $this->view->title = $this->record->title;
     if ($this->record->meta_title) {
         $this->view->meta_title = $this->record->meta_title;
     }
     if ($this->record->meta_keywords) {
         $this->view->headMeta()->setName('keywords', $this->record->meta_keywords);
     }
     if ($this->record->meta_description) {
         $this->view->headMeta()->setName('description', $this->record->meta_description);
     }
     $this->form = new Am_Form_Signup();
     $this->form->setParentController($this);
     $this->form->initFromSavedForm($this->record);
     try {
         $this->form->run();
     } catch (HTML_QuickForm2_NotFoundException $e) {
         if ($this->getDi()->auth->getUserId()) {
             $user = $this->getDi()->auth->getUser();
             $user->is_affiliate = $this->getModule()->getConfig('signup_type') == 2 ? 0 : 1;
             $user->save();
             if (!$user->is_affiliate) {
                 $this->getModule()->sendNotApprovedEmail($user);
                 $this->view->content = '<div class="am-info">' . $this->msg . '</div>';
                 $this->view->display('layout.phtml');
             } else {
                 $this->_redirect('aff/aff');
             }
         } else {
             throw $e;
         }
     }
 }