示例#1
0
文件: stats.php 项目: madcsaba/li-de
 function onAcyDisplayFilters(&$type, $context = "massactions")
 {
     if ($context != "massactions" and !$this->params->get('displayfilter_' . $context, false)) {
         return;
     }
     $type['deliverstat'] = JText::_('STATISTICS');
     $db = JFactory::getDBO();
     $db->setQuery("SELECT `mailid`,CONCAT(`subject`,' ['," . $db->Quote(JText::_('ACY_ID') . ' ') . ",`mailid`,']') as 'value' FROM `#__acymailing_mail` WHERE `type` IN('news','welcome','unsub','followup') ORDER BY `subject` ASC ");
     $allemails = $db->loadObjectList();
     $element = new stdClass();
     $element->mailid = 0;
     $element->value = JText::_('EMAIL_NAME');
     array_unshift($allemails, $element);
     $actions = array();
     $actions[] = JHTML::_('select.option', 'open', JText::_('OPEN'));
     $actions[] = JHTML::_('select.option', 'notopen', JText::_('NOT_OPEN'));
     $actions[] = JHTML::_('select.option', 'failed', JText::_('FAILED'));
     if (acymailing_level(3)) {
         $actions[] = JHTML::_('select.option', 'bounce', JText::_('BOUNCES'));
     }
     $actions[] = JHTML::_('select.option', 'htmlsent', JText::_('SENT_HTML'));
     $actions[] = JHTML::_('select.option', 'textsent', JText::_('SENT_TEXT'));
     $actions[] = JHTML::_('select.option', 'notsent', JText::_('NOT_SENT'));
     $return = '<div id="filter__num__deliverstat">' . JHTML::_('select.genericlist', $actions, "filter[__num__][deliverstat][action]", 'class="inputbox" onchange="countresults(__num__)" size="1"', 'value', 'text');
     $return .= ' ' . JHTML::_('select.genericlist', $allemails, "filter[__num__][deliverstat][mailid]", 'onchange="countresults(__num__)" class="inputbox" size="1" style="max-width:200px"', 'mailid', 'value') . '</div>';
     return $return;
 }
 function onAcyDisplayActions(&$type)
 {
     $type['list'] = JText::_('ACYMAILING_LIST');
     $status = array();
     $status[] = JHTML::_('select.option', 1, JText::_('SUBSCRIBE_TO'));
     $status[] = JHTML::_('select.option', 0, JText::_('REMOVE_FROM'));
     $lists = $this->_getLists();
     $otherlists = array();
     $onChange = '';
     if (acymailing_level(3)) {
         $db = JFactory::getDBO();
         $db->setQuery('SELECT b.listid, b.name FROM #__acymailing_listcampaign as a JOIN #__acymailing_list as b on a.listid = b.listid GROUP BY b.listid ORDER BY b.ordering ASC');
         $otherlists = $db->loadObjectList('listid');
         $onChange = 'onchange="if(document.getElementById(\'subliststatus__num__\').value == 1 && document.getElementById(\'sublistvalue__num__\').value.indexOf(\'_campaign\') > 0){document.getElementById(\'campaigndelay__num__\').style.display = \'inline\'; }else{document.getElementById(\'campaigndelay__num__\').style.display = \'none\';}"';
     }
     $listsdrop = array();
     foreach ($lists as $oneList) {
         $listsdrop[] = JHTML::_('select.option', $oneList->listid, $oneList->name);
         if (!empty($otherlists[$oneList->listid])) {
             $listsdrop[] = JHTML::_('select.option', $oneList->listid . '_campaign', $otherlists[$oneList->listid]->name . ' + ' . JText::_('CAMPAIGN'));
         }
     }
     $return = '<div id="action__num__list">' . JHTML::_('select.genericlist', $status, "action[__num__][list][status]", 'class="inputbox" size="1" ' . $onChange, 'value', 'text', '', 'subliststatus__num__') . ' ' . JHTML::_('select.genericlist', $listsdrop, "action[__num__][list][selectedlist]", 'class="inputbox" size="1" ' . $onChange, 'value', 'text', '', 'sublistvalue__num__');
     if (acymailing_level(3)) {
         $delay = array();
         $delay[] = JHTML::_('select.option', 'day', JText::_('DAYS'));
         $delay[] = JHTML::_('select.option', 'week', JText::_('WEEKS'));
         $delay[] = JHTML::_('select.option', 'month', JText::_('MONTHS'));
         $return .= '<br/><span id="campaigndelay__num__">' . JText::sprintf('TRIGGER_CAMPAIGN', '<input type="text" name="action[__num__][list][delaynum]" value="0" style="width:50px" />', JHTML::_('select.genericlist', $delay, "action[__num__][list][delaytype]", 'class="inputbox" size="1"', 'value', 'text')) . '</span>';
     }
     $return .= '</div>';
     return $return;
 }
示例#3
0
 function trigger($triggerName)
 {
     if (!acymailing_level(3)) {
         return;
     }
     $config = acymailing_config();
     if (!$config->get('triggerfilter_' . $triggerName)) {
         return;
     }
     $this->database->setQuery("SELECT * FROM `#__acymailing_filter` WHERE `trigger` LIKE '%" . acymailing_getEscaped($triggerName, true) . "%' ORDER BY filid ASC");
     $filters = $this->database->loadObjectList();
     if (empty($filters)) {
         $newconfig = new stdClass();
         $name = 'triggerfilter_' . $triggerName;
         $newconfig->{$name} = 0;
         $config->save($newconfig);
         return;
     }
     foreach ($filters as $oneFilter) {
         if (empty($oneFilter->published)) {
             continue;
         }
         if (!empty($oneFilter->filter)) {
             $oneFilter->filter = unserialize($oneFilter->filter);
         }
         if (!empty($oneFilter->action)) {
             $oneFilter->action = unserialize($oneFilter->action);
         }
         $this->execute($oneFilter->filter, $oneFilter->action);
     }
 }
示例#4
0
 function listing()
 {
     $app = JFactory::getApplication();
     global $Itemid;
     $config = acymailing_config();
     $jsite = JFactory::getApplication('site');
     $menus = $jsite->getMenu();
     $menu = $menus->getActive();
     if (empty($menu) and !empty($Itemid)) {
         $menus->setActive($Itemid);
         $menu = $menus->getItem($Itemid);
     }
     if (empty($menu)) {
         acymailing_enqueueMessage(JText::_('ACY_NOTALLOWED'));
         $app->redirect('index.php');
     }
     $selectedLists = 'all';
     if (is_object($menu)) {
         jimport('joomla.html.parameter');
         $menuparams = new acyParameter($menu->params);
         $this->assign('listsintrotext', $menuparams->get('listsintrotext'));
         $this->assign('listsfinaltext', $menuparams->get('listsfinaltext'));
         $selectedLists = $menuparams->get('lists', 'all');
         $document = JFactory::getDocument();
         if ($menuparams->get('menu-meta_description')) {
             $document->setDescription($menuparams->get('menu-meta_description'));
         }
         if ($menuparams->get('menu-meta_keywords')) {
             $document->setMetadata('keywords', $menuparams->get('menu-meta_keywords'));
         }
         if ($menuparams->get('robots')) {
             $document->setMetadata('robots', $menuparams->get('robots'));
         }
         if ($menuparams->get('page_title')) {
             acymailing_setPageTitle($menuparams->get('page_title'));
         }
     }
     if (empty($menuparams)) {
         $pathway = $app->getPathway();
         $pathway->addItem(JText::_('MAILING_LISTS'));
     }
     $document = JFactory::getDocument();
     $link = '&format=feed&limitstart=';
     if ($config->get('acyrss_format') == 'rss' || $config->get('acyrss_format') == 'both') {
         $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0');
         $document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs);
     }
     if ($config->get('acyrss_format') == 'atom' || $config->get('acyrss_format') == 'both') {
         $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0');
         $document->addHeadLink(JRoute::_($link . '&type=atom'), 'alternate', 'rel', $attribs);
     }
     $listsClass = acymailing_get('class.list');
     $allLists = $listsClass->getLists('', $selectedLists);
     if (acymailing_level(1)) {
         $allLists = $listsClass->onlyCurrentLanguage($allLists);
     }
     $myItem = empty($Itemid) ? '' : '&Itemid=' . $Itemid;
     $this->assignRef('rows', $allLists);
     $this->assignRef('item', $myItem);
 }
示例#5
0
 function continuesend()
 {
     $config = acymailing_config();
     if (acymailing_level(1) && $config->get('queue_type') == 'onlyauto') {
         JRequest::setVar('tmpl', 'component');
         acymailing_display(JText::_('ACY_ONLYAUTOPROCESS'), 'warning');
         return;
     }
     $newcrontime = time() + 120;
     if ($config->get('cron_next') < $newcrontime) {
         $newValue = new stdClass();
         $newValue->cron_next = $newcrontime;
         $config->save($newValue);
     }
     $mailid = acymailing_getCID('mailid');
     $totalSend = JRequest::getVar('totalsend', 0, '', 'int');
     $alreadySent = JRequest::getVar('alreadysent', 0, '', 'int');
     $helperQueue = acymailing_get('helper.queue');
     $helperQueue->mailid = $mailid;
     $helperQueue->report = true;
     $helperQueue->total = $totalSend;
     $helperQueue->start = $alreadySent;
     $helperQueue->pause = $config->get('queue_pause');
     $helperQueue->process();
     JRequest::setVar('tmpl', 'component');
 }
