Example #1
0
 public function afterSignupFailed(Pap_Contexts_Signup $signupContext) {
     $form = $signupContext->getFormObject();
     if ($form->getFieldError('username') == '') {
         return;
     }
     try {
         $userId = $this->getUserId($form->getFieldValue('username'));
     } catch (Gpf_Exception $e) {
         Gpf_Log::debug('SignupToCampaignPlugin: user with username '.$form->getFieldValue('username').' does not exist');
         return;
     }
     if ($this->signUserToCampaign($userId, $form)) {
         $form->setInfoMessage($this->_('You have been successfully signed up'));
         $form->setErrorMessage('');
         $form->setFieldError('username', '');
         $form->setSuccessful();
     }
 }
Example #2
0
 public function afterSignup(Pap_Contexts_Signup $signupContext) {
     $campaignsIds = $this->getCampaignsIdsFromString(Gpf_Settings::get(SignupToPrivateCampaigns_Config::CAMPAIGNS_IDS));
     foreach ($campaignsIds as $campaignId) {
         $this->signUserToCampaign($signupContext->getUserObject()->getId(), $campaignId, $signupContext->getFormObject());
     }
 }