コード例 #1
0
ファイル: filter.php プロジェクト: unrealprojects/journal
 function process()
 {
     if (!$this->isAllowed('lists', 'filter')) {
         return;
     }
     JRequest::checkToken() or die('Invalid Token');
     $filid = JRequest::getInt('filid');
     if (!empty($filid)) {
         $this->store();
     }
     $filterClass = acymailing_get('class.filter');
     $filterClass->subid = JRequest::getString('subid');
     $filterClass->execute(JRequest::getVar('filter'), JRequest::getVar('action'));
     if (!empty($filterClass->report)) {
         if (JRequest::getCmd('tmpl') == 'component') {
             echo acymailing_display($filterClass->report, 'info');
             $js = "setTimeout('redirect()',2000); function redirect(){window.top.location.href = 'index.php?option=com_acymailing&ctrl=subscriber'; }";
             $doc = JFactory::getDocument();
             $doc->addScriptDeclaration($js);
             return;
         } else {
             $app = JFactory::getApplication();
             foreach ($filterClass->report as $oneReport) {
                 $app->enqueueMessage($oneReport);
             }
         }
     }
     return $this->edit();
 }
コード例 #2
0
ファイル: tag.php プロジェクト: Roma48/abazherka
 function store()
 {
     JRequest::checkToken() or die('Invalid Token');
     $plugin = JRequest::getString('plugin');
     $plugin = preg_replace('#[^a-zA-Z0-9]#Uis', '', $plugin);
     $body = JRequest::getVar('templatebody', '', '', 'string', JREQUEST_ALLOWRAW);
     if (empty($body)) {
         acymailing_display(JText::_('FILL_ALL'), 'error');
         return;
     }
     $pluginsFolder = ACYMAILING_MEDIA . 'plugins';
     if (!file_exists($pluginsFolder)) {
         acymailing_createDir($pluginsFolder);
     }
     try {
         jimport('joomla.filesystem.file');
         $status = JFile::write($pluginsFolder . DS . $plugin . '.php', $body);
     } catch (Exception $e) {
         $status = false;
     }
     if ($status) {
         acymailing_display(JText::_('JOOMEXT_SUCC_SAVED'), 'success');
     } else {
         acymailing_display(JText::sprintf('FAIL_SAVE', $pluginsFolder . DS . $plugin . '.php'), 'error');
     }
 }
コード例 #3
0
ファイル: send.php プロジェクト: jmangarret/webtuagencia24
 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');
 }
コード例 #4
0
ファイル: urlclick.php プロジェクト: utopszkij/lmp
	function addClick($urlid,$mailid,$subid){
		$mailid = intval($mailid);
		$urlid = intval($urlid);
		$subid = intval($subid);
		if(empty($mailid) OR empty($urlid) OR empty($subid)) return true;

		$statsClass = acymailing_get('class.stats');
		$statsClass->countReturn = false;
		$statsClass->mailid = $mailid;
		$statsClass->subid = $subid;
		if(!$statsClass->saveStats()) return true;

		$date = time();
		$ipClass = acymailing_get('helper.user');
		$ip = $ipClass->getIP();

		$query = 'INSERT IGNORE INTO '.acymailing_table('urlclick').' (urlid,mailid,subid,date,click,ip) VALUES ('.$urlid.','.$mailid.','.$subid.','.$date.',1,'.$this->database->Quote($ip).')';
		$this->database->setQuery($query);
		if(!$this->database->query()){
			acymailing_display($this->database->getErrorMsg(),'error');
			exit;
		}

		if(!$this->database->getAffectedRows()){
			$query = 'UPDATE '.acymailing_table('urlclick').' SET click = click +1,`date` = '.$date.' WHERE mailid = '.$mailid.' AND urlid = '.$urlid.' AND subid = '.$subid.' LIMIT 1';
			$this->database->setQuery($query);
			$this->database->query();
		}

		$query = 'SELECT SUM(click) FROM '.acymailing_table('urlclick').' WHERE mailid = '.$mailid.' AND subid = '.$subid;
		$this->database->setQuery($query);
		$totalUserClick = $this->database->loadResult();

		$query = 'UPDATE '.acymailing_table('stats').' SET clicktotal = clicktotal + 1 ';
		if($totalUserClick <= 1){
			$query .= ' , clickunique = clickunique + 1';
		}
		$query .= ' WHERE mailid = '.$mailid.' LIMIT 1';
		$this->database->setQuery($query);
		$this->database->query();

		$this->database->setQuery('UPDATE #__acymailing_subscriber SET lastclick_date = '.time().' WHERE subid = '.$subid);
		$this->database->query();

		$filterClass = acymailing_get('class.filter');
		$filterClass->subid = $subid;
		$filterClass->trigger('clickurl');

		$classGeoloc = acymailing_get('class.geolocation');
		$classGeoloc->saveGeolocation('clic', $subid);

		JPluginHelper::importPlugin('acymailing');
		$dispatcher = JDispatcher::getInstance();
		$dispatcher->trigger('onAcyClickLink',array($subid,$mailid,$urlid));

		return true;
	}
コード例 #5
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();
 }
コード例 #6
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();
 }
コード例 #7
0
 function update()
 {
     $config = acymailing_config();
     if (!acymailing_isAllowed($config->get('acl_config_manage', 'all'))) {
         acymailing_display(JText::_('ACY_NOTALLOWED'), 'error');
         return false;
     }
     acymailing_setTitle(JText::_('UPDATE_ABOUT'), 'acyupdate', 'update');
     $bar =& JToolBar::getInstance('toolbar');
     $bar->appendButton('Link', 'back', JText::_('ACY_CLOSE'), acymailing_completeLink('dashboard'));
     return $this->_iframe(ACYMAILING_UPDATEURL . 'update');
 }