示例#6
0
文件: list.php 项目: utopszkij/lmp
	function unsubscribe($subid,$listids){
		$app = JFactory::getApplication();

		if(acymailing_level(3)){
			$campaignClass = acymailing_get('helper.campaign');
			$campaignClass->stop($subid,$listids);
		}

		$config = acymailing_config();
		static $alreadySent = false;
		if($this->sendNotif AND !$alreadySent AND $config->get('notification_unsub') AND !$app->isAdmin()){
			$alreadySent = true;
			$mailer = acymailing_get('helper.mailer');
			$mailer->report = false;
			$mailer->autoAddUser = true;
			$mailer->checkConfirmField = false;
			$userClass = acymailing_get('class.subscriber');
			$subscriber = $userClass->get($subid);
			$ipClass = acymailing_get('helper.user');
			$mailer->addParam('survey',$this->survey);
			$listSubClass= acymailing_get('class.listsub');
			$mailer->addParam('user:subscription',$listSubClass->getSubscriptionString($subscriber->subid));
			$mailer->addParamInfo();
			$subscriber->ip = $ipClass->getIP();
			foreach($subscriber as $fieldname => $value) $mailer->addParam('user:'******',',$config->get('notification_unsub'));
			foreach($allUsers as $oneUser){
				$mailer->sendOne('notification_unsub',$oneUser);
			}
		}

		$db = JFactory::getDBO();

		if($this->forceConf || ($this->sendConf AND !$app->isAdmin())){
			$db->setQuery('SELECT DISTINCT `unsubmailid` FROM '.acymailing_table('list').' WHERE `listid` IN ('.implode(',',$listids).') AND `published` = 1  AND `unsubmailid` > 0');
			$messages = acymailing_loadResultArray($db);

			if(!empty($messages)){
				$config = acymailing_config();
				$mailHelper = acymailing_get('helper.mailer');
				$mailHelper->report = $config->get('unsub_message',true);
				$mailHelper->checkAccept = false;
				foreach($messages as $mailid){
					$mailHelper->trackEmail = true;
					$mailHelper->sendOne($mailid,$subid);
				}
			}
		}//end only frontend

		$db->setQuery('DELETE  FROM '.acymailing_table('queue').' WHERE `subid` = '.(int) $subid.' AND `mailid` IN (SELECT `mailid` FROM '.acymailing_table('listmail').' WHERE `listid` IN ('.implode(',',$listids).'))');
		$db->query();

		JPluginHelper::importPlugin('acymailing');
		$dispatcher = JDispatcher::getInstance();
		$resultsTrigger = $dispatcher->trigger('onAcyUnsubscribe',array($subid,$listids));
	}
示例#7
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();
 }
 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();
 }
示例#9
0
 function deliverstatusType()
 {
     $this->values = array();
     $this->values[] = JHTML::_('select.option', '0', JText::_('ALL_STATUS'));
     $this->values[] = JHTML::_('select.option', 'open', JText::_('OPEN'));
     $this->values[] = JHTML::_('select.option', 'notopen', JText::_('NOT_OPEN'));
     $this->values[] = JHTML::_('select.option', 'failed', JText::_('FAILED'));
     if (acymailing_level(3)) {
         $this->values[] = JHTML::_('select.option', 'bounce', JText::_('BOUNCES'));
     }
 }
示例#10
0
 function onAcyDisplayActions(&$type)
 {
     $type['list'] = JText::_('ACYMAILING_LIST');
     $status = array();
     $status[] = JHTML::_('select.option', 1, JText::_('SUBSCRIBE_TO'));
     $status[] = JHTML::_('select.option', 0, JText::_('REMOVE_FROM'));
     $status[] = JHTML::_('select.option', -1, JText::_('ACY_UNSUB_FROM'));
     $lists = $this->_getLists();
     $otherlists = array();
     $onChange = '';
     if (acymailing_level(3)) {
         $db = JFactory::getDBO();
         $db->setQuery('SELECT b.listid, b.name FROM #__acymailing_listcampaign as a JOIN #__acymailing_list as b on a.listid = b.listid GROUP BY b.listid ORDER BY b.ordering ASC');
         $otherlists = $db->loadObjectList('listid');
         $onChange = 'onchange="onAcyDisplayAction_list(__num__);"';
         $js = "function onAcyDisplayAction_list(num){\r\n\t\t\t\tif(!document.getElementById('campaigndelay'+num)) return;\r\n\t\t\t\tif(document.getElementById('subliststatus'+num).value == 1 && document.getElementById('sublistvalue'+num).value.indexOf('_campaign') > 0){\r\n\t\t\t\t\tdocument.getElementById('campaigndelay'+num).style.display = 'inline';\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdocument.getElementById('campaigndelay'+num).style.display = 'none';\r\n\t\t\t\t}\r\n\t\t\t}";
         $doc = JFactory::getDocument();
         $doc->addScriptDeclaration($js);
     }
     $listsdrop = array();
     foreach ($lists as $oneList) {
         if (!empty($otherlists[$oneList->listid])) {
             $listsdrop[] = JHTML::_('select.option', $oneList->listid . '_campaign', $otherlists[$oneList->listid]->name . ' + ' . JText::_('CAMPAIGN'));
         }
         $listsdrop[] = JHTML::_('select.option', $oneList->listid, $oneList->name);
     }
     $return = '<div id="action__num__list">' . JHTML::_('select.genericlist', $status, "action[__num__][list][status]", 'class="inputbox" size="1" ' . $onChange, 'value', 'text', '', 'subliststatus__num__') . ' ' . JHTML::_('select.genericlist', $listsdrop, "action[__num__][list][selectedlist]", 'class="inputbox" size="1" ' . $onChange, 'value', 'text', '', 'sublistvalue__num__');
     if (!empty($otherlists)) {
         $delay = array();
         $delay[] = JHTML::_('select.option', 'day', JText::_('DAYS'));
         $delay[] = JHTML::_('select.option', 'week', JText::_('WEEKS'));
         $delay[] = JHTML::_('select.option', 'month', JText::_('MONTHS'));
         $listHours = array();
         $listHours[] = JHTML::_('select.option', '', '- -');
         for ($i = 0; $i < 24; $i++) {
             $listHours[] = JHTML::_('select.option', $i < 10 ? '0' . $i : $i, $i < 10 ? '0' . $i : $i);
         }
         $hours = JHTML::_('select.genericlist', $listHours, 'action[__num__][list][sendhours]', 'class="inputbox" size="1" style="width:60px;"', 'value', 'text', '');
         $listMinutess = array();
         $listMinutess[] = JHTML::_('select.option', '', '- -');
         for ($i = 0; $i < 60; $i += 5) {
             $listMinutess[] = JHTML::_('select.option', $i < 10 ? '0' . $i : $i, $i < 10 ? '0' . $i : $i);
         }
         $minutes = JHTML::_('select.genericlist', $listMinutess, 'action[__num__][list][sendminutes]', 'class="inputbox" size="1" style="width:60px;"', 'value', 'text', '');
         $return .= '<br /><span id="campaigndelay__num__">' . JText::sprintf('TRIGGER_CAMPAIGN', '<input type="text" name="action[__num__][list][delaynum]" value="0" style="width:50px" />', JHTML::_('select.genericlist', $delay, "action[__num__][list][delaytype]", 'class="inputbox" size="1" style="width:120px;"', 'value', 'text')) . ' @ ' . $hours . ' : ' . $minutes;
         $return .= '<br />' . JText::sprintf('ACY_CAMPAIGN_NB_FOLLOW_SKIPED', '<input type="text" name="action[__num__][list][skipedfollowups]" value="0" style="width:25px;" />') . '</span>';
     }
     $return .= '</div>';
     return $return;
 }
示例#11
0
 function addSubscription($subid, $lists)
 {
     $app =& JFactory::getApplication();
     $my = JFactory::getUser();
     $result = true;
     $time = time();
     $subid = intval($subid);
     $listHelper = acymailing_get('helper.list');
     foreach ($lists as $status => $listids) {
         $status = intval($status);
         JArrayHelper::toInteger($listids);
         $this->database->setQuery('SELECT `listid`,`access_sub` FROM ' . acymailing_table('list') . ' WHERE `listid` IN (' . implode(',', $listids) . ') AND `type` = \'list\'');
         $allResults = $this->database->loadObjectList('listid');
         $listids = array_keys($allResults);
         //-1 is unsubscribe
         if ($status == '-1') {
             $column = 'unsubdate';
         } else {
             $column = 'subdate';
         }
         $values = array();
         foreach ($listids as $listid) {
             if (empty($listid)) {
                 continue;
             }
             if ($status > 0 && acymailing_level(3)) {
                 if (!$app->isAdmin() && $this->checkAccess && $allResults[$listid]->access_sub != 'all') {
                     if (!acymailing_isAllowed($allResults[$listid]->access_sub, $this->gid)) {
                         continue;
                     }
                 }
             }
             $values[] = intval($listid) . ',' . $subid . ',' . $status . ',' . $time;
         }
         if (empty($values)) {
             continue;
         }
         $query = 'INSERT INTO ' . acymailing_table('listsub') . ' (listid,subid,`status`,' . $column . ') VALUES (' . implode('),(', $values) . ')';
         $this->database->setQuery($query);
         $result = $this->database->query() && $result;
         if ($status == 1) {
             $listHelper->subscribe($subid, $listids);
         }
     }
     return $result;
 }
示例#12
0
 function onAcyDisplayActions(&$type)
 {
     $type['list'] = JText::_('ACYMAILING_LIST');
     $status = array();
     $status[] = JHTML::_('select.option', 1, JText::_('SUBSCRIBE_TO'));
     $status[] = JHTML::_('select.option', 0, JText::_('REMOVE_FROM'));
     $lists = $this->_getLists();
     $otherlists = array();
     if (acymailing_level(3)) {
         $db = JFactory::getDBO();
         $db->setQuery('SELECT b.listid, b.name FROM #__acymailing_listcampaign as a LEFT JOIN #__acymailing_list as b on a.listid = b.listid GROUP BY b.listid ORDER BY b.ordering ASC');
         $otherlists = $db->loadObjectList('listid');
     }
     $listsdrop = array();
     foreach ($lists as $oneList) {
         $listsdrop[] = JHTML::_('select.option', $oneList->listid, $oneList->name);
         if (!empty($otherlists[$oneList->listid])) {
             $listsdrop[] = JHTML::_('select.option', $oneList->listid . '_campaign', $otherlists[$oneList->listid]->name . ' + ' . JText::_('CAMPAIGN'));
         }
     }
     return '<div id="action__num__list">' . JHTML::_('select.genericlist', $status, "action[__num__][list][status]", 'class="inputbox" size="1"', 'value', 'text') . ' ' . JHTML::_('select.genericlist', $listsdrop, "action[__num__][list][selectedlist]", 'class="inputbox" size="1"', 'value', 'text') . '</div>';
 }
示例#13
0
 function getDefault()
 {
     $queryDefaultTemp = 'SELECT * FROM ' . acymailing_table('template') . ' WHERE premium = 1 AND published = 1 ORDER BY ordering ASC LIMIT 1';
     if (acymailing_level(3)) {
         $my = JFactory::getUser();
         if (!ACYMAILING_J16) {
             $groups = $my->gid;
             $condGroup = ' OR access LIKE (\'%,' . $groups . ',%\')';
         } else {
             jimport('joomla.access.access');
             $groups = JAccess::getGroupsByUser($my->id, false);
             $condGroup = '';
             foreach ($groups as $group) {
                 $condGroup .= ' OR access LIKE (\'%,' . $group . ',%\')';
             }
         }
         $queryDefaultTemp = 'SELECT * FROM ' . acymailing_table('template') . ' WHERE premium = 1 AND published = 1  AND (access = \'all\' ' . $condGroup . ') ORDER BY ordering ASC LIMIT 1';
     }
     $this->database->setQuery($queryDefaultTemp);
     $template = $this->database->loadObject();
     return $this->_prepareTemplate($template);
 }
