function loadZohoFields() { $app = JFactory::getApplication(); $zohoHelper = acymailing_get('helper.zoho'); $zohoHelper->authtoken = JRequest::getVar('zoho_apikey'); $list = JRequest::getVar('zoho_list'); JRequest::setVar('layout', 'import'); $zohoFields = $zohoHelper->getFieldsRaw($list); if (!empty($zohoHelper->error)) { $app->enqueueMessage($zohoHelper->error, 'error'); return parent::display(); } $zohoFieldsParsed = $zohoHelper->parseXMLFields($zohoFields); if (!empty($zohoHelper->error)) { $app->enqueueMessage($zohoHelper->error, 'error'); return parent::display(); } $config = acymailing_config(); $newconfig = new stdClass(); $newconfig->zoho_fieldsname = implode(',', $zohoFieldsParsed); $newconfig->zoho_list = $list; $newconfig->zoho_apikey = $zohoHelper->authtoken; $config->save($newconfig); $app->enqueueMessage(JText::_('ACY_FIELDSLOADED')); return parent::display(); }
function display($cachable = false, $urlparams = false) { if (!empty($this->aclCat) and !$this->isAllowed($this->aclCat, 'manage')) { return; } return parent::display($cachable, $urlparams); }
function display() { if (!empty($this->aclCat) and !$this->isAllowed($this->aclCat, 'manage')) { return; } return parent::display(); }
function __construct($config = array()) { parent::__construct($config); JRequest::setVar('tmpl','component'); $this->registerDefaultTask('click'); }
function tag() { if (!$this->isAllowed($this->aclCat, 'view')) { return; } JRequest::setVar('layout', 'tag'); return parent::display(); }
function process() { if (!$this->isAllowed($this->aclCat, 'process')) { return; } JRequest::setVar('layout', 'process'); return parent::display(); }
function forward() { if (!$this->isAllowed('statistics', 'manage')) { return; } JRequest::setVar('layout', 'forward'); return parent::display(); }
function detaillisting() { if (!$this->isAllowed($this->aclCat, 'manage') || !$this->isAllowed('subscriber', 'view')) { return; } JRequest::setVar('layout', 'detaillisting'); return parent::display(); }
function view() { $statsClass = acymailing_get('class.stats'); $statsClass->countReturn = false; $statsClass->saveStats(); JRequest::setVar('layout', 'view'); return parent::display(); }
function mailinglist() { if (!$this->isAllowed('statistics', 'manage')) { return; } JRequest::setVar('layout', 'mailinglist'); return parent::display(); }
function sendready() { if (!$this->isAllowed('newsletters', 'send')) { return; } JRequest::setVar('layout', 'sendconfirm'); return parent::display(); }
function export() { if (!$this->isAllowed('subscriber', 'export')) { return; } JRequest::setVar('layout', 'export'); return parent::display(); }
function unsub() { $userClass = acymailing::get('class.subscriber'); $user = $userClass->identify(); if (empty($user)) { return false; } JRequest::setVar('layout', 'unsub'); return parent::display(); }
function __construct($config = array()) { parent::__construct($config); JHTML::_('behavior.tooltip'); JRequest::setVar('tmpl', 'component'); jimport('joomla.filesystem.file'); jimport('joomla.filesystem.folder'); jimport('joomla.filesystem.path'); $this->registerDefaultTask('browse'); }
function listing() { if (!acymailing_level(3)) { $acyToolbar = acymailing::get('helper.toolbar'); $acyToolbar->setTitle(JText::_('BOUNCE_HANDLING'), 'bounces'); $acyToolbar->display(); acymailing_display(JText::_('ACY_BOUNCE_AVAILABLE') . '<br /><br /><a target="_blank" href="' . ACYMAILING_REDIRECT . 'acymailing-features">' . JText::_('ACY_FEATURES') . '</a>', 'info'); return; } return parent::listing(); }
function listing() { if (!acymailing_level(3)) { $acyToolbar = acymailing::get('helper.toolbar'); $acyToolbar->setTitle(JText::_('EXTRA_FIELDS'), 'fields'); $acyToolbar->display(); acymailing_display(JText::_('ACY_CUSTOMFIELDS_UPGRADE') . '<br /><br /><a target="_blank" href="' . ACYMAILING_REDIRECT . 'acymailing-features">' . JText::_('ACY_FEATURES') . '</a>', 'info'); return; } return parent::listing(); }
function remove() { if (!$this->isAllowed($this->aclCat, 'delete')) { return; } JRequest::checkToken() or die('Invalid Token'); $listIds = JRequest::getVar('cid', array(), '', 'array'); $subscriberObject = acymailing_get('class.list'); $num = $subscriberObject->delete($listIds); acymailing_enqueueMessage(JText::sprintf('SUCC_DELETE_ELEMENTS', $num), 'message'); JRequest::setVar('layout', 'listing'); return parent::display(); }
function view() { $statsClass = acymailing_get('class.stats'); $statsClass->countReturn = false; $statsClass->saveStats(); $printEnabled = JRequest::getVar('print', 0); if ($printEnabled) { $js = "setTimeout(function(){\r\n\t\t\t\t\tif(document.getElementById('iframepreview')){\r\n\t\t\t\t\t\tdocument.getElementById('iframepreview').contentWindow.focus();\r\n\t\t\t\t\t\tdocument.getElementById('iframepreview').contentWindow.print();\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\twindow.print();\r\n\t\t\t\t\t}\r\n\t\t\t\t},2000);"; $doc = JFactory::getDocument(); $doc->addScriptDeclaration($js); } JRequest::setVar('layout', 'view'); return parent::display(); }
function remove() { if (!$this->isAllowed('subscriber', 'delete')) { return; } JRequest::checkToken() or die('Invalid Token'); $subscriberIds = JRequest::getVar('cid', array(), '', 'array'); $subscriberObject = acymailing::get('class.subscriber'); $num = $subscriberObject->delete($subscriberIds); $app =& JFactory::getApplication(); $app->enqueueMessage(JText::sprintf('SUCC_DELETE_ELEMENTS', $num), 'message'); JRequest::setVar('layout', 'listing'); return parent::display(); }
function forward() { $config = acymailing::config(); if (!$config->get('forward', true)) { return $this->view(); } $key = JRequest::getString('key'); $mailid = JRequest::getInt('mailid'); $mailerHelper = acymailing::get('helper.mailer'); $mailtosend = $mailerHelper->load($mailid); if (empty($key) or $mailtosend->key !== $key) { return $this->view(); } JRequest::setVar('layout', 'forward'); return parent::display(); }
function __construct($config = array()) { parent::__construct($config); $this->registerDefaultTask('toggle'); $this->allowedTablesColumn['list'] = array('published' => 'listid', 'visible' => 'listid'); $this->allowedTablesColumn['subscriber'] = array('confirmed' => 'subid', 'html' => 'subid', 'enabled' => 'subid'); $this->allowedTablesColumn['template'] = array('published' => 'tempid', 'premium' => 'tempid'); $this->allowedTablesColumn['mail'] = array('published' => 'mailid', 'visible' => 'mailid'); $this->allowedTablesColumn['listsub'] = array('status' => 'listid,subid'); $this->allowedTablesColumn['plugins'] = array('published' => 'id'); $this->allowedTablesColumn['followup'] = array('add' => 'mailid', 'addall' => 'mailid', 'update' => 'mailid'); $this->allowedTablesColumn['rules'] = array('published' => 'ruleid'); $this->allowedTablesColumn['filter'] = array('published' => 'filid'); $this->allowedTablesColumn['fields'] = array('published' => 'fieldid', 'required' => 'fieldid', 'frontcomp' => 'fieldid', 'backend' => 'fieldid', 'listing' => 'fieldid', 'frontlisting' => 'fieldid', 'frontjoomlaregistration' => 'fieldid', 'frontjoomlaprofile' => 'fieldid', 'joomlaprofile' => 'fieldid'); $this->allowedTablesColumn['config'] = array('addindex' => 'namekey', 'guessport' => 'port'); $this->deleteColumns['queue'] = array('subid', 'mailid'); $this->deleteColumns['filter'] = array('filid', 'filid'); $this->deleteColumns['rules'] = array('ruleid', 'ruleid'); header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: post-check=0, pre-check=0', false); header('Pragma: no-cache'); }
function customfields() { JRequest::setVar('layout', 'customfields'); return parent::display(); }
function preview() { JRequest::setVar('layout', 'preview'); return parent::display(); }
function share() { if (!$this->isAllowed('configuration', 'manage')) { return; } JRequest::checkToken() or die('Invalid Token'); if ($this->_savelanguage()) { JRequest::setVar('layout', 'share'); return parent::display(); } else { return $this->language(); } }
function theme() { JRequest::setVar('layout', 'theme'); return parent::display(); }
function saveunsub() { acymailing_checkRobots(); $app = JFactory::getApplication(); $subscriberClass = acymailing_get('class.subscriber'); $subscriberClass->sendConf = false; $listsubClass = acymailing_get('class.listsub'); $userHelper = acymailing_get('helper.user'); $config = acymailing_config(); $subscriber = new stdClass(); $subscriber->subid = JRequest::getInt('subid'); $user = $subscriberClass->identify(); if ($user->subid != $subscriber->subid) { echo "<script>alert('ERROR : You are not allowed to modify this user'); window.history.go(-1);</script>"; exit; } $refusemails = JRequest::getInt('refuse'); $unsuball = JRequest::getInt('unsuball'); $unsublist = JRequest::getInt('unsublist'); $mailid = JRequest::getInt('mailid'); $oldUser = $subscriberClass->get($subscriber->subid); $survey = JRequest::getVar('survey', array(), '', 'array'); $tagSurvey = ''; $data = array(); if (!empty($survey)) { foreach ($survey as $oneResult) { $data[] = "REASON::" . str_replace(array("\n", "\r"), array('<br/>', ''), strip_tags($oneResult)); } $tagSurvey = str_replace(array('REASON::', 'UNSUB_SURVEY_FREQUENT', 'UNSUB_SURVEY_RELEVANT'), array('<br />' . JText::_('REASON') . ' : ', JText::_('UNSUB_SURVEY_FREQUENT'), JText::_('UNSUB_SURVEY_RELEVANT')), implode('<br />', $data)); } $historyClass = acymailing_get('class.acyhistory'); $historyClass->insert($subscriber->subid, 'unsubscribed', $data, $mailid); $notifToSend = ''; $incrementUnsub = false; if ($refusemails or $unsuball) { if ($refusemails) { $subscriber->accept = 0; if ($config->get('unsubscription_message', 1)) { $app->enqueueMessage(JText::_('CONFIRM_UNSUB_FULL')); } $notifToSend = 'notification_refuse'; } elseif ($unsuball) { $notifToSend = 'notification_unsuball'; } $subscription = $subscriberClass->getSubscriptionStatus($subscriber->subid); $updatelists = array(); foreach ($subscription as $listid => $oneList) { if ($oneList->status != -1) { $updatelists[-1][] = $listid; } } $listsubClass->sendNotif = false; if (!empty($updatelists)) { $status = $listsubClass->updateSubscription($subscriber->subid, $updatelists); if ($config->get('unsubscription_message', 1)) { $app->enqueueMessage(JText::_('CONFIRM_UNSUB_ALL')); } $incrementUnsub = true; } else { if ($config->get('unsubscription_message', 1)) { $app->enqueueMessage(JText::_('ERROR_NOT_SUBSCRIBED')); } } $subscriber->confirmed = 0; $subscriberClass->save($subscriber); } elseif ($unsublist) { $subscription = $subscriberClass->getSubscriptionStatus($subscriber->subid); $db = JFactory::getDBO(); $db->setQuery('SELECT b.listid, b.name, b.type FROM ' . acymailing_table('listmail') . ' as a JOIN ' . acymailing_table('list') . ' as b on a.listid = b.listid WHERE a.mailid = ' . $mailid); $allLists = $db->loadObjectList(); if (empty($allLists)) { $db->setQuery('SELECT b.listid, b.name, b.type FROM ' . acymailing_table('list') . ' as b WHERE b.welmailid = ' . $mailid . ' OR b.unsubmailid = ' . $mailid); $allLists = $db->loadObjectList(); } if (empty($allLists)) { $db->setQuery('SELECT b.listid, b.name, b.type FROM #__acymailing_listsub as a JOIN #__acymailing_list as b on a.listid = b.listid WHERE a.subid = ' . $subscriber->subid); $allLists = $db->loadObjectList(); } if (empty($allLists)) { echo "<script>alert('ERROR : Could not get the list for the mailing {$mailid}'); window.history.go(-1);</script>"; exit; } $campaignList = array(); $unsubList = array(); foreach ($allLists as $oneList) { if (isset($subscription[$oneList->listid]) and $subscription[$oneList->listid]->status != -1) { if ($oneList->type == 'campaign') { $campaignList[] = $oneList->listid; } else { $unsubList[$oneList->listid] = $oneList; } } } if (!empty($campaignList)) { $db->setQuery('SELECT b.listid, b.name, b.type FROM ' . acymailing_table('listcampaign') . ' as a LEFT JOIN ' . acymailing_table('list') . ' as b on a.listid = b.listid WHERE a.campaignid IN (' . implode(',', $campaignList) . ')'); $otherLists = $db->loadObjectList(); if (!empty($otherLists)) { foreach ($otherLists as $oneList) { if (isset($subscription[$oneList->listid]) and $subscription[$oneList->listid]->status != -1) { $unsubList[$oneList->listid] = $oneList; } } } } if (!empty($unsubList)) { $updatelists = array(); $updatelists[-1] = array_keys($unsubList); $listsubClass->survey = $tagSurvey; $status = $listsubClass->updateSubscription($subscriber->subid, $updatelists); if ($config->get('unsubscription_message', 1)) { $app->enqueueMessage(JText::_('CONFIRM_UNSUB_CURRENT')); } $incrementUnsub = true; } else { if ($config->get('unsubscription_message', 1)) { $app->enqueueMessage(JText::_('ERROR_NOT_SUBSCRIBED_CURRENT')); } } } if ($incrementUnsub) { $db = JFactory::getDBO(); $db->setQuery('UPDATE ' . acymailing_table('stats') . ' SET `unsub` = `unsub` +1 WHERE `mailid` = ' . (int) $mailid); $db->query(); } if (!empty($notifToSend)) { $notifyUsers = $config->get($notifToSend); if (!empty($notifyUsers)) { $mailer = acymailing_get('helper.mailer'); $mailer->autoAddUser = true; $mailer->checkConfirmField = false; $mailer->report = false; foreach ($oldUser as $field => $value) { $mailer->addParam('user:'******'user:subscription', $listsubClass->getSubscriptionString($oldUser->subid)); $mailer->addParam('user:ip', $userHelper->getIP()); $mailer->addParam('survey', $tagSurvey); $mailer->addParamInfo(); $allUsers = explode(',', $notifyUsers); foreach ($allUsers as $oneUser) { $mailer->sendOne('notification_unsuball', $oneUser); } } } $redirectUnsub = $config->get('unsub_redirect'); if (!empty($redirectUnsub)) { $this->setRedirect($redirectUnsub); return; } JRequest::setVar('layout', 'saveunsub'); return parent::display(); }
function customtemplate() { JRequest::setVar('layout', 'form'); return parent::display(); }
function upload() { if (!$this->isAllowed($this->aclCat, 'manage')) { return; } JRequest::setVar('layout', 'upload'); return parent::display(); }
function abtesting() { JRequest::setVar('layout', 'abtesting'); return parent::display(); }
function __construct($config = array()) { parent::__construct($config); $this->registerDefaultTask('update'); }