コード例 #8
0
ファイル: update.php プロジェクト: Roma48/abazherka
 function update()
 {
     $config = acymailing_config();
     if (!acymailing_isAllowed($config->get('acl_config_manage', 'all'))) {
         acymailing_display(JText::_('ACY_NOTALLOWED'), 'error');
         return false;
     }
     $acyToolbar = acymailing::get('helper.toolbar');
     $acyToolbar->setTitle(JText::_('UPDATE_ABOUT'), 'update');
     $acyToolbar->link(acymailing_completeLink('dashboard'), JText::_('ACY_CLOSE'), 'cancel');
     $acyToolbar->display();
     return $this->_iframe(ACYMAILING_UPDATEURL . 'update');
 }
コード例 #9
0
ファイル: editor.php プロジェクト: utopszkij/lmp
    function setTemplate($id)
    {
        if (empty($id)) {
            return;
        }
        $app = JFactory::getApplication();
        $cssurl = rtrim(JURI::root(), '/') . '/' . ($app->isAdmin() ? 'administrator/index.php?option=com_acymailing&ctrl=template' : 'index.php?option=com_acymailing&ctrl=fronttemplate') . '&task=load&tempid=' . $id . '&time=' . time();
        $name = $this->myEditor->get('_name');
        $classTemplate = acymailing_get('class.template');
        $filepath = $classTemplate->createTemplateFile($id);
        if ($name == 'tinymce') {
            $this->editorConfig['content_css_custom'] = $cssurl;
            $this->editorConfig['content_css'] = '0';
        } elseif ($name == 'jckeditor' || $name == 'fckeditor') {
            $this->editorConfig['content_css_custom'] = $filepath;
            $this->editorConfig['content_css'] = '0';
            $this->editorConfig['editor_css'] = '0';
        } else {
            $fileurl = 'media/com_acymailing/templates/css/template_' . $id . '.css?time=' . time();
            $this->editorConfig['custom_css_url'] = $cssurl;
            $this->editorConfig['custom_css_file'] = $fileurl;
            $this->editorConfig['custom_css_path'] = $filepath;
            JRequest::setVar('acycssfile', $fileurl);
            if ($name == 'jce') {
                $jcepath = ACYMAILING_ROOT . 'administrator' . DS . 'components' . DS . 'com_jce' . DS . 'models' . DS;
                if (file_exists($jcepath . 'editor.php')) {
                    jimport('joomla.filesystem.file');
                    $content = JFile::read($jcepath . 'editor.php');
                    if (!strpos($content, 'acycssfile')) {
                        $acycode = '
			if(JRequest::getCmd(\'option\') == \'com_acymailing\'){
				$acycssfile = JRequest::getString(\'acycssfile\');
				if(!empty($acycssfile)) $settings[\'content_css\'] = $acycssfile;
			}
			';
                        $content = preg_replace('#(\\$settings\\[\'content_css\'\\][^=]*= *[^;]*;)#', '$1' . $acycode, $content);
                        if (strpos($content, 'acycssfile')) {
                            if (!file_exists($jcepath . 'editor_backup.php')) {
                                if (JFile::copy($jcepath . 'editor.php', $jcepath . 'editor_backup.php') !== true) {
                                    acymailing_display('Could not copy the file from ' . $jcepath . 'editor.php to ' . $jcepath . 'editor_backup.php', 'error');
                                }
                            }
                            if (JFile::write($jcepath . 'editor.php', $content) !== true) {
                                acymailing_display('Could not write in ' . $jcepath . 'editor.php <br /> Please make sure this folder is writable', 'error');
                            }
                        }
                    }
                }
            }
        }
    }
コード例 #10
0
ファイル: view.html.php プロジェクト: Roma48/abazherka
 function language()
 {
     $this->setLayout('default');
     $code = JRequest::getCmd('code');
     if (empty($code)) {
         acymailing_display('Code not specified', 'error');
         return;
     }
     $file = new stdClass();
     $file->name = $code;
     $path = JLanguage::getLanguagePath(JPATH_ROOT) . DS . $code . DS . $code . '.com_acymailing.ini';
     $file->path = $path;
     jimport('joomla.filesystem.file');
     $showLatest = true;
     $loadLatest = false;
     if (JFile::exists($path)) {
         $file->content = JFile::read($path);
         if (empty($file->content)) {
             acymailing_display('File not found : ' . $path, 'error');
         }
     } else {
         $loadLatest = true;
         acymailing_enqueueMessage(JText::_('LOAD_ENGLISH_1') . '<br />' . JText::_('LOAD_ENGLISH_2') . '<br />' . JText::_('LOAD_ENGLISH_3'), 'info');
         $file->content = JFile::read(JLanguage::getLanguagePath(JPATH_ROOT) . DS . 'en-GB' . DS . 'en-GB.com_acymailing.ini');
     }
     $custompath = JLanguage::getLanguagePath(JPATH_ROOT) . DS . $code . DS . $code . '.com_acymailing_custom.ini';
     if (JFile::exists($custompath)) {
         $file->customcontent = JFile::read($custompath);
     }
     if ($loadLatest or JRequest::getCmd('task') == 'latest') {
         if (file_exists(JPATH_ROOT . DS . 'language' . DS . $code)) {
             $doc = JFactory::getDocument();
             $doc->addScript(ACYMAILING_UPDATEURL . 'languageload&code=' . JRequest::getCmd('code'));
         } else {
             acymailing_enqueueMessage('The specified language "' . htmlspecialchars($code, ENT_COMPAT, 'UTF-8') . '" is not installed on your site', 'warning');
         }
         $showLatest = false;
     } elseif (JRequest::getCmd('task') == 'save') {
         $showLatest = false;
     }
     if (JRequest::getString('tmpl') == 'component') {
         $acyToolbar = acymailing::get('helper.toolbar');
         $acyToolbar->save();
         $acyToolbar->custom('share', JText::_('SHARE'), 'share', false);
         $acyToolbar->setTitle(JText::_('ACY_FILE') . ' : ' . $this->escape($file->name));
         $acyToolbar->topfixed = false;
         $acyToolbar->display();
     }
     $this->assignRef('showLatest', $showLatest);
     $this->assignRef('file', $file);
 }
コード例 #11
0
ファイル: view.html.php プロジェクト: alesconti/FF_2015
 function unsubchart()
 {
     $mailid = JRequest::getInt('mailid');
     if (empty($mailid)) {
         return;
     }
     $db = JFactory::getDBO();
     $db->setQuery('SELECT * FROM #__acymailing_history WHERE mailid = ' . intval($mailid) . ' AND action="unsubscribed" LIMIT 10000');
     $entries = $db->loadObjectList();
     if (empty($entries)) {
         acymailing_display("No data recorded for that Newsletter", 'warning');
         return;
     }
     $unsubreasons = array();
     $unsubreasons['NO_REASON'] = 0;
     foreach ($entries as $oneEntry) {
         if (empty($oneEntry->data)) {
             $unsubreasons['NO_REASON']++;
             continue;
         }
         $allReasons = explode("\n", $oneEntry->data);
         $added = false;
         foreach ($allReasons as $oneReason) {
             list($reason, $value) = explode('::', $oneReason);
             if (empty($value)) {
                 continue;
             }
             $unsubreasons[$value] = @$unsubreasons[$value] + 1;
             $added = true;
         }
         if (!$added) {
             $unsubreasons['NO_REASON']++;
         }
     }
     $finalReasons = array();
     foreach ($unsubreasons as $oneReason => $total) {
         $name = $oneReason;
         if (preg_match('#^[A-Z_]*$#', $name)) {
             $name = JText::_($name);
         }
         $finalReasons[$name] = $total;
     }
     arsort($finalReasons);
     $doc = JFactory::getDocument();
     $doc->addScript(((empty($_SERVER['HTTPS']) or strtolower($_SERVER['HTTPS']) != "on") ? 'http://' : 'https://') . "www.google.com/jsapi");
     $this->assignRef('unsubreasons', $finalReasons);
     if (JRequest::getCmd('export')) {
         $exportHelper = acymailing_get('helper.export');
         $exportHelper->exportOneData($finalReasons, 'unsub_' . JRequest::getInt('mailid'));
     }
 }
コード例 #12
0
ファイル: queue.php プロジェクト: utopszkij/lmp
 function cancelNewsletter()
 {
     if (!$this->isAllowed($this->aclCat, 'delete')) {
         return;
     }
     JRequest::checkToken() || JRequest::checkToken('get') || die('Invalid token');
     $mailid = JRequest::getInt('mailid', 0);
     if (empty($mailid)) {
         acymailing_display('Mail id not found', 'error');
         return;
     }
     $queueClass = acymailing_get('class.queue');
     acymailing_display(JText::sprintf('SUCC_DELETE_ELEMENTS', $queueClass->delete(array('a.mailid = ' . $mailid))), 'info');
 }
コード例 #13
0
ファイル: statsurl.php プロジェクト: utopszkij/lmp
	function save(){
		if(!$this->isAllowed($this->aclCat,'manage')) return;
		JRequest::checkToken() or die( 'Invalid Token' );

		$class = acymailing_get('class.url');
		$status = $class->saveForm();
		if($status){
			acymailing_display(JText::_( 'JOOMEXT_SUCC_SAVED'),'success');
			return true;
		}else{
			acymailing_display(JText::_( 'ERROR_SAVING'),'success');
		}

		return $this->edit();
	}
コード例 #14
0
ファイル: stats.php プロジェクト: juanferden/adoperp
 function saveStats()
 {
     $subid = empty($this->subid) ? JRequest::getInt('subid') : $this->subid;
     $mailid = empty($this->mailid) ? JRequest::getInt('mailid') : $this->mailid;
     if (empty($subid) or empty($mailid)) {
         return false;
     }
     $db = JFactory::getDBO();
     $db->setQuery('SELECT open FROM ' . acymailing_table('userstats') . ' WHERE `mailid` = ' . $mailid . ' AND `subid` = ' . intval($subid) . ' LIMIT 1');
     $actual = $db->loadObject();
     if (empty($actual)) {
         return false;
     }
     $userHelper = acymailing_get('helper.user');
     $this->database->setQuery('UPDATE #__acymailing_subscriber SET `lastopen_date` = ' . time() . ', `lastopen_ip` = ' . $this->database->Quote($userHelper->getIP()) . ' WHERE `subid` = ' . intval($subid));
     $this->database->query();
     $open = 0;
     if (empty($actual->open)) {
         $open = 1;
         $unique = ',openunique = openunique +1';
     } elseif ($this->countReturn) {
         $open = $actual->open + 1;
         $unique = '';
     }
     if (empty($open)) {
         return true;
     }
     $ipClass = acymailing_get('helper.user');
     $ip = $ipClass->getIP();
     $db->setQuery('UPDATE ' . acymailing_table('userstats') . ' SET open = ' . $open . ', opendate = ' . time() . ', `ip`= ' . $db->Quote($ip) . ' WHERE mailid = ' . $mailid . ' AND subid = ' . $subid . ' LIMIT 1');
     if (!$db->query()) {
         acymailing_display($db->getErrorMsg(), 'error');
         exit;
     }
     $db->setQuery('UPDATE ' . acymailing_table('stats') . ' SET opentotal = opentotal +1 ' . $unique . ' WHERE mailid = ' . $mailid . ' LIMIT 1');
     $db->query();
     if (!empty($subid)) {
         $filterClass = acymailing_get('class.filter');
         $filterClass->subid = $subid;
         $filterClass->trigger('opennews');
     }
     $classGeoloc = acymailing_get('class.geolocation');
     $classGeoloc->saveGeolocation('open', $subid);
     JPluginHelper::importPlugin('acymailing');
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onAcyOpenMail', array($subid, $mailid));
     return true;
 }
コード例 #15
0
ファイル: cpanel.php プロジェクト: sam-akopyan/hamradio
 function save($configObject)
 {
     $query = 'REPLACE INTO ' . acymailing_table('config') . ' (namekey,value) VALUES ';
     $params = array();
     $i = 0;
     foreach ($configObject as $namekey => $value) {
         if (strpos($namekey, 'password') !== false && !empty($value) && trim($value, '*') == '') {
             continue;
         }
         $i++;
         if (is_array($value)) {
             $value = implode(',', $value);
         }
         if ($i > 100) {
             $query .= implode(',', $params);
             $this->database->setQuery($query);
             if (!$this->database->query()) {
                 return false;
             }
             $i = 0;
             $query = 'REPLACE INTO ' . acymailing_table('config') . ' (namekey,value) VALUES ';
             $params = array();
         }
         if (empty($this->values[$namekey])) {
             $this->values[$namekey] = new stdClass();
         }
         $this->values[$namekey]->value = $value;
         $params[] = '(' . $this->database->Quote(strip_tags($namekey)) . ',' . $this->database->Quote(strip_tags($value)) . ')';
     }
     if (empty($params)) {
         return true;
     }
     $query .= implode(',', $params);
     $this->database->setQuery($query);
     try {
         $status = $this->database->query();
     } catch (Exception $e) {
         $status = false;
     }
     if (!$status) {
         acymailing_display(isset($e) ? $e->getMessage() : substr(strip_tags($this->database->getErrorMsg()), 0, 200) . '...', 'error');
     }
     return $status;
 }
コード例 #16
0
ファイル: send.php プロジェクト: unrealprojects/journal
 function send()
 {
     if (!$this->isAllowed('newsletters', 'send')) {
         return;
     }
     JRequest::checkToken() or die('Invalid Token');
     JRequest::setVar('tmpl', 'component');
     $mailid = acymailing_getCID('mailid');
     if (empty($mailid)) {
         exit;
     }
     $user = JFactory::getUser();
     $time = time();
     $queueClass = acymailing_get('class.queue');
     $queueClass->onlynew = JRequest::getInt('onlynew');
     $queueClass->mindelay = JRequest::getInt('mindelay');
     $totalSub = $queueClass->queue($mailid, $time);
     if (empty($totalSub)) {
         acymailing_display(JText::_('NO_RECEIVER'), 'warning');
         return;
     }
     $mailObject = new stdClass();
     $mailObject->senddate = $time;
     $mailObject->published = 1;
     $mailObject->mailid = $mailid;
     $mailObject->sentby = $user->id;
     $db = JFactory::getDBO();
     $db->updateObject(acymailing_table('mail'), $mailObject, 'mailid');
     $config =& acymailing_config();
     $queueType = $config->get('queue_type');
     if ($queueType == 'onlyauto') {
         $messages = array();
         $messages[] = JText::sprintf('ADDED_QUEUE', $totalSub);
         $messages[] = JText::_('AUTOSEND_CONFIRMATION');
         acymailing_display($messages, 'success');
         return;
     } else {
         JRequest::setVar('totalsend', $totalSub);
         $app = JFactory::getApplication();
         $app->redirect(acymailing_completeLink('send&task=continuesend&mailid=' . $mailid . '&totalsend=' . $totalSub, true, true));
         exit;
     }
 }
コード例 #17
0
ファイル: toolbar.php プロジェクト: madcsaba/li-de
 function display()
 {
     echo '<div ' . (empty($this->topfixed) ? '' : 'id="acymenu_top"') . ' class="acytoolbarmenu donotprint ' . (empty($this->topfixed) ? '' : 'acyaffix-top ') . $this->htmlclass . '" >';
     if (!empty($this->title)) {
         $title = htmlspecialchars($this->title, ENT_COMPAT, 'UTF-8');
         if (!empty($this->titleLink)) {
             $title = '<a style="color:white;" href="' . acymailing_completeLink($this->titleLink) . '">' . $title . '</a>';
         }
         echo '<span class="acytoolbartitle">' . $title . '</span>';
     }
     echo '<div class="acytoolbarmenu_menu">';
     echo implode(' ', $this->buttons);
     echo '</div></div>';
     $types = array('acymessagesuccess' => 'success', 'acymessageinfo' => 'info', 'acymessagewarning' => 'warning', 'acymessageerror' => 'error', 'acymessagenotice' => 'notice', 'acymessagemessage' => 'message');
     foreach ($types as $key => $type) {
         if (empty($_SESSION[$key])) {
             continue;
         }
         acymailing_display($_SESSION[$key], $type);
         unset($_SESSION[$key]);
     }
 }
コード例 #18
0
ファイル: view.html.php プロジェクト: educakanchay/educared
 function language()
 {
     $this->setLayout('default');
     $code = JRequest::getCmd('code');
     if (empty($code)) {
         acymailing_display('Code not specified', 'error');
         return;
     }
     $file = new stdClass();
     $file->name = $code;
     $path = JLanguage::getLanguagePath(JPATH_ROOT) . DS . $code . DS . $code . '.com_acymailing.ini';
     $file->path = $path;
     jimport('joomla.filesystem.file');
     $showLatest = true;
     $loadLatest = false;
     if (JFile::exists($path)) {
         $file->content = JFile::read($path);
         if (empty($file->content)) {
             acymailing_display('File not found : ' . $path, 'error');
         }
     } else {
         $loadLatest = true;
         acymailing_display(JText::_('LOAD_ENGLISH_1') . '<br />' . JText::_('LOAD_ENGLISH_2') . '<br />' . JText::_('LOAD_ENGLISH_3'), 'info');
         $file->content = JFile::read(JLanguage::getLanguagePath(JPATH_ROOT) . DS . 'en-GB' . DS . 'en-GB.com_acymailing.ini');
     }
     $custompath = JLanguage::getLanguagePath(JPATH_ROOT) . DS . $code . DS . $code . '.com_acymailing_custom.ini';
     if (JFile::exists($custompath)) {
         $file->customcontent = JFile::read($custompath);
     }
     if ($loadLatest or JRequest::getCmd('task') == 'latest') {
         $doc = JFactory::getDocument();
         $doc->addScript(ACYMAILING_UPDATEURL . 'languageload&code=' . JRequest::getCmd('code'));
         $showLatest = false;
     } elseif (JRequest::getCmd('task') == 'save') {
         $showLatest = false;
     }
     $this->assignRef('showLatest', $showLatest);
     $this->assignRef('file', $file);
 }
コード例 #19
0
ファイル: email.php プロジェクト: educakanchay/educared
 function store()
 {
     JRequest::checkToken() or die('Invalid Token');
     $oldMailid = acymailing_getCID('mailid');
     $mailClass = acymailing_get('class.mail');
     if ($mailClass->saveForm()) {
         $data = JRequest::getVar('data');
         $type = @$data['mail']['type'];
         if (!empty($type) and in_array($type, array('unsub', 'welcome'))) {
             $subject = addslashes($data['mail']['subject']);
             $mailid = JRequest::getInt('mailid');
             if ($type == 'unsub') {
                 $js = "var mydrop = window.top.document.getElementById('datalistunsubmailid'); ";
                 $js .= "var type = 'unsub';";
             } else {
                 //type=welcome
                 $js = "var mydrop = window.top.document.getElementById('datalistwelmailid'); ";
                 $js .= "var type = 'welcome';";
             }
             if (empty($oldMailid)) {
                 $js .= 'var optn = document.createElement("OPTION");';
                 $js .= "optn.text = '[{$mailid}] {$subject}'; optn.value = '{$mailid}';";
                 $js .= 'mydrop.options.add(optn);';
                 $js .= 'lastid = 0; while(mydrop.options[lastid+1]){lastid = lastid+1;} mydrop.selectedIndex = lastid;';
                 $js .= 'window.top.changeMessage(type,' . $mailid . ');';
             } else {
                 $js .= "lastid = 0; notfound = true; while(notfound && mydrop.options[lastid]){if(mydrop.options[lastid].value == {$mailid}){mydrop.options[lastid].text = '[{$mailid}] {$subject}';notfound = false;} lastid = lastid+1;}";
             }
             if (ACYMAILING_J30) {
                 $js .= 'window.top.jQuery("#datalist' . ($type == 'unsub' ? 'unsub' : 'wel') . 'mailid").trigger("liszt:updated");';
             }
             $doc = JFactory::getDocument();
             $doc->addScriptDeclaration($js);
         }
         acymailing_display(JText::_('JOOMEXT_SUCC_SAVED'), 'success');
     } else {
         acymailing_display(JText::_('ERROR_SAVING'), 'error');
     }
 }
コード例 #20
0
ファイル: template.php プロジェクト: sam-akopyan/hamradio
 function applyareas()
 {
     if (!$this->isAllowed($this->aclCat, 'manage')) {
         return;
     }
     $class = acymailing_get('class.template');
     $tempid = JRequest::getInt('tempid');
     if (empty($tempid)) {
         exit;
     }
     $template = $class->get($tempid);
     $class->applyAreas($template->body);
     $class->save($template);
     $class->createTemplateFile($tempid);
     acymailing_display(JText::_('ACYEDITOR_ADDAREAS_DONE'));
     if (JRequest::getCmd('tmpl') == 'component') {
         $js = "setTimeout('redirect()',2000); function redirect(){window.top.location.href = 'index.php?option=com_acymailing&ctrl=template'; }";
         $doc = JFactory::getDocument();
         $doc->addScriptDeclaration($js);
     } else {
         return $this->listing();
     }
 }
コード例 #21
0
ファイル: form.php プロジェクト: ranrolls/ras-full-portal
    $messages[] = 'Please make sure you use at least PHP 5.0.0';
}
if (!class_exists('DOMDocument')) {
    $messages[] = 'DOMDocument class not found';
} else {
    $xmldoc = @new DOMDocument();
    if (!is_object($xmldoc) || !method_exists($xmldoc, 'loadHTML')) {
        $messages[] = 'Please make sure that php_domxml.dll on windows is removed before using the domdocument class as they cannot coexist.';
    }
}
if (!function_exists('mb_convert_encoding')) {
    $messages[] = 'The php extension mbstring is not installed';
}
if (!empty($messages)) {
    $messages[] = 'The stylesheet can not be used';
    acymailing_display($messages, 'warning');
} 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 
コード例 #22
0
 function acymailing_replacetags(&$email, $send = true)
 {
     $art = new stdClass();
     $art->title = $email->subject;
     $art->introtext = $email->body;
     $art->fulltext = $email->body;
     $art->attribs = '';
     $art->state = 1;
     $art->created_by = @$email->userid;
     $art->images = '';
     $art->id = 0;
     $art->section = 0;
     $art->catid = 0;
     $context = 'com_acymailing';
     try {
         if (!empty($email->body)) {
             $art->text = $email->body;
             if (!ACYMAILING_J16) {
                 $resultsPlugin = $this->dispatcherContent->trigger('onPrepareContent', array(&$art, &$this->paramsContent, 0));
             } else {
                 if ($send) {
                     $art->text .= '{emailcloak=off}';
                 }
                 $resultsPlugin = $this->dispatcherContent->trigger('onContentPrepare', array($context, &$art, &$this->paramsContent, 0));
                 if ($send) {
                     $art->text = str_replace(array('{emailcloak=off}', '{* emailcloak=off}'), '', $art->text);
                 }
             }
             $email->body = $art->text;
         }
         if (!empty($email->altbody)) {
             $art->text = $email->altbody;
             if (!ACYMAILING_J16) {
                 $resultsPlugin = $this->dispatcherContent->trigger('onPrepareContent', array(&$art, &$this->paramsContent, 0));
             } else {
                 if ($send) {
                     $art->text .= '{emailcloak=off}';
                 }
                 $resultsPlugin = $this->dispatcherContent->trigger('onContentPrepare', array($context, &$art, &$this->paramsContent, 0));
                 if ($send) {
                     $art->text = str_replace(array('{emailcloak=off}', '{* emailcloak=off}'), '', $art->text);
                 }
             }
             $email->altbody = $art->text;
         }
     } catch (Exception $e) {
         acymailing_display(array('An error occured with the AcyMailing contentplugin plugin, you may want to disable it from the AcyMailing configuration page', $e->getMessage()), 'error');
     }
 }
コード例 #23
0
ファイル: form.php プロジェクト: educacionbe/stabwall
    ?>
					</tbody>
				</table>
			</div>
		</div>
	<?php 
}
?>
	<form action="index.php?option=<?php 
echo ACYMAILING_COMPONENT;
?>
&amp;ctrl=filter" method="post" name="adminForm" id="adminForm" autocomplete="off">
		<?php 
if (JRequest::getCmd('tmpl') == 'component') {
    if (empty($this->subid)) {
        acymailing_display(JText::_('PLEASE_SELECT_USERS'), 'warning');
        return;
    }
    $acyToolbar = acymailing::get('helper.toolbar');
    $acyToolbar->custom('process', JText::_('PROCESS'), 'process', false);
    $acyToolbar->setTitle(JText::_('ACTIONS'), '');
    $acyToolbar->topfixed = false;
    $acyToolbar->display();
    ?>

			<input type="hidden" name="subid" value="<?php 
    echo intval($this->subid);
    ?>
"/>
			<input type="hidden" name="tmpl" value="component"/>
		<?php 
コード例 #24
0
ファイル: stats.php プロジェクト: educakanchay/educa
 function saveStats()
 {
     $subid = empty($this->subid) ? JRequest::getInt('subid') : $this->subid;
     $mailid = empty($this->mailid) ? JRequest::getInt('mailid') : $this->mailid;
     if (empty($subid) or empty($mailid)) {
         return false;
     }
     $db = JFactory::getDBO();
     $db->setQuery('SELECT `open` FROM ' . acymailing_table('userstats') . ' WHERE `mailid` = ' . intval($mailid) . ' AND `subid` = ' . intval($subid) . ' LIMIT 1');
     $actual = $db->loadObject();
     if (empty($actual)) {
         return false;
     }
     $userHelper = acymailing_get('helper.user');
     $db->setQuery('UPDATE #__acymailing_subscriber SET `lastopen_date` = ' . time() . ', `lastopen_ip` = ' . $db->Quote($userHelper->getIP()) . ' WHERE `subid` = ' . intval($subid));
     try {
         $results = $db->query();
     } catch (Exception $e) {
         $results = null;
     }
     if ($results === null) {
         acymailing_display(isset($e) ? $e->getMessage() : substr(strip_tags($db->getErrorMsg()), 0, 200) . '...', 'error');
         exit;
     }
     $open = 0;
     if (empty($actual->open)) {
         $open = 1;
         $unique = ',openunique = openunique +1';
     } elseif ($this->countReturn) {
         $open = $actual->open + 1;
         $unique = '';
     }
     if (empty($open)) {
         return true;
     }
     $ipClass = acymailing_get('helper.user');
     $ip = $ipClass->getIP();
     $db->setQuery('UPDATE ' . acymailing_table('userstats') . ' SET open = ' . $open . ', opendate = ' . time() . ', `ip`= ' . $db->Quote($ip) . ' WHERE mailid = ' . $mailid . ' AND subid = ' . $subid . ' LIMIT 1');
     try {
         $results = $db->query();
     } catch (Exception $e) {
         $results = null;
     }
     if ($results === null) {
         acymailing_display(isset($e) ? $e->getMessage() : substr(strip_tags($db->getErrorMsg()), 0, 200) . '...', 'error');
         exit;
     }
     $browsers = array("abrowse", "abolimba", "3ds", "acoo browser", "alienforce", "amaya", "amigavoyager", "antfresco", "aol", "arora", "avant", "baidubrowser", "beamrise", "beonex", "blackbird", "blackhawk", "bolt", "browsex", "browzar", "bunjalloo", "camino", "charon", "chromium", "columbus", "cometbird", "dragon", "conkeror", "coolnovo", "corom", "deepnet explorer", "demeter", "deskbrowse", "dillo", "dooble", "dplus", "edbrowse", "element browser", "elinks", "epic", "epiphany", "firebird", "flock", "fluid", "galeon", "globalmojo", "greenbrowser", "hotjava", "hv3", "hydra", "ibrowse", "icab", "icebrowser", "iceape", "icecat", "icedragon", "iceweasel", "surfboard", "irider", "iron", "meleon", "ninja", "kapiko", "kazehakase", "strata", "kkman", "konqueror", "kylo", "lbrowser", "links", "lobo", "lolifox", "lunascape", "lynx", "maxthon", "midori", "minibrowser", "mosaic", "multizilla", "myibrow", "netcaptor", "netpositive", "netscape", "navigator", "netsurf", "nintendobrowser", "offbyone", "omniweb", "orca", "oregano", "otter", "palemoon", "patriott", "perk", "phaseout", "phoenix", "polarity", "playstation 4", "qtweb internet browser", "qupzilla", "rekonq", "retawq", "roccat", "rockmelt", "ryouko", "saayaa", "seamonkey", "shiira", "sitekiosk", "skipstone", "sleipnir", "slimboat", "slimbrowser", "metasr", "stainless", "sundance", "sundial", "sunrise", "superbird", "surf", "swiftweasel", "tenfourfox", "theworld", "tjusig", "tencenttraveler", "ultrabrowser", "usejump", "uzbl", "vonkeror", "v3m", "webianshell", "webrender", "weltweitimnetzbrowser", "whitehat aviator", "wkiosk", "worldwideweb", "wyzo", "smiles", "yabrowser", "yrcweblink", "zbrowser", "zipzap", "firefox", "msie", "opera", "chrome", "safari", "thunderbird", "outlook", "airmail", "barca", "eudora", "gcmail", "lotus", "pocomail", "postbox", "shredder", "sparrow", "spicebird", "bat!", "tizenbrowser", "mozilla", "gecko");
     $name = "unknown";
     $version = "";
     if (isset($_SERVER['HTTP_USER_AGENT'])) {
         $agent = strtolower($_SERVER['HTTP_USER_AGENT']);
     } else {
         $agent = "unknown";
     }
     foreach ($browsers as $oneBrowser) {
         if (preg_match("#({$oneBrowser})[/ ]?([0-9]*)#", $agent, $match)) {
             $name = $match[1];
             $version = $match[2];
             break;
         }
     }
     $isMobile = 0;
     $osName = '';
     if (preg_match('/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/', $agent) || preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i', substr($agent, 0, 4))) {
         $isMobile = 1;
         $osName = "unknown";
         $mobileOs = array("bada" => "Bada", "ubuntu; mobile" => "Ubuntu", "ubuntu; tablet" => "Ubuntu", "tizen" => "Tizen", "palm os" => "Palm", "meego" => "meeGo", "symbian" => "Symbian", "symbos" => "Symbian", "blackberry" => "BlackBerry", "windows ce" => "Windows Phone", "windows mobile" => "Windows Phone", "windows phone" => "Windows Phone", "iphone" => "iOS", "ipad" => "iOS", "ipod" => "iOS", "android" => "Android");
         $mobileOsKeys = array_keys($mobileOs);
         foreach ($mobileOsKeys as $oneMobileOsKey) {
             if (preg_match("/({$oneMobileOsKey})/", $agent, $match2)) {
                 $osName = $mobileOs[$match2[1]];
                 break;
             }
         }
     }
     $db->setQuery('UPDATE ' . acymailing_table('userstats') . ' SET `is_mobile` = ' . intval($isMobile) . ', `mobile_os` = ' . $db->Quote($osName) . ', `browser` = ' . $db->Quote($name) . ', browser_version = ' . intval($version) . ', user_agent = ' . $db->Quote($agent) . ' WHERE mailid = ' . $mailid . ' AND subid = ' . $subid . ' LIMIT 1');
     try {
         $results = $db->query();
     } catch (Exception $e) {
         $results = null;
     }
     if ($results === null) {
         acymailing_display(isset($e) ? $e->getMessage() : substr(strip_tags($db->getErrorMsg()), 0, 200) . '...', 'error');
         exit;
     }
     $db->setQuery('UPDATE ' . acymailing_table('stats') . ' SET opentotal = opentotal +1 ' . $unique . ' WHERE mailid = ' . $mailid . ' LIMIT 1');
     $db->query();
     if (!empty($subid)) {
         $filterClass = acymailing_get('class.filter');
         $filterClass->subid = $subid;
         $filterClass->trigger('opennews');
     }
     $classGeoloc = acymailing_get('class.geolocation');
     $classGeoloc->saveGeolocation('open', $subid);
     JPluginHelper::importPlugin('acymailing');
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onAcyOpenMail', array($subid, $mailid));
     return true;
 }
コード例 #25
0
ファイル: sub.php プロジェクト: DanyCan/wisten.github.io
 function listing()
 {
     $errorMsg = "You shouldn't see this page. If you come from an external subscription form, maybe the URL in the form action is not valid.";
     if (!empty($_SERVER['HTTP_HOST'])) {
         $errorMsg .= "<br />Host: " . htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8');
     }
     if (!empty($_SERVER['REQUEST_URI'])) {
         $errorMsg .= "<br />URI: " . htmlspecialchars($_SERVER['REQUEST_URI'], ENT_COMPAT, 'UTF-8');
     }
     if (!empty($_SERVER['HTTP_REFERER'])) {
         $errorMsg .= "<br />Referer: " . htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_COMPAT, 'UTF-8');
     }
     acymailing_display($errorMsg, 'error');
 }
コード例 #26
0
 function createTemplateFile($id)
 {
     if (file_exists(ACYMAILING_TEMPLATE . 'css' . DS . 'template_' . $id . '.css')) {
         return ACYMAILING_TEMPLATE . 'css' . DS . 'template_' . $id . '.css';
     }
     $classTemplate = acymailing_get('class.template');
     $template = $classTemplate->get($id);
     if (empty($template->tempid)) {
         return '';
     }
     $css = $classTemplate->buildCSS($template->styles, $template->stylesheet);
     if (empty($css)) {
         return '';
     }
     jimport('joomla.filesystem.file');
     acymailing_createDir(ACYMAILING_TEMPLATE . 'css');
     if (JFile::write(ACYMAILING_TEMPLATE . 'css' . DS . 'template_' . $id . '.css', $css)) {
         return ACYMAILING_TEMPLATE . 'css' . DS . 'template_' . $id . '.css';
     } else {
         acymailing_display('Could not create the file ' . ACYMAILING_TEMPLATE . 'css' . DS . 'template_' . $id . '.css', 'error');
         return '';
     }
 }
コード例 #27
0
ファイル: abtesting.php プロジェクト: Roma48/abazherka
<?php

/**
 * @package	AcyMailing for Joomla!
 * @version	5.1.0
 * @author	acyba.com
 * @copyright	(C) 2009-2015 ACYBA S.A.R.L. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?>
<div id="acy_content" class="abTestingPage">
	<?php 
if (empty($this->mailid) && empty($this->validationStatus)) {
    acymailing_display(JText::_('PLEASE_SELECT_NEWSLETTERS'), 'warning');
    return;
}
if (!empty($this->missingMail)) {
    return;
}
if ($this->validationStatus == 'abTestFinalSend') {
    return;
}
?>

	<div id="iframedoc"></div>
	<script type="text/javascript">
		function updateReceivers(prct){
			newVal = Math.floor(prct.value *<?php 
echo $this->nbTotalReceivers;
?>
コード例 #28
0
ファイル: view.html.php プロジェクト: ForAEdesWeb/AEW4
 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);
 }
コード例 #29
0
ファイル: view.html.php プロジェクト: educakanchay/educa
 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);
 }
コード例 #30
0
ファイル: ldap.php プロジェクト: jmangarret/webtuagencia24
<?php

/**
 * @package	AcyMailing for Joomla!
 * @version	4.9.3
 * @author	acyba.com
 * @copyright	(C) 2009-2015 ACYBA S.A.R.L. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
if (!function_exists('ldap_connect')) {
    acymailing_display('LDAP Extension not loaded on your server.<br />Please enable the LDAP php extension.', 'warning');
    return;
}
$js = "function updateldap(){\r\n\t\t\t\t\tdocument.getElementById('ldap_fields').innerHTML = '<span class=\"onload\"></span>';\r\n\t\t\t\t\tqueryString = 'index.php?option=com_acymailing&tmpl=component&ctrl=data&task=ajaxload&importfrom=ldap';\r\n\t\t\t\t\tqueryString += '&ldap_host='+document.getElementById('ldap_host').value;\r\n\t\t\t\t\tqueryString += '&ldap_port='+document.getElementById('ldap_port').value;\r\n\t\t\t\t\tqueryString += '&ldap_basedn='+document.getElementById('ldap_basedn').value;\r\n\t\t\t\t\tqueryString += '&ldap_username='******'ldap_username').value;\r\n\t\t\t\t\tqueryString += '&ldap_password='******'ldap_password').value;\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tnew Ajax(queryString,{ method: 'post', update: document.getElementById('ldap_fields')}).request();\r\n\t\t\t\t\t}catch(err){\r\n\t\t\t\t\t\tnew Request({\r\n\t\t\t\t\t\tmethod: 'post',\r\n\t\t\t\t\t\turl: queryString,\r\n\t\t\t\t\t\tonSuccess: function(responseText, responseXML) {\r\n\t\t\t\t\t\t\tdocument.getElementById('ldap_fields').innerHTML = responseText;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}).send();\r\n\t\t\t\t\t}\r\n\t\t\t\t}";
$doc = JFactory::getDocument();
$doc->addScriptDeclaration($js);
?>
<fieldset>
<legend><?php 
echo JText::_('CONFIGURATION');
?>
</legend>
<table class="admintable" cellspacing="1">
<?php 
if ($this->config->get('require_confirmation')) {
    ?>
		<tr>
			<td class="key" >
				<?php 
    echo JText::_('IMPORT_CONFIRMED');