Callback for logout link.

@param string $campaign_id
Campaign node ID.

@return \Drupal\Core\Ajax\AjaxResponse
772035
public function logout($campaign_id = NULL) {
    $response = new AjaxResponse();

    // Logout member - clear Campaign ID from SESSION.
    MemberCampaign::logout($campaign_id);

    $logoutTitle = $this->t('Thank you!');
    $logoutMessage = $this->t('You were successfully logged out!');

    $response->addCommand(new OpenModalDialogCommand($logoutTitle, $logoutMessage, ['width' => 800]));

    // Close dialog and redirect ot Campaign main page.
    $response->addCommand(new InvokeCommand('#drupal-modal', 'closeDialog', ['<campaign-front>']));

    return $response;
  }
1288543
def delete_issue_link(self, id):
        
        url = self._get_url('issueLink') + "/" + id
        return self._session.delete(url)
616875
public function reportBrowserInfo($campaign_id, $by_subscriber=0, $os_name, $browser, $client_type)
		{
			$form_data = array(
				'campaign_id' => $campaign_id,
				'by_subscriber' => $by_subscriber,
				'os_name' => $os_name,
				'browser' => $browser,
				'client_type' => $client_type
			);
			$xml = $this->call('rpt_browser_info', $form_data);

			return $xml;
		}
540303
public function loginAction(Request $request)
    {
        $oauth = $this->get('campaignchain.security.authentication.client.oauth.authentication');
        $oauth->authenticate(self::RESOURCE_OWNER, $this->applicationInfo, true);
        $wizard = $this->get('campaignchain.core.channel.wizard');
        $wizard->set('profile', $oauth->getProfile());

        // Allow to easily find the Facebook user's ID through the Wizard.
        $wizard->set('linkedin_user_id', $oauth->getProfile()->identifier);
        $tokens[$oauth->getProfile()->identifier] = $oauth->getToken();
        $wizard->set('tokens', $tokens);
        return $this->render('CampaignChainChannelLinkedInBundle:Create:closePopUp.html.twig');
    }
1361463
private static function getCampaignFeeds(
        AdWordsServices $adWordsServices,
        AdWordsSession $session,
        $feedId,
        $placeholderId
    ) {
        $campaignFeedService = $adWordsServices->get($session, CampaignFeedService::class);
        $page = $campaignFeedService->query(
            sprintf(
                'SELECT CampaignId, MatchingFunction, PlaceholderTypes WHERE '
                . 'Status="ENABLED" AND FeedId = %d AND PlaceholderTypes ' . 'CONTAINS_ANY[%d]',
                $feedId,
                $placeholderId
            )
        );

        return $page->getEntries();
    }
1259198
public function actionLogout()
    {
        $event = $this->getUserEvent(\Yii::$app->user->identity);

        $this->trigger(self::EVENT_BEFORE_LOGOUT, $event);

        \Yii::$app->getUser()->logout();

        $this->trigger(self::EVENT_AFTER_LOGOUT, $event);

        \Yii::$app->getResponse()->redirect(Url::to([\Yii::$app->getHomeUrl()]));
    }
745397
def results(self, campaign_id):
        
        return super(API, self).get(
            resource_id=campaign_id,
            resource_action='results',
            resource_cls=CampaignResults)
1156294
public function handlerAction(
        Request $request,
        $sourceId = null,
        $main,
        $campaignId = null,
        $object,
        $action
    ) {
        if (!$this->get('mautic.security')->isAnonymous()) {
            $contactSource = $this->checkContactSourceAccess($sourceId, 'view');
            if ($contactSource instanceof ContactSource) {
                $request->request->set('token', $contactSource->getToken());
            }
        }

        /** @var \MauticPlugin\MauticContactSourceBundle\Model\Api $ApiModel */
        $ApiModel = $this->get('mautic.contactsource.model.api');
        $ApiModel
            ->setRequest($request)
            ->setSourceId((int) $sourceId)
            ->setCampaignId((int) $campaignId)
            ->setVerbose(true)
            ->handleInputPublic();

        $result        = $ApiModel->getResult();
        $parameters    = [];
        $campaigns     = [];
        $contactSource = $ApiModel->getContactSource();
        if ($contactSource) {
            $contactSourceModel = $this->container->get('mautic.contactsource.model.contactsource');
            $campaigns          = $contactSourceModel->getCampaignList($ApiModel->getContactSource());
        }
        $parameters['campaignList'] = $campaigns;
        $parameters['campaign']     = null;

        // Get global Source integration settings.
        $parameters['global'] = [];
        /** @var \Mautic\PluginBundle\Helper\IntegrationHelper $helper */
        $helper = $this->get('mautic.helper.integration');
        /** @var \Mautic\PluginBundle\Integration\AbstractIntegration $object */
        $object = $helper->getIntegrationObject('Source');
        if ($object) {
            $objectSettings = $object->getIntegrationSettings();
            if ($objectSettings) {
                $featureSettings      = $objectSettings->getFeatureSettings();
                $parameters['global'] = $featureSettings;
            }
        }
        if (empty($parameters['global']['domain'])) {
            $parameters['global']['domain'] = $this->get('mautic.helper.core_parameters')->getParameter('site_url');
        }
        $parameters['global']['domain'] = rtrim('/', $parameters['global']['domain']);
        $parameters['source']           = isset($result['source']) ? $result['source'] : null;
        $parameters['sourceId']         = $sourceId;
        $parameters['FieldList']        = $ApiModel->getAllowedFields(false);
        $parameters['authenticated']    = $result['authenticated'];
        if (!isset($result['campaign']['name']) && isset($result['source']['name'])) {
            // No valid campaign specified, should show the listing of all campaigns.
            $parameters['title'] = $this->translator->trans(
                'mautic.contactsource.api.docs.source_title',
                [
                    '%source%' => $result['source']['name'],
                ]
            );
        } elseif (isset($result['campaign']['name']) && isset($result['source']['name'])) {
            // Valid campaign is specified, should include hash or direct link to that campaign.
            $parameters['title']          = $this->translator->trans(
                'mautic.contactsource.api.docs.campaign_title',
                [
                    '%source%'   => $result['source']['name'],
                    '%campaign%' => $result['campaign']['name'],
                ]
            );
            $parameters['campaignFields'] = $ApiModel->getCampaignFields(false);
            $parameters['campaign']       = $result['campaign'];
        } else {
            // Completely invalid source.
            $this->notFound('mautic.contactsource.api.docs.not_found');
        }

        if (!$parameters['authenticated']) {
            $parameters['title'] = $this->translator->trans('mautic.contactsource.api.docs.auth_title');
            $view                = 'MauticContactSourceBundle:Documentation:auth.html.php';
        } else {
            $view = 'MauticContactSourceBundle:Documentation:details.html.php';
        }

        return $this->render($view, $parameters);
    }