示例#14
0
    function form()
    {
        $listid = acymailing_getCID('listid');
        $listClass = acymailing_get('class.list');
        if (!empty($listid)) {
            $list = $listClass->get($listid);
            if (empty($list->listid)) {
                acymailing_display('List ' . $listid . ' not found', 'error');
                $listid = 0;
            }
        }
        if (empty($listid)) {
            $list = new stdClass();
            $list->visible = 1;
            $list->description = '';
            $list->category = '';
            $list->published = 1;
            $user = JFactory::getUser();
            $list->creatorname = $user->name;
            $list->access_manage = 'none';
            $list->access_sub = 'all';
            $list->languages = 'all';
            $colors = array('#3366ff', '#7240A4', '#7A157D', '#157D69', '#ECE649');
            $list->color = $colors[rand(0, count($colors) - 1)];
        }
        $editor = acymailing_get('helper.editor');
        $editor->name = 'editor_description';
        $editor->content = $list->description;
        $editor->setDescription();
        if (!ACYMAILING_J16) {
            $script = 'function submitbutton(pressbutton){
						if (pressbutton == \'cancel\') {
							submitform( pressbutton );
							return;
						}';
        } else {
            $script = 'Joomla.submitbutton = function(pressbutton) {
						if (pressbutton == \'cancel\') {
							Joomla.submitform(pressbutton,document.adminForm);
							return;
						}';
        }
        $script .= 'if(window.document.getElementById("name").value.length < 2){alert(\'' . JText::_('ENTER_TITLE', true) . '\'); return false;}';
        $script .= $editor->jsCode();
        if (!ACYMAILING_J16) {
            $script .= 'submitform( pressbutton );}';
        } else {
            $script .= 'Joomla.submitform(pressbutton,document.adminForm);}; ';
        }
        $script .= 'function affectUser(idcreator,name,email){
			window.document.getElementById("creatorname").innerHTML = name;
			window.document.getElementById("listcreator").value = idcreator;
		}';
        $doc = JFactory::getDocument();
        $doc->addScriptDeclaration($script);
        $colorBox = acymailing_get('type.color');
        acymailing_setTitle(JText::_('LIST'), 'acylist', 'list&task=edit&listid=' . $listid);
        $bar = JToolBar::getInstance('toolbar');
        JToolBarHelper::save();
        JToolBarHelper::apply();
        JToolBarHelper::cancel();
        JToolBarHelper::divider();
        $bar->appendButton('Pophelp', 'list-form');
        $this->assignRef('colorBox', $colorBox);
        if (acymailing_level(1)) {
            $this->assign('welcomeMsg', acymailing_get('type.welcome'));
            $this->assign('languages', acymailing_get('type.listslanguages'));
        }
        $unsubMsg = acymailing_get('type.unsub');
        $this->assignRef('unsubMsg', $unsubMsg);
        $this->assignRef('list', $list);
        $this->assignRef('editor', $editor);
    }
示例#15
0
"/>
								<?php 
            } else {
                echo $fieldsClass->display($extraFields[$oneField], @$identifiedUser->{$oneField}, 'user[' . $oneField . ']', !$displayOutside);
            }
            ?>
								</td><?php 
        }
    } else {
        continue;
    }
    if (!$displayInline) {
        echo '</tr><tr>';
    }
}
if (empty($identifiedUser->userid) and $config->get('captcha_enabled') and acymailing_level(1)) {
    ?>
					<td class="captchakeymodule">
					<?php 
    if (ACYMAILING_J16) {
        $image = '<img id="captcha_picture_' . $formName . '" title="' . JText::_('ERROR_CAPTCHA') . '" width="' . $config->get('captcha_width_module') . '" height="' . $config->get('captcha_height_module') . '" class="captchaimagemodule" src="' . JRoute::_('index.php?option=com_acymailing&ctrl=captcha&acyformname=' . $formName . '&val=' . rand(0, 10000)) . '" alt="captcha" />';
    } else {
        $image = '<img id="captcha_picture_' . $formName . '" title="' . JText::_('ERROR_CAPTCHA') . '" width="' . $config->get('captcha_width_module') . '" height="' . $config->get('captcha_height_module') . '" class="captchaimagemodule" src="' . rtrim(JURI::root(), '/') . '/index.php?option=com_acymailing&amp;ctrl=captcha&amp;acyformname=' . $formName . '&amp;val=' . rand(0, 10000) . '" alt="captcha" />';
    }
    $refreshImg = '<span class="refreshCaptchaModule" onclick="refreshCaptchaModule(\'' . $formName . '\')">&nbsp;</span>';
    if ($displayOutside) {
        echo $image . $refreshImg . '</td><td class="captchafieldmodule">';
    } else {
        echo $image . $refreshImg;
    }
    ?>
示例#16
0
 function spamtest()
 {
     if (!acymailing_level(1)) {
         echo JText::_('ACY_STARTER_SPAMTEST') . ' <a target="_blank" href="https://www.acyba.com/index.php?option=com_updateme&ctrl=redirect&page=acymailing-features">' . JText::_('ACY_FEATURES') . '</a>';
         return;
     }
 }
示例#17
0
																href="<?php 
            echo $urlStat;
            ?>
"><?php 
            echo $this->app->isAdmin() ? '<i class="acyicon-statistic"></i>' : '<img src="' . ACYMAILING_IMAGES . 'icons/icon-16-stats.png" alt="' . JText::_('STATISTICS', true) . '"/>';
            ?>
</a></span>
							<?php 
        }
    }
    ?>
					</td>
					<td align="center" style="text-align:center; width: 18px;">
						<?php 
    if ($this->app->isAdmin()) {
        if (acymailing_level(3) && acymailing_isAllowed($this->config->get('acl_' . $this->aclCat . '_abtesting', 'all')) && !empty($row->abtesting)) {
            $abDetail = unserialize($row->abtesting);
            $urlAbTest = acymailing_completeLink('newsletter&task=abtesting&mailid=' . $abDetail['mailids'], true);
            ?>
								<span class="acyabtestbutton"><a class="modal hasTooltip" data-original-title="<?php 
            echo JText::_('ABTESTING');
            ?>
" rel="{handler: 'iframe', size: {x: 800, y: 590}}"
																 href="<?php 
            echo $urlAbTest;
            ?>
"><?php 
            echo $this->app->isAdmin() ? '<i class="acyicon-ABtesting"></i>' : '<img src="' . ACYMAILING_IMAGES . 'icons/icon-16-acyabtesting.png" alt="' . JText::_('ABTESTING', true) . '"/>';
            ?>
</a></span>
							<?php 
示例#18
0
 function form()
 {
     $subid = acymailing_getCID('subid');
     $db = JFactory::getDBO();
     $app = JFactory::getApplication();
     $config = acymailing_config();
     if (!empty($subid)) {
         $subscriberClass = acymailing_get('class.subscriber');
         $subscriber = $subscriberClass->getFull($subid);
         $subscription = $app->isAdmin() ? $subscriberClass->getSubscription($subid) : $subscriberClass->getFrontendSubscription($subid);
         if (empty($subscriber->subid)) {
             acymailing_display('User ' . $subid . ' not found', 'error');
             $subid = 0;
         }
     }
     if (empty($subid)) {
         $listType = acymailing_get('class.list');
         $subscription = $app->isAdmin() ? $listType->getLists() : $listType->getFrontendLists();
         $subscriber = new stdClass();
         $subscriber->created = time();
         $subscriber->html = 1;
         $subscriber->confirmed = 1;
         $subscriber->blocked = 0;
         $subscriber->accept = 1;
         $subscriber->enabled = 1;
         $iphelper = acymailing_get('helper.user');
         $subscriber->ip = $iphelper->getIP();
     }
     if ($app->isAdmin()) {
         acymailing_setTitle(JText::_('ACY_USER'), 'acyusers', 'subscriber&task=edit&subid=' . $subid);
         $bar = JToolBar::getInstance('toolbar');
     }
     if (!empty($subid)) {
         $query = 'SELECT a.`mailid`, a.`html`, a.`sent`, a.`senddate`,a.`open`, a.`opendate`, a.`bounce`, a.`fail`,b.`subject`,b.`alias`';
         $query .= ' FROM `#__acymailing_userstats` as a';
         $query .= ' JOIN ' . acymailing_table('mail') . ' as b on a.mailid = b.mailid';
         $query .= ' WHERE a.subid = ' . intval($subid) . ' ORDER BY a.senddate DESC LIMIT 30';
         $db->setQuery($query);
         $open = $db->loadObjectList();
         $this->assignRef('open', $open);
         if (acymailing_level(3)) {
             $db->setQuery('SELECT DISTINCT `mailid` FROM `#__acymailing_urlclick` WHERE `subid` = ' . intval($subid));
             $clickedNews = $db->loadObjectList('mailid');
             $this->assignRef('clickedNews', $clickedNews);
         }
         $query = 'SELECT a.*,b.`subject`,b.`alias`';
         $query .= ' FROM `#__acymailing_queue` as a';
         $query .= ' JOIN ' . acymailing_table('mail') . ' as b on a.mailid = b.mailid';
         $query .= ' WHERE a.subid = ' . intval($subid) . ' ORDER BY a.senddate ASC LIMIT 60';
         $db->setQuery($query);
         $queue = $db->loadObjectList();
         $this->assignRef('queue', $queue);
         $query = 'SELECT h.*,m.subject FROM #__acymailing_history as h LEFT JOIN #__acymailing_mail as m ON h.mailid = m.mailid WHERE h.subid = ' . intval($subid) . ' ORDER BY h.`date` DESC LIMIT 30';
         $db->setQuery($query);
         $history = $db->loadObjectList();
         $this->assignRef('history', $history);
         $query = 'SELECT * FROM #__acymailing_geolocation WHERE geolocation_subid=' . intval($subid) . ' ORDER BY geolocation_created DESC LIMIT 100';
         $db->setQuery($query);
         $geoloc = $db->loadObjectList();
         if (!empty($geoloc)) {
             $markCities = array();
             $diffCountries = false;
             $dataDetails = array();
             foreach ($geoloc as $mark) {
                 $indexCity = array_search($mark->geolocation_city, $markCities);
                 if ($indexCity === false) {
                     array_push($markCities, $mark->geolocation_city);
                     array_push($dataDetails, array('nbInCity' => 1, 'actions' => $mark->geolocation_type));
                 } else {
                     $dataDetails[$indexCity]['nbInCity'] += 1;
                     $dataDetails[$indexCity]['actions'] .= ", " . $mark->geolocation_type;
                 }
                 if (!$diffCountries) {
                     if (!empty($region) && $region != $mark->geolocation_country_code) {
                         $region = 'world';
                         $diffCountries = true;
                     } else {
                         $region = $mark->geolocation_country_code;
                     }
                 }
             }
             $this->assignRef('geoloc_region', $region);
             $this->assignRef('geoloc_city', $markCities);
             $this->assignRef('geoloc', $geoloc);
             $this->assignRef('geoloc_details', $dataDetails);
         }
         if (!empty($subscriber->ip)) {
             $query = 'SELECT * FROM #__acymailing_subscriber WHERE ip=' . $db->Quote($subscriber->ip) . ' AND subid != ' . intval($subid) . ' LIMIT 30';
             $db->setQuery($query);
             $neighbours = $db->loadObjectList();
             if (!empty($neighbours)) {
                 $this->assignRef('neighbours', $neighbours);
             }
         }
     }
     if ($app->isAdmin()) {
         if (!empty($subscriber->userid)) {
             if (file_exists(ACYMAILING_ROOT . 'components' . DS . 'com_comprofiler' . DS . 'comprofiler.php')) {
                 $editLink = 'index.php?option=com_comprofiler&task=edit&cid[]=';
             } elseif (!ACYMAILING_J16) {
                 $editLink = 'index.php?option=com_users&task=edit&cid[]=';
             } else {
                 $editLink = 'index.php?option=com_users&task=user.edit&id=';
             }
             $bar->appendButton('Link', 'edit', JText::_('EDIT_JOOMLA_USER'), $editLink . $subscriber->userid);
             JToolBarHelper::spacer();
         }
         JToolBarHelper::save();
         JToolBarHelper::apply();
         if (ACYMAILING_J30) {
             JToolBarHelper::save2new();
         }
         JToolBarHelper::cancel();
         JToolBarHelper::divider();
         $bar->appendButton('Pophelp', 'subscriber-form');
     }
     $filters = new stdClass();
     $quickstatusType = acymailing_get('type.statusquick');
     $filters->statusquick = $quickstatusType->display('statusquick');
     $this->assignRef('subscriber', $subscriber);
     $toggleClass = acymailing_get('helper.toggle');
     $this->assignRef('toggleClass', $toggleClass);
     $this->assignRef('subscription', $subscription);
     $this->assignRef('filters', $filters);
     $statusType = acymailing_get('type.status');
     $this->assignRef('statusType', $statusType);
 }
示例#19
0
    function form()
    {
        $db = JFactory::getDBO();
        $config = acymailing_config();
        if (JRequest::getVar('task') == 'filterDisplayUsers') {
            $action = array();
            $action['type'] = array('displayUsers');
            $action[] = array('displayUsers' => array());
            $filterClass = acymailing_get('class.filter');
            $filterClass->subid = JRequest::getString('subid');
            $filterClass->execute(JRequest::getVar('filter'), $action);
            if (!empty($filterClass->report)) {
                $this->assignRef('filteredUsers', $filterClass->report[0]);
            }
        }
        $filid = acymailing_getCID('filid');
        $filterClass = acymailing_get('class.filter');
        $testFilter = JRequest::getVar('filter');
        if (!empty($filid) && empty($testFilter)) {
            $filter = $filterClass->get($filid);
        } else {
            $filter = new stdClass();
            $filter->action = JRequest::getVar('action');
            $filter->filter = JRequest::getVar('filter');
            $filter->published = 1;
        }
        JPluginHelper::importPlugin('acymailing');
        $this->dispatcher = JDispatcher::getInstance();
        $typesFilters = array();
        $typesActions = array();
        $outputFilters = implode('', $this->dispatcher->trigger('onAcyDisplayFilters', array(&$typesFilters, 'massactions')));
        $outputActions = implode('', $this->dispatcher->trigger('onAcyDisplayActions', array(&$typesActions)));
        $typevaluesFilters = array();
        $typevaluesActions = array();
        $typevaluesFilters[] = JHTML::_('select.option', '', JText::_('FILTER_SELECT'));
        $typevaluesActions[] = JHTML::_('select.option', '', JText::_('ACTION_SELECT'));
        $doc = JFactory::getDocument();
        foreach ($typesFilters as $oneType => $oneName) {
            $typevaluesFilters[] = JHTML::_('select.option', $oneType, $oneName);
        }
        foreach ($typesActions as $oneType => $oneName) {
            $typevaluesActions[] = JHTML::_('select.option', $oneType, $oneName);
        }
        $js = "function updateAction(actionNum){\r\n\t\t\t\tvar actiontype = window.document.getElementById('actiontype'+actionNum);\r\n\t\t\t\tif(actiontype == 'undefined' || actiontype == null) return;\r\n\t\t\t\tcurrentActionType = actiontype.value;\r\n\t\t\t\tif(!currentActionType){\r\n\t\t\t\t\twindow.document.getElementById('actionarea_'+actionNum).innerHTML = '';\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tactionArea = 'action__num__'+currentActionType;\r\n\t\t\t\twindow.document.getElementById('actionarea_'+actionNum).innerHTML = window.document.getElementById(actionArea).innerHTML.replace(/__num__/g,actionNum);\r\n\t\t\t\tif(typeof(window['onAcyDisplayAction_'+currentActionType]) == 'function') {\r\n\t\t\t\t\ttry{ window['onAcyDisplayAction_'+currentActionType](actionNum); }catch(e){alert('Error in the onAcyDisplayAction_'+currentActionType+' function : '+e); }\r\n\t\t\t\t}\r\n\r\n\t\t\t}";
        $js .= "var numActions = 0;\r\n\t\t\t\tfunction addAction(){\r\n\t\t\t\t\tvar newdiv = document.createElement('div');\r\n\t\t\t\t\tnewdiv.id = 'action'+numActions;\r\n\t\t\t\t\tnewdiv.className = 'plugarea';\r\n\t\t\t\t\tnewdiv.innerHTML = document.getElementById('actions_original').innerHTML.replace(/__num__/g, numActions);\r\n\t\t\t\t\tvar allactions = document.getElementById('allactions');\r\n\t\t\t\t\tif(allactions != 'undefined' && allactions != null) allactions.appendChild(newdiv); updateAction(numActions); numActions++;\r\n\t\t\t\t}";
        $js .= "window.addEvent('domready', function(){ addAcyFilter(); addAction(); });";
        if (!ACYMAILING_J16) {
            $js .= 'function submitbutton(pressbutton){
						if (pressbutton != \'save\') {
							submitform( pressbutton );
							return;
						}';
        } else {
            $js .= 'Joomla.submitbutton = function(pressbutton) {
						if (pressbutton != \'save\') {
							Joomla.submitform(pressbutton,document.adminForm);
							return;
						}';
        }
        if (ACYMAILING_J30) {
            $js .= "if(window.document.getElementById('filterinfo').style.display == 'none'){\r\n\t\t\t\t\t\twindow.document.getElementById('filterinfo').style.display = 'block';\r\n\t\t\t\t\t\treturn false;}\r\n\t\t\t\t\tif(window.document.getElementById('title').value.length < 2){alert('" . JText::_('ENTER_TITLE', true) . "'); return false;}";
        } else {
            $js .= "if(window.document.getElementById('filterinfo').style.display == 'none'){\r\n\t\t\t\t\t\twindow.document.getElementById('filterinfo').style.display = 'block';\r\n\t\t\t\t\t\treturn false;}\r\n\t\t\t\t\tif(window.document.getElementById('title').value.length < 2){alert('" . JText::_('ENTER_TITLE', true) . "'); return false;}";
        }
        if (!ACYMAILING_J16) {
            $js .= "submitform( pressbutton );} ";
        } else {
            $js .= "Joomla.submitform(pressbutton,document.adminForm);}; ";
        }
        $doc->addScriptDeclaration($js);
        $filterClass->addJSFilterFunctions();
        $js = '';
        $data = array('addAction' => 'action', 'addAcyFilter' => 'filter');
        foreach ($data as $jsFunction => $datatype) {
            if (empty($filter->{$datatype})) {
                continue;
            }
            foreach ($filter->{$datatype}['type'] as $num => $oneType) {
                if (empty($oneType)) {
                    continue;
                }
                $js .= "while(!document.getElementById('" . $datatype . "type{$num}')){" . $jsFunction . "();}\r\n\t\t\t\t\t\tdocument.getElementById('" . $datatype . "type{$num}').value= '{$oneType}';\r\n\t\t\t\t\t\tupdate" . ucfirst($datatype) . "({$num});";
                if (empty($filter->{$datatype}[$num][$oneType])) {
                    continue;
                }
                foreach ($filter->{$datatype}[$num][$oneType] as $key => $value) {
                    if (is_array($value)) {
                        $js .= "try{";
                        foreach ($value as $subkey => $subval) {
                            $js .= "document.adminForm.elements['" . $datatype . "[{$num}][{$oneType}][{$key}][{$subkey}]'].value = '" . addslashes(str_replace(array("\n", "\r"), ' ', $subval)) . "';";
                            $js .= "if(document.adminForm.elements['" . $datatype . "[{$num}][{$oneType}][{$key}][{$subkey}]'].type && document.adminForm.elements['" . $datatype . "[{$num}][{$oneType}][{$key}][{$subkey}]'].type == 'checkbox'){ document.adminForm.elements['" . $datatype . "[{$num}][{$oneType}][{$key}][{$subkey}]'].checked = 'checked'; }";
                        }
                        $js .= "}catch(e){}";
                    }
                    $myVal = is_array($value) ? implode(',', $value) : $value;
                    $js .= "try{";
                    $js .= "document.adminForm.elements['" . $datatype . "[{$num}][{$oneType}][{$key}]'].value = '" . addslashes(str_replace(array("\n", "\r"), ' ', $myVal)) . "';";
                    $js .= "if(document.adminForm.elements['" . $datatype . "[{$num}][{$oneType}][{$key}]'].type && document.adminForm.elements['" . $datatype . "[{$num}][{$oneType}][{$key}]'].type == 'checkbox'){ document.adminForm.elements['" . $datatype . "[{$num}][{$oneType}][{$key}]'].checked = 'checked'; }";
                    $js .= "}catch(e){}";
                }
                $js .= "\n" . " if(typeof(onAcyDisplay" . ucfirst($datatype) . "_" . $oneType . ") == 'function'){\r\n\t\t\t\t\ttry{ onAcyDisplay" . ucfirst($datatype) . "_" . $oneType . "({$num}); }catch(e){alert('Error in the onAcyDisplay" . ucfirst($datatype) . "_" . $oneType . " function : '+e); }\r\n\t\t\t\t}";
                if ($datatype == 'filter') {
                    $js .= " countresults({$num});";
                }
            }
        }
        $listid = JRequest::getInt('listid');
        if (!empty($listid)) {
            $js .= "document.getElementById('actiontype0').value = 'list'; updateAction(0); document.adminForm.elements['action[0][list][selectedlist]'].value = '" . $listid . "';";
        }
        $doc->addScriptDeclaration("window.addEvent('domready', function(){ {$js} });");
        $triggers = array();
        $triggers['daycron'] = JText::_('AUTO_CRON_FILTER');
        $nextDate = $config->get('cron_plugins_next');
        $listHours = array();
        $listMinutess = array();
        for ($i = 0; $i < 24; $i++) {
            $listHours[] = JHTML::_('select.option', $i, $i < 10 ? '0' . $i : $i);
        }
        $hours = JHTML::_('select.genericlist', $listHours, 'triggerhours', 'class="inputbox" size="1" style="width:60px;"', 'value', 'text', acymailing_getDate($nextDate, 'H'));
        for ($i = 0; $i < 60; $i += 5) {
            $listMinutess[] = JHTML::_('select.option', $i, $i < 10 ? '0' . $i : $i);
        }
        $defaultMin = floor(acymailing_getDate($nextDate, 'i') / 5) * 5;
        $minutes = JHTML::_('select.genericlist', $listMinutess, 'triggerminutes', 'class="inputbox" size="1" style="width:60px;"', 'value', 'text', $defaultMin);
        $this->assign('hours', $hours);
        $this->assign('minutes', $minutes);
        $this->assign('nextDate', !empty($nextDate) ? ' (' . JText::_('NEXT_RUN') . ' : ' . acymailing_getDate($nextDate, '%d %B %Y  %H:%M') . ')' : '');
        $triggers['allcron'] = JText::_('ACY_EACH_TIME');
        $triggers['subcreate'] = JText::_('ON_USER_CREATE');
        $triggers['subchange'] = JText::_('ON_USER_CHANGE');
        $this->dispatcher->trigger('onAcyDisplayTriggers', array(&$triggers));
        $name = empty($filter->name) ? '' : ' : ' . $filter->name;
        if (JRequest::getCmd('tmpl', '') != 'component') {
            $acyToolbar = acymailing::get('helper.toolbar');
            $acyToolbar->custom('filterDisplayUsers', JText::_('FILTER_VIEW_USERS'), 'user', false, '');
            $acyToolbar->custom('process', JText::_('PROCESS'), 'process', false, '');
            $acyToolbar->divider();
            if (acymailing_level(3)) {
                $acyToolbar->save();
                if (!empty($filter->filid)) {
                    $acyToolbar->link(acymailing_completeLink('filter&task=edit&filid=0'), JText::_('ACY_NEW'), 'new');
                }
            }
            $acyToolbar->link(acymailing_completeLink('dashboard'), JText::_('ACY_CLOSE'), 'cancel');
            $acyToolbar->divider();
            $acyToolbar->help('filter');
            $acyToolbar->setTitle(JText::_('ACY_MASS_ACTIONS') . $name, 'filter&task=edit&filid=' . $filid);
            $acyToolbar->display();
        } else {
            acymailing_setPageTitle(JText::_('ACY_MASS_ACTIONS') . $name);
        }
        $subid = JRequest::getString('subid');
        if (!empty($subid)) {
            $subArray = explode(',', trim($subid, ','));
            JArrayHelper::toInteger($subArray);
            $db->setQuery('SELECT `name`,`email` FROM `#__acymailing_subscriber` WHERE `subid` IN (' . implode(',', $subArray) . ')');
            $users = $db->loadObjectList();
            if (!empty($users)) {
                $this->assignRef('users', $users);
                $this->assignRef('subid', $subid);
            }
        }
        $this->assignRef('typevaluesFilters', $typevaluesFilters);
        $this->assignRef('typevaluesActions', $typevaluesActions);
        $this->assignRef('outputFilters', $outputFilters);
        $this->assignRef('outputActions', $outputActions);
        $this->assignRef('filter', $filter);
        $this->assignRef('triggers', $triggers);
        if (JRequest::getCmd('tmpl') == 'component') {
            $doc->addStyleSheet(ACYMAILING_CSS . 'frontendedition.css?v=' . filemtime(ACYMAILING_MEDIA . 'css' . DS . 'frontendedition.css'));
        }
        if (acymailing_level(3) and JRequest::getCmd('tmpl') != 'component') {
            $db->setQuery('SELECT * FROM #__acymailing_filter ORDER BY `published` DESC, `filid` DESC');
            $filters = $db->loadObjectList();
            $toggleClass = acymailing_get('helper.toggle');
            $this->assignRef('toggleClass', $toggleClass);
            $this->assignRef('filters', $filters);
        }
    }
示例#20
0
    } else {
        acymailing_display(JText::_('EMAIL_AFFECT'), 'warning');
    }
} else {
    acymailing_display(JText::sprintf('NB_PENDING_EMAIL', $this->values->nbqueue, '<b><i>' . $this->mail->subject . '</i></b>') . '<br />' . JText::_('SEND_CONTINUE'), 'info');
    ?>
				<input type="hidden" name="totalsend" value="<?php 
    echo $this->values->nbqueue;
    ?>
"/>
			<?php 
}
?>
			<?php 
if (!empty($this->mail->mailid) and (!empty($this->lists) or !empty($this->values->nbqueue))) {
    if (!acymailing_level(1) && $config->get('warningautomaticprocess', 1)) {
        $notremind = '<small style="float:right;margin-right:30px;position:relative;">' . $toggleClass->delete('acymailing_messages_warning', 'warningautomaticprocess_0', 'config', false, JText::_('DONT_REMIND')) . '</small>';
        acymailing_display(JText::_('ACY_WARNING_FREESENDPROCESS') . $notremind, 'warning');
    }
    ?>
				<div style="text-align:center;font-size:14px;padding:20px;">
					<?php 
    if (empty($this->values->nbqueue)) {
        echo JText::sprintf('SENT_TO_NUMBER', '<span style="font-weight:bold;" id="nbreceivers" >' . $nbTotalReceivers . '</span>') . '<br />';
    }
    ?>
					<input class="btn btn-primary" style="padding:10px 30px;margin:5px;font-size:14px;cursor:pointer;" type="submit" value="<?php 
    echo empty($this->values->nbqueue) ? JText::_('SEND') : JText::_('CONTINUE');
    ?>
"/>
				</div>
示例#21
0
	function view(){

		global $Itemid;

		$app = JFactory::getApplication();

		$document = JFactory::getDocument();

		$this->addFeed();



		$pathway = $app->getPathway();
		$my = JFactory::getUser();

		$frontEndManagement = false;
		$listid = acymailing_getCID('listid');

		$values = new stdClass();
		$values->suffix = '';
		$jsite = JFactory::getApplication('site');
		$menus = $jsite->getMenu();
		$menu	= $menus->getActive();

		if(empty($menu) AND !empty($Itemid)){
			$menus->setActive($Itemid);
			$menu	= $menus->getItem($Itemid);
		}

		if (is_object( $menu )) {
			jimport('joomla.html.parameter');
			$menuparams = new acyParameter( $menu->params );
		}

		if(!empty($menuparams)){
			$values->suffix = $menuparams->get('pageclass_sfx','');
		}

		if(empty($listid) && !empty($menuparams)){
			$listid = $menuparams->get('listid');
			if ($menuparams->get('menu-meta_description')) $document->setDescription($menuparams->get('menu-meta_description'));
			if ($menuparams->get('menu-meta_keywords')) $document->setMetadata('keywords',$menuparams->get('menu-meta_keywords'));
			if ($menuparams->get('robots')) $document->setMetadata('robots',$menuparams->get('robots'));
			if ($menuparams->get('page_title')) acymailing_setPageTitle($menuparams->get('page_title'));
		}

		$config = acymailing_config();
		$indexFollow = $config->get('indexFollow', '');
		$tagIndFol = array();
		if(strpos($indexFollow, 'noindex') !== false) $tagIndFol[] = 'noindex';
		if(strpos($indexFollow, 'nofollow') !== false) $tagIndFol[] = 'nofollow';
		if(!empty($tagIndFol)) $document->setMetadata('robots',implode(',',$tagIndFol));

		if(!empty($listid)){
			 $listClass = acymailing_get('class.list');
			 $oneList = $listClass->get($listid);
			 if(!empty($oneList->visible) AND $oneList->published AND (empty($menuparams) || !$menuparams->get('listid'))){
				 $pathway->addItem($oneList->name,acymailing_completeLink('archive&listid='.$oneList->listid.':'.$oneList->alias));
			 }

			 if(!empty($oneList->listid) AND acymailing_level(3)){
				if(!empty($my->id) AND (int)$my->id == (int)$oneList->userid){
					$frontEndManagement = true;
				}
				if(!empty($my->id)){
					if($oneList->access_manage == 'all' OR acymailing_isAllowed($oneList->access_manage)){
						 $frontEndManagement = true;
					}
				}
			}
		}

		$mailid = JRequest::getString('mailid','nomailid');
		if(empty($mailid)){
			die('This is a Newsletter-template... and you can not access the online version of a Newsletter-template!<br />Please <a href="administrator/index.php?option=com_acymailing&ctrl=newsletter&task=edit" >create a Newsletter</a> using your template and then try again your "view it online" link!');
			exit;
		}

		if($mailid == 'nomailid'){
			$db = JFactory::getDBO();
			$query = 'SELECT m.`mailid` FROM `#__acymailing_list` as l JOIN `#__acymailing_listmail` as lm ON l.listid=lm.listid JOIN `#__acymailing_mail` as m on lm.mailid = m.mailid';
			$query .= ' WHERE l.`visible` = 1 AND l.`published` = 1 AND m.`visible`= 1 AND m.`published` = 1 AND m.`type` = "news" AND l.`type` = "list"';
			if(!empty($listid)) $query .= ' AND l.`listid` = '.(int) $listid;
			$query .= ' ORDER BY m.`senddate` DESC, m.`mailid` DESC LIMIT 1';
			$db->setQuery($query);
			$mailid = $db->loadResult();
		}
		$mailid = intval($mailid);
		if(empty($mailid)) return JError::raiseError( 404, 'Newsletter not found');

		$access_sub = true;
		 if(acymailing_level(3)){
			$listmail = acymailing_get('class.listmail');
			$allLists = $listmail->getLists($mailid);
			$access_sub = false;
			if(!empty($allLists)){
				foreach($allLists as $alist){
					if(empty($alist->mailid)) continue;
					if(!$alist->published OR !$alist->visible OR $alist->access_sub == 'none') continue;
					if(acymailing_isAllowed($alist->access_sub)){
						$access_sub = true;
						break;
					}

				}
			}
		}

		$mailClass = acymailing_get('helper.mailer');
		$mailClass->loadedToSend = false;
		$oneMail = $mailClass->load($mailid);

		if(empty($oneMail->mailid)){
			return JError::raiseError( 404, 'Newsletter not found : '.$mailid );
		}

		if(!$frontEndManagement AND (!$access_sub OR !$oneMail->published OR !$oneMail->visible)){
			$key = JRequest::getCmd('key');
			if(empty($key) OR $key !== $oneMail->key){
				$reason = (!$oneMail->published) ? 'Newsletter not published' : (!$oneMail->visible ? 'Newsletter not visible' : (!$access_sub ? 'Access not allowed' : ''));
				$app->enqueueMessage('You can not have access to this e-mail : '.$reason,'error');
				$app->redirect(acymailing_completeLink('lists',false,true));
				return false;
			}
		}

		$fshare = '';
		if(preg_match('#<img[^>]*id="pictshare"[^>]*>#i',$oneMail->body,$pregres) && preg_match('#src="([^"]*)"#i',$pregres[0],$pict)){
			$fshare = $pict[1];
		}elseif(preg_match('#<img[^>]*class="[^"]*pictshare[^"]*"[^>]*>#i',$oneMail->body,$pregres) && preg_match('#src="([^"]*)"#i',$pregres[0],$pict)){
			$fshare = $pict[1];
		}elseif(preg_match('#class="acymailing_content".*(<img[^>]*>)#is',$oneMail->body,$pregres) && preg_match('#src="([^"]*)"#i',$pregres[1],$pict)){
			if(strpos($pregres[1],JText::_('JOOMEXT_READ_MORE')) === false) $fshare = $pict[1];
		}

		if(!empty($fshare)){
			$document->setMetadata('og:image', $fshare);
		}

		$document->setMetadata('og:url',acymailing_frontendLink('index.php?option=com_acymailing&ctrl=archive&task=view&mailid='.$oneMail->mailid,JRequest::getCmd('tmpl') == 'component' ? true : false));
		$document->setMetadata('og:title',$oneMail->subject);
		if(!empty($oneMail->metadesc))$document->setMetadata('og:description',$oneMail->metadesc);

		$subkeys = JRequest::getString('subid',JRequest::getString('sub'));
		if(!empty($subkeys)){
			$db = JFactory::getDBO();
			$subid = intval(substr($subkeys,0,strpos($subkeys,'-')));
			$subkey = substr($subkeys,strpos($subkeys,'-')+1);
			$db->setQuery('SELECT * FROM '.acymailing_table('subscriber').' WHERE `subid` = '.$db->Quote($subid).' AND `key` = '.$db->Quote($subkey).' LIMIT 1');
			$receiver = $db->loadObject();
		}

		if(empty($receiver) AND !empty($my->email)){
			$userClass = acymailing_get('class.subscriber');
			$receiver = $userClass->get($my->email);
		}

		if(empty($receiver)){
			$receiver = new stdClass();
			$receiver->name = JText::_('VISITOR');
		}

		$oneMail->sendHTML = true;
		$mailClass->dispatcher->trigger('acymailing_replaceusertags',array(&$oneMail,&$receiver,false));

		$pathway->addItem($oneMail->subject);

		$document	= JFactory::getDocument();
		acymailing_setPageTitle($oneMail->subject);

		if (!empty($oneMail->metadesc)) {
			$document->setDescription( $oneMail->metadesc );
		}
		if (!empty($oneMail->metakey)) {
			$document->setMetadata('keywords', $oneMail->metakey);
		}

		$this->assignRef('mail',$oneMail);
		$this->assignRef('frontEndManagement',$frontEndManagement);
		$this->assignRef('list',$oneList);
		$config =& acymailing_config();
		$this->assignRef('config',$config);
		$this->assignRef('my',$my);
		$this->assignRef('receiver',$receiver);
		$this->assignRef('values',$values);

		if($oneMail->html){
			$templateClass = acymailing_get('class.template');
			$templateClass->archiveSection = true;
			$templateClass->displayPreview('newsletter_preview_area',$oneMail->tempid,$oneMail->subject);
		}
	}
示例#22
0
                if ($oneLang == 'all') {
                    continue;
                }
                $selectList[] = JHTML::_('select.option', $oneLang, ucfirst($oneLang));
            }
            $selectList[] = JHTML::_('select.option', 'all', JText::_('ACY_ALL'));
            echo JHTML::_('acyselect.radiolist', $selectList, "selectlists", 'onclick="updateStatus(this.value);"', 'value', 'text');
            ?>
					</td></tr>
			<?php 
        }
        ?>
			</tbody>
		</table>
		<?php 
        if (acymailing_level(2) && acymailing_isAllowed($this->config->get('acl_lists_filter', 'all'))) {
            include_once dirname(__FILE__) . DS . 'filters.php';
        }
        ?>
		<?php 
    }
    if (!acymailing_isAllowed($this->config->get('acl_newsletters_lists', 'all')) || $this->type == 'joomlanotification') {
        echo '</div>';
    } else {
        echo $this->tabs->endPanel();
    }
    if (acymailing_isAllowed($this->config->get('acl_newsletters_attachments', 'all'))) {
        echo $this->tabs->startPanel(JText::_('ATTACHMENTS'), 'mail_attachments');
        ?>
			<br style="font-size:1px"/>
			<?php 
示例#23
0
 public function myacymailingarea()
 {
     $this->_addAjaxScript();
     $config = acymailing_config();
     $menu = '<div id="myacymailing_level">' . ACYMAILING_NAME . ' ' . $config->get('level') . ' : ' . $config->get('version') . '</div><div id="myacymailing_version">';
     $currentVersion = $config->get('version', '');
     $latestVersion = $config->get('latestversion', '');
     if ($currentVersion >= $latestVersion) {
         $menu .= '<div class="acyversion_uptodate myacymailingbuttons">' . JText::_('ACY_LATEST_VERSION_OK') . '</div>';
     } elseif (!empty($latestVersion)) {
         $menu .= '<div class="acyversion_needtoupdate myacymailingbuttons"><a class="acy_updateversion" href="' . ACYMAILING_REDIRECT . 'update-acymailing-' . $config->get('level') . '" target="_blank"><i class="acyicon-import"></i>' . JText::sprintf('ACY_UPDATE_NOW', $latestVersion) . '</a></div>';
     }
     $menu .= '</div>';
     if (acymailing_level(1)) {
         $expirationDate = $config->get('expirationdate', '');
         if (empty($expirationDate) || $expirationDate == -1) {
             $menu .= '<div id="myacymailing_expiration"></div>';
         } elseif ($expirationDate == -2) {
             $menu .= '<div id="myacymailing_expiration"><div class="acylicence_expired"><span style="color:#c2d5f3; line-height: 16px;">' . JText::_('ACY_ATTACH_LICENCE') . ' :</span><div><a class="acy_attachlicence myacymailingbuttons" href="' . ACYMAILING_REDIRECT . 'acymailing-assign" target="_blank"><i class="acyicon-attach"></i>' . JText::_('ACY_ATTACH_LICENCE_BUTTON') . '</a></div></div></div>';
         } elseif ($expirationDate < time()) {
             $menu .= '<div id="myacymailing_expiration"><div class="acylicence_expired"><span class="acylicenceinfo">' . JText::_('ACY_SUBSCRIPTION_EXPIRED') . '</span><a class="acy_subscriptionexpired myacymailingbuttons" href="' . ACYMAILING_REDIRECT . 'renew-acymailing-' . $config->get('level') . '" target="_blank"><i class="acyicon-renew"></i>' . JText::_('ACY_SUBSCRIPTION_EXPIRED_LINK') . '</a></div></div>';
         } else {
             $menu .= '<div id="myacymailing_expiration"><div class="acylicence_valid myacymailingbuttons"><span class="acy_subscriptionok">' . JText::_('ACY_VALID_UNTIL') . ' : ' . acymailing_getDate($expirationDate, 'DATE_FORMAT_LC4') . '</span></div></div>';
         }
     }
     $menu .= '<div class="myacymailingbuttons"><button onclick="checkForNewVersion()"><i class="acyicon-search"></i>' . JText::_('ACY_CHECK_MY_VERSION') . '</button></div>';
     return $menu;
 }
示例#24
0
 private function _handleError()
 {
     $this->finish = true;
     $message = JText::_('SEND_STOPED');
     $message .= '<br/>';
     $message .= JText::_('SEND_KEPT_ALL');
     $message .= '<br/>';
     if ($this->report) {
         if (empty($this->successSend) and empty($this->start)) {
             $message .= JText::_('SEND_CHECKONE');
             $message .= '<br/>';
             $message .= JText::_('SEND_ADVISE_LIMITATION');
         } else {
             $message .= JText::_('SEND_REFUSE');
             $message .= '<br/>';
             if (!acymailing_level(1)) {
                 $message .= JText::_('SEND_CONTINUE_COMMERCIAL');
             } else {
                 $message .= JText::_('SEND_CONTINUE_AUTO');
             }
         }
     }
     $this->_display($message);
 }
示例#25
0
 function process()
 {
     $mailid = acymailing_getCID('mailid');
     $queueClass = acymailing_get('class.queue');
     $queueStatus = $queueClass->queueStatus($mailid);
     $nextqueue = $queueClass->queueStatus($mailid, true);
     if (acymailing_level(1)) {
         $scheduleClass = acymailing_get('helper.schedule');
         $scheduleNewsletter = $scheduleClass->getScheduled();
         $this->assignRef('schedNews', $scheduleNewsletter);
     }
     if (empty($queueStatus) and empty($scheduleNewsletter)) {
         acymailing_display(JText::_('NO_PROCESS'), 'info');
     }
     $infos = new stdClass();
     $infos->mailid = $mailid;
     $this->assignRef('queue', $queueStatus);
     $this->assignRef('nextqueue', $nextqueue);
     $this->assignRef('infos', $infos);
 }
示例#26
0
 function display($selected = '')
 {
     if (!ACYMAILING_J16) {
         $doc = JFactory::getDocument();
         $doc->addStyleDeclaration(" #submenu-box{display:none !important;} ");
     }
     $selected = substr($selected, 0, 5);
     if ($selected == 'field' || $selected == 'bounc' || $selected == 'updat') {
         $selected = 'cpane';
     }
     if ($selected == 'data' || $selected == 'data&') {
         $selected = 'subsc';
     }
     if ($selected == 'campa' || $selected == 'templ' || $selected == 'auton') {
         $selected = 'newsl';
     }
     if ($selected == 'diagr') {
         $selected = 'stats';
     }
     if ($selected == 'filte') {
         $selected = 'list';
     }
     $config = acymailing_config();
     $mainmenu = array();
     $submenu = array();
     if (acymailing_isAllowed($config->get('acl_subscriber_manage', 'all'))) {
         $mainmenu['subscriber'] = array(JText::_('USERS'), 'index.php?option=com_acymailing&ctrl=subscriber', 'acyicon-16-users');
         $submenu['subscriber'] = array();
         $submenu['subscriber'][] = array(JText::_('USERS'), 'index.php?option=com_acymailing&ctrl=subscriber', 'acyicon-16-users');
         if (acymailing_isAllowed($config->get('acl_subscriber_import', 'all'))) {
             $submenu['subscriber'][] = array(JText::_('IMPORT'), 'index.php?option=com_acymailing&ctrl=data&task=import', 'acyicon-16-import');
         }
         if (acymailing_isAllowed($config->get('acl_subscriber_export', 'all'))) {
             $submenu['subscriber'][] = array(JText::_('ACY_EXPORT'), 'index.php?option=com_acymailing&ctrl=data&task=export', 'acyicon-16-export');
         }
     }
     if (acymailing_isAllowed($config->get('acl_lists_manage', 'all'))) {
         $mainmenu['list'] = array(JText::_('LISTS'), 'index.php?option=com_acymailing&ctrl=list', 'acyicon-16-acylist');
         $submenu['list'] = array();
         $submenu['list'][] = array(JText::_('LISTS'), 'index.php?option=com_acymailing&ctrl=list', 'acyicon-16-acylist');
         if (acymailing_isAllowed($config->get('acl_lists_filter', 'all'))) {
             $submenu['list'][] = array(JText::_('ACY_FILTERS'), 'index.php?option=com_acymailing&ctrl=filter', 'acyicon-16-filter');
         }
     }
     if (acymailing_isAllowed($config->get('acl_newsletters_manage', 'all'))) {
         $mainmenu['newsletter'] = array(JText::_('NEWSLETTERS'), 'index.php?option=com_acymailing&ctrl=newsletter', 'acyicon-16-newsletter');
         $submenu['newsletter'] = array();
         $submenu['newsletter'][] = array(JText::_('NEWSLETTERS'), 'index.php?option=com_acymailing&ctrl=newsletter', 'acyicon-16-newsletter');
         if (acymailing_level(2) && acymailing_isAllowed($config->get('acl_autonewsletters_manage', 'all'))) {
             $submenu['newsletter'][] = array(JText::_('AUTONEWSLETTERS'), 'index.php?option=com_acymailing&ctrl=autonews', 'acyicon-16-autonewsletter');
         }
         if (acymailing_level(3) && acymailing_isAllowed($config->get('acl_campaign_manage', 'all'))) {
             $submenu['newsletter'][] = array(JText::_('CAMPAIGN'), 'index.php?option=com_acymailing&ctrl=campaign', 'acyicon-16-campaign');
         }
         if (acymailing_isAllowed($config->get('acl_templates_manage', 'all'))) {
             $submenu['newsletter'][] = array(JText::_('ACY_TEMPLATES'), 'index.php?option=com_acymailing&ctrl=template', 'acyicon-16-template');
         }
     }
     if (acymailing_isAllowed($config->get('acl_queue_manage', 'all'))) {
         $mainmenu['queue'] = array(JText::_('QUEUE'), 'index.php?option=com_acymailing&ctrl=queue', 'acyicon-16-queue');
     }
     if (acymailing_isAllowed($config->get('acl_statistics_manage', 'all'))) {
         $mainmenu['stats'] = array(JText::_('STATISTICS'), 'index.php?option=com_acymailing&ctrl=stats', 'acyicon-16-stats');
         $submenu['stats'] = array();
         $submenu['stats'][] = array(JText::_('STATISTICS'), 'index.php?option=com_acymailing&ctrl=stats', 'acyicon-16-stats');
         $submenu['stats'][] = array(JText::_('DETAILED_STATISTICS'), 'index.php?option=com_acymailing&ctrl=stats&task=detaillisting', 'acyicon-16-stats');
         if (acymailing_level(1)) {
             $submenu['stats'][] = array(JText::_('CLICK_STATISTICS'), 'index.php?option=com_acymailing&ctrl=statsurl', 'acyicon-16-stats');
         }
         if (acymailing_level(1)) {
             $submenu['stats'][] = array(JText::_('CHARTS'), 'index.php?option=com_acymailing&ctrl=diagram', 'acyicon-16-stats');
         }
     }
     if (acymailing_isAllowed($config->get('acl_configuration_manage', 'all')) && (!ACYMAILING_J16 || JFactory::getUser()->authorise('core.admin', 'com_acymailing'))) {
         $mainmenu['cpanel'] = array(JText::_('CONFIGURATION'), 'index.php?option=com_acymailing&ctrl=cpanel', 'acyicon-16-config');
         $submenu['cpanel'] = array();
         $submenu['cpanel'][] = array(JText::_('CONFIGURATION'), 'index.php?option=com_acymailing&ctrl=cpanel', 'acyicon-16-config');
         if (acymailing_level(3)) {
             $submenu['cpanel'][] = array(JText::_('EXTRA_FIELDS'), 'index.php?option=com_acymailing&ctrl=fields', 'acyicon-16-fields');
             $submenu['cpanel'][] = array(JText::_('BOUNCE_HANDLING'), 'index.php?option=com_acymailing&ctrl=bounces', 'acyicon-16-bounces');
         }
         if (acymailing_level(1)) {
             $submenu['cpanel'][] = array(JText::_('JOOMLA_NOTIFICATIONS'), 'index.php?option=com_acymailing&ctrl=notification', 'acyicon-16-joomlanotification');
         }
         $submenu['cpanel'][] = array(JText::_('UPDATE_ABOUT'), 'index.php?option=com_acymailing&ctrl=update', 'acyicon-16-update');
     }
     $doc = JFactory::getDocument();
     $doc->addStyleSheet(ACYMAILING_CSS . 'acymenu.css?v=' . str_replace('.', '', $config->get('version')));
     if (!ACYMAILING_J30) {
         $menu = '<div id="acymenutop" class="donotprint"><ul>';
         foreach ($mainmenu as $id => $oneMenu) {
             $menu .= '<li class="acymainmenu' . (!empty($submenu[$id]) ? ' parentmenu' : ' singlemenu') . '"';
             if ($selected == substr($id, 0, 5)) {
                 $menu .= ' id="acyselectedmenu"';
             }
             $menu .= ' >';
             $menu .= '<a class="acymainmenulink ' . $oneMenu[2] . '" href="' . $oneMenu[1] . '" >' . $oneMenu[0] . '</a>';
             if (!empty($submenu[$id])) {
                 $menu .= '<ul>';
                 foreach ($submenu[$id] as $subelement) {
                     $menu .= '<li class="acysubmenu "><a class="acysubmenulink ' . $subelement[2] . '" href="' . $subelement[1] . '" title="' . $subelement[0] . '">' . $subelement[0] . '</a></li>';
                 }
                 $menu .= '</ul>';
             }
             $menu .= '</li>';
         }
         $menu .= '</ul></div><div style="clear:left"></div>';
     } else {
         $menu = '<div id="acynavbar" class="navbar"><div class="navbar-inner" style="display:block !important;"><div class="container"><div class="nav"><ul id="acymenutop_j3" class="nav">';
         foreach ($mainmenu as $id => $oneMenu) {
             $sel = '';
             if ($selected == substr($id, 0, 5)) {
                 $sel = ' sel';
             }
             $menu .= '<li class="dropdown' . $sel . '"><a class="dropdown-toggle' . $sel . '" ' . (!empty($submenu[$id]) ? 'data-toggle="dropdown"' : '') . ' href="' . (!empty($submenu[$id]) ? '#' : $oneMenu[1]) . '"><i class="' . $oneMenu[2] . '"></i> ' . $oneMenu[0] . (!empty($submenu[$id]) ? '<span class="caret"></span>' : '') . '</a>';
             if (!empty($submenu[$id])) {
                 $menu .= '<ul class="dropdown-menu">';
                 foreach ($submenu[$id] as $subelement) {
                     $menu .= '<li class="acysubmenu "><a class="acysubmenulink" href="' . $subelement[1] . '" title="' . $subelement[0] . '"><i class="' . $subelement[2] . '"></i> ' . $subelement[0] . '</a></li>';
                 }
                 $menu .= '</ul>';
             }
             $menu .= '</li>';
         }
         $menu .= '</ul></div></div></div></div>';
     }
     return $menu;
 }
示例#27
0
文件: mail.php 项目: ForAEdesWeb/AEW1
$elasticPort[] = JHTML::_('select.option', '2525', 2525);
$elasticPort[] = JHTML::_('select.option', 'rest', 'REST API');
echo JHTML::_('acyselect.radiolist', $elasticPort, 'config[elasticemail_port]', 'size="1" ', 'value', 'text', $this->config->get('elasticemail_port', 'rest'));
?>
						</td>
					</tr>
				</table>
				<?php 
echo JText::_('NO_ACCOUNT_YET') . ' <a href="' . ACYMAILING_REDIRECT . 'elasticemail" target="_blank" >' . JText::_('CREATE_ACCOUNT') . '</a>';
?>
				<?php 
echo '<br /><a href="' . ACYMAILING_REDIRECT . 'smtp_services" target="_blank">' . JText::_('TELL_ME_MORE') . '</a>';
?>
			</fieldset>
<?php 
if (acymailing_level(1)) {
    ?>
			<fieldset class="adminform" id="dkim_config" style="display:none">
				<legend><?php 
    echo JText::_('ACY_DKIM');
    ?>
</legend>
				<?php 
    $domain = $this->config->get('dkim_domain', '');
    if (empty($domain)) {
        $domain = preg_replace(array('#^https?://(www\\.)*#i', '#^www\\.#'), '', ACYMAILING_LIVE);
        $domain = substr($domain, 0, strpos($domain, '/'));
    }
    if ($this->config->get('dkim_selector', 'acy') != 'acy' && $this->config->get('dkim_selector', 'acy') != '' || $this->config->get('dkim_passphrase', '') != '' || JRequest::getInt('dkimletme')) {
        ?>
				<table class="admintable" cellspacing="1" >
示例#28
0
 function installBounceRules()
 {
     if (!acymailing_level(3)) {
         return;
     }
     $this->db->setQuery('SELECT COUNT(*) FROM #__acymailing_rules');
     if ($this->db->loadResult() > 0) {
         return;
     }
     $config = acymailing_config();
     $forwardEmail = strlen($config->get('reply_email')) . ':"' . $config->get('reply_email') . '"';
     $query = 'INSERT INTO `#__acymailing_rules` (`name`, `ordering`, `regex`, `executed_on`, `action_message`, `action_user`, `published`) VALUES ';
     $query .= '(\'Action Required\', 1, \'action *requ|verif\', \'a:1:{s:7:"subject";s:1:"1";}\', \'a:2:{s:6:"delete";s:1:"1";s:9:"forwardto";s:' . $forwardEmail . ';}\', \'a:1:{s:3:"min";s:1:"0";}\', 1),';
     $query .= '(\'Acknowledgement of receipt - in subject\', 2, \'(out|away) *(of|from)|vacation|holiday|absen|congés|recept|acknowledg|thank you for\', \'a:1:{s:7:"subject";s:1:"1";}\', \'a:1:{s:6:"delete";s:1:"1";}\', \'a:1:{s:3:"min";s:1:"0";}\', 1),';
     $query .= '(\'Feedback loop\', 3, \'feedback|staff@hotmail.com|complaints@email-abuse.amazonses.com\', \'a:2:{s:10:"senderinfo";s:1:"1";s:7:"subject";s:1:"1";}\', \'a:3:{s:4:"save";s:1:"1";s:6:"delete";s:1:"1";s:9:"forwardto";s:0:"";}\', \'a:2:{s:3:"min";s:1:"0";s:5:"unsub";s:1:"1";}\', 1),';
     $query .= '(\'Feedback loop - in body\', 4, \'Feedback-Type.{1,5}abuse\', \'a:1:{s:4:"body";s:1:"1";}\', \'a:3:{s:4:"save";s:1:"1";s:6:"delete";s:1:"1";s:9:"forwardto";s:0:"";}\', \'a:2:{s:3:"min";s:1:"0";s:5:"unsub";s:1:"1";}\', 1),';
     $query .= '(\'Mailbox Full\', 5, \'((mailbox|mailfolder|storage|quota|space|inbox) *(is)? *(over)? *(exceeded|size|storage|allocation|full|quota|maxi))|status(-code)? *(:|=)? *5\\.2\\.2|((over|exceeded|full|exhausted) *(allowed)? *(mail|storage|quota))\', \'a:2:{s:7:"subject";s:1:"1";s:4:"body";s:1:"1";}\', \'a:3:{s:4:"save";s:1:"1";s:6:"delete";s:1:"1";s:9:"forwardto";s:0:"";}\', \'a:3:{s:5:"stats";s:1:"1";s:3:"min";s:1:"3";s:5:"block";s:1:"1";}\', 1),';
     $query .= '(\'Message blocked by recipient filters\',6, \'blocked *by|block *list|look(ed)? *like *spam|spam *detected|CXBL|CDRBL|IPBL|URLBL|(unacceptable|banned|offensive|filtered|blocked|unsolicited) *(content|message|e?-?mail)|(status(-code)?|554) *(:|=)? *5\\.7\\.1|administratively *denied|blacklisted *IP|policy *reasons|rejected.{1,10}spam|junkmail *rejected|throttling *constraints|exceeded.{1,10}max.{1,40}hour|comply with required standards|421 RP-00|550 SC-00|550 DY-00|550 OU-00\', \'a:1:{s:4:"body";s:1:"1";}\', \'a:2:{s:6:"delete";s:1:"1";s:9:"forwardto";s:' . $forwardEmail . ';}\', \'a:2:{s:5:"stats";s:1:"1";s:3:"min";s:1:"0";}\', 1),';
     $query .= '(\'Mailbox does not exist\', 7, \'(Invalid|no such|unknown|bad|des?activated|undelivered|inactive|unrouteable) *(mail|destination|recipient|user|address|person)|RecipNotFound|status(-code)? *(:|=)? *5\\.(1\\.[1-6]|0\\.0|4\\.[0123467])|(user|mailbox|address|recipients?|host|account|domain) *(is|has been)? *(error|disabled|failed|unknown|unavailable|not *(found|available)|.{1,30}inactiv)|recipient *address *rejected|does *not *like *recipient|no *mailbox *here|user does.?n.t have.{0,30}account\', \'a:2:{s:7:"subject";s:1:"1";s:4:"body";s:1:"1";}\', \'a:3:{s:4:"save";s:1:"1";s:6:"delete";s:1:"1";s:9:"forwardto";s:0:"";}\', \'a:3:{s:5:"stats";s:1:"1";s:3:"min";s:1:"0";s:5:"block";s:1:"1";}\', 1),';
     $query .= '(\'Domain does not exist\', 8, \'No.{1,10}MX *(record|host)|host *does *not *receive *any *mail|connection.{1,10}mail.{1,20}fail\', \'a:2:{s:7:"subject";s:1:"1";s:4:"body";s:1:"1";}\', \'a:3:{s:4:"save";s:1:"1";s:6:"delete";s:1:"1";s:9:"forwardto";s:0:"";}\', \'a:3:{s:5:"stats";s:1:"1";s:3:"min";s:1:"0";s:5:"block";s:1:"1";}\', 1),';
     $query .= '(\'Temporary failures\', 9, \'has.*been.*delayed|delayed *mail|message *delayed|temporar(il)?y *(failure|unavailable|disable)|deferred|delayed *([0-9]*) *(hour|minut)|possible *mail *loop|too *many *hops|delivery *time *expired|Action: *delayed|status(-code)? *(:|=)? *4\\.4\\.6|will continue to be attempted\', \'a:2:{s:7:"subject";s:1:"1";s:4:"body";s:1:"1";}\', \'a:3:{s:4:"save";s:1:"1";s:6:"delete";s:1:"1";s:9:"forwardto";s:0:"";}\', \'a:3:{s:5:"stats";s:1:"1";s:3:"min";s:1:"3";s:5:"block";s:1:"1";}\', 1),';
     $query .= '(\'Failed Permanently\', 10, \'failed *permanently|permanent.{1,20}(failure|error)|not *accepting *(any)? *mail|does *not *exist|no *valid *route|delivery *failure\', \'a:2:{s:7:"subject";s:1:"1";s:4:"body";s:1:"1";}\', \'a:3:{s:4:"save";s:1:"1";s:6:"delete";s:1:"1";s:9:"forwardto";s:0:"";}\', \'a:3:{s:5:"stats";s:1:"1";s:3:"min";s:1:"0";s:5:"block";s:1:"1";}\', 1),';
     $query .= '(\'Acknowledgement of receipt - in body\', 11, \'vacances|holiday|vacation|absen\', \'a:1:{s:4:"body";s:1:"1";}\', \'a:1:{s:6:"delete";s:1:"1";}\', \'a:1:{s:3:"min";s:1:"0";}\', 1),';
     $query .= '(\'Final Rule\', 12, \'.\', \'a:2:{s:10:"senderinfo";s:1:"1";s:7:"subject";s:1:"1";}\', \'a:2:{s:6:"delete";s:1:"1";s:9:"forwardto";s:' . $forwardEmail . ';}\', \'a:1:{s:3:"min";s:1:"0";}\', 1)';
     $this->db->setQuery($query);
     $this->db->query();
     $newConfig = new stdClass();
     $newConfig->bouncerulesversion = $this->bouncerulesversion;
     $config->save($newConfig);
 }
示例#29
0
} else {
    ?>
							<textarea onmouseover="document.getElementById('wysija').style.display = 'none'" name="data[template][stylesheet]" style="width:98%" rows="25"><?php 
    echo @$this->template->stylesheet;
    ?>
</textarea>
						<?php 
}
echo $this->tabs->endPanel();
echo $this->tabs->endPane();
?>
			</td>
		</tr>
	</table>
	<?php 
if (acymailing_level(3)) {
    $acltype = acymailing_get('type.acl');
    ?>
		<fieldset class="adminform">
			<legend><?php 
    echo JText::_('ACCESS_LEVEL');
    ?>
</legend>
			<?php 
    echo $acltype->display('data[template][access]', $this->template->access);
    ?>
		</fieldset>
	<?php 
}
?>
	<fieldset class="adminform" style="width:90%" id="htmlfieldset">
示例#30
0
 function preview()
 {
     $app = JFactory::getApplication();
     $mailid = acymailing_getCID('mailid');
     $config = acymailing_config();
     JHTML::_('behavior.modal', 'a.modal');
     $mailerHelper = acymailing_get('helper.mailer');
     $mailerHelper->loadedToSend = false;
     $mail = $mailerHelper->load($mailid);
     $user = JFactory::getUser();
     $userClass = acymailing_get('class.subscriber');
     $receiver = $userClass->get($user->email);
     $mail->sendHTML = true;
     $mailerHelper->dispatcher->trigger('acymailing_replaceusertags', array(&$mail, &$receiver, false));
     if (!empty($mail->altbody)) {
         $mail->altbody = $mailerHelper->textVersion($mail->altbody, false);
     }
     $listmailClass = acymailing_get('class.listmail');
     $lists = $listmailClass->getReceivers($mail->mailid, true, false);
     $receiversClass = acymailing_get('type.testreceiver');
     $paramBase = ACYMAILING_COMPONENT . '.' . $this->getName();
     $infos = new stdClass();
     $infos->receiver_type = $app->getUserStateFromRequest($paramBase . ".receiver_type", 'receiver_type', '', 'string');
     $infos->test_html = $app->getUserStateFromRequest($paramBase . ".test_html", 'test_html', 1, 'int');
     $infos->test_email = $app->getUserStateFromRequest($paramBase . ".test_email", 'test_email', '', 'string');
     acymailing_setTitle(JText::_('ACY_PREVIEW') . ' : ' . $mail->subject, $this->icon, $this->ctrl . '&task=preview&mailid=' . $mailid);
     $bar = JToolBar::getInstance('toolbar');
     if ($this->type == 'news') {
         if (acymailing_level(1) && acymailing_isAllowed($config->get('acl_newsletters_schedule', 'all'))) {
             if ($mail->published == 2) {
                 JToolBarHelper::custom('unschedule', 'unschedule', '', JText::_('UNSCHEDULE'), false);
             } else {
                 $bar->appendButton('Acypopup', 'schedule', JText::_('SCHEDULE'), "index.php?option=com_acymailing&ctrl=send&task=scheduleready&tmpl=component&mailid=" . $mailid);
             }
         }
         if (acymailing_isAllowed($config->get('acl_newsletters_send', 'all'))) {
             $bar->appendButton('Acypopup', 'acysend', JText::_('SEND'), "index.php?option=com_acymailing&ctrl=send&task=sendready&tmpl=component&mailid=" . $mailid);
         }
         JToolBarHelper::divider();
     }
     JToolBarHelper::custom('edit', 'edit', '', JText::_('ACY_EDIT'), false);
     JToolBarHelper::cancel('cancel', JText::_('ACY_CLOSE'));
     JToolBarHelper::divider();
     $bar->appendButton('Pophelp', $this->doc);
     $this->assignRef('lists', $lists);
     $this->assignRef('infos', $infos);
     $this->assignRef('receiverClass', $receiversClass);
     $this->assignRef('mail', $mail);
 }