Esempio n. 1
0
 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();
 }
Esempio n. 2
0
 function display($cachable = false, $urlparams = false)
 {
     if (!empty($this->aclCat) and !$this->isAllowed($this->aclCat, 'manage')) {
         return;
     }
     return parent::display($cachable, $urlparams);
 }
Esempio n. 3
0
 function display()
 {
     if (!empty($this->aclCat) and !$this->isAllowed($this->aclCat, 'manage')) {
         return;
     }
     return parent::display();
 }
Esempio n. 4
0
	function __construct($config = array())
	{
		parent::__construct($config);

		JRequest::setVar('tmpl','component');
		$this->registerDefaultTask('click');

	}
Esempio n. 5
0
 function tag()
 {
     if (!$this->isAllowed($this->aclCat, 'view')) {
         return;
     }
     JRequest::setVar('layout', 'tag');
     return parent::display();
 }
Esempio n. 6
0
 function process()
 {
     if (!$this->isAllowed($this->aclCat, 'process')) {
         return;
     }
     JRequest::setVar('layout', 'process');
     return parent::display();
 }
Esempio n. 7
0
 function forward()
 {
     if (!$this->isAllowed('statistics', 'manage')) {
         return;
     }
     JRequest::setVar('layout', 'forward');
     return parent::display();
 }
Esempio n. 8
0
 function detaillisting()
 {
     if (!$this->isAllowed($this->aclCat, 'manage') || !$this->isAllowed('subscriber', 'view')) {
         return;
     }
     JRequest::setVar('layout', 'detaillisting');
     return parent::display();
 }
Esempio n. 9
0
 function view()
 {
     $statsClass = acymailing_get('class.stats');
     $statsClass->countReturn = false;
     $statsClass->saveStats();
     JRequest::setVar('layout', 'view');
     return parent::display();
 }
Esempio n. 10
0
 function mailinglist()
 {
     if (!$this->isAllowed('statistics', 'manage')) {
         return;
     }
     JRequest::setVar('layout', 'mailinglist');
     return parent::display();
 }
Esempio n. 11
0
 function sendready()
 {
     if (!$this->isAllowed('newsletters', 'send')) {
         return;
     }
     JRequest::setVar('layout', 'sendconfirm');
     return parent::display();
 }
Esempio n. 12
0
 function export()
 {
     if (!$this->isAllowed('subscriber', 'export')) {
         return;
     }
     JRequest::setVar('layout', 'export');
     return parent::display();
 }
Esempio n. 13
0
 function unsub()
 {
     $userClass = acymailing::get('class.subscriber');
     $user = $userClass->identify();
     if (empty($user)) {
         return false;
     }
     JRequest::setVar('layout', 'unsub');
     return parent::display();
 }
Esempio n. 14
0
 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');
 }
Esempio n. 15
0
 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();
 }
Esempio n. 16
0
 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();
 }
Esempio n. 17
0
 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();
 }
Esempio n. 18
0
 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();
 }
Esempio n. 19
0
 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();
 }
Esempio n. 20
0
 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();
 }
Esempio n. 21
0
 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');
 }
Esempio n. 22
0
 function customfields()
 {
     JRequest::setVar('layout', 'customfields');
     return parent::display();
 }
Esempio n. 23
0
 function preview()
 {
     JRequest::setVar('layout', 'preview');
     return parent::display();
 }
Esempio n. 24
0
 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();
     }
 }
Esempio n. 25
0
 function theme()
 {
     JRequest::setVar('layout', 'theme');
     return parent::display();
 }
Esempio n. 26
0
 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();
 }
Esempio n. 27
0
 function customtemplate()
 {
     JRequest::setVar('layout', 'form');
     return parent::display();
 }
Esempio n. 28
0
 function upload()
 {
     if (!$this->isAllowed($this->aclCat, 'manage')) {
         return;
     }
     JRequest::setVar('layout', 'upload');
     return parent::display();
 }
Esempio n. 29
0
 function abtesting()
 {
     JRequest::setVar('layout', 'abtesting');
     return parent::display();
 }
Esempio n. 30
0
 function __construct($config = array())
 {
     parent::__construct($config);
     $this->registerDefaultTask('update');
 }