579737
public function cancelCampaign($id)
    {
        if (empty($id)) {
            return $this->handleError('Empty campaign id');
        }

        $requestResult = $this->sendRequest('campaigns/' . $id, 'DELETE');

        return $this->handleResult($requestResult);
    }
1332733
public function destroy($session_id = null)
    {
        if ($session_id) {
            $this->eventsManager->fireEvent('session:destroy', $this, ['session_id' => $session_id]);
            $this->do_destroy($session_id);
        } else {

            $context = $this->_context;

            if (!$context->started) {
                $this->_start();
            }

            $this->eventsManager->fireEvent('session:destroy', $this, ['session_id' => $session_id, 'context' => $context]);

            $context->started = false;
            $context->is_dirty = false;
            $context->session_id = null;
            $context->_SESSION = null;
            $this->do_destroy($context->session_id);

            $params = $this->_cookie_params;
            $this->cookies->delete($this->_name, $params['path'], $params['domain'], $params['secure'], $params['httponly']);
        }
    }
95598
def create_event(*args)
      raise "EventCampaign needs to be saved before Event creation" if self.id.nil?

      (args[0]).merge!(:campaign_id => self.id)

      event = ActionKitApi::Event.new(*args)
    end
95208
public function create($campaignId = 0)
    {
        $entity = $this->createEntity($campaignId);
        if ($entity) {
            $this->getRepository()->saveEntity($entity);
        }
    }
743631
public function reportTrackedEventsByCampaign($campaign_id, $event_type, $start_datetime, $end_datetime, $offset=0)
		{
			$form_data = array(
				'campaign_id' => $campaign_id,
				'event_type' => $event_type,
				'start_datetime' => $start_datetime,
				'end_datetime' => $end_datetime,
				'offset' => $offset
			);
			$xml = $this->call('rpt_tracked_events_by_campaign', $form_data);

			return json_decode(json_encode($xml), TRUE);
		}
1316193
public function setCampaign(Campaign $campaign = null)
    {
        if ($campaign) {
            $this->setLogs($campaign->getId(), 'campaignId');
            $this->campaign = $campaign;
        }

        return $this;
    }
617430
private function getUserProgress($campaign_id, $member_campaign_id) {
    /** @var \Drupal\Core\Database\Query\Select $query */
    $query = $this->connection->select('openy_campaign_memb_camp_actv', 'mca');
    $query->join('openy_campaign_member_campaign', 'mc', 'mc.id = mca.member_campaign');
    $query->join('openy_campaign_member', 'm', 'm.id = mc.member');

    $query->condition('mc.campaign', $campaign_id);
    $query->condition('mc.id', $member_campaign_id);

    $query->groupBy('mc.id');

    $query->leftJoin('taxonomy_term__field_global_goal_activity_worth', 'aw', 'aw.entity_id = mca.activity');
    $query->addExpression('SUM(aw.field_global_goal_activity_worth_value)', 'total');
    $query->having('SUM(aw.field_global_goal_activity_worth_value) > 0');

    $query->orderBy('total', 'DESC');

    $total = $query->execute()->fetchField();

    return floatval($total);
  }
395041
private function toServerLogout()
	{
		$logoutUrl = $this->_config['logout'].$this->signature().'&appId='.$this->_config['appId'];
		header('Location:'.$logoutUrl);
	}
11293
public function setCampaign(Campaign $campaign = null)
    {
        if ($campaign) {
            $this->campaign   = $campaign;
            $this->campaignId = $campaign->getId();
        }

        return $this;
    }