Пример #1
0
 public static function showPanel($pageUsed = 'main')
 {
     $Itemid = JRequest::getInt('Itemid');
     if (empty($Itemid)) {
         $Itemid = $GLOBALS[JNEWS . 'itemidAca'];
     }
     $database = JFactory::getDBO();
     $acl = JFactory::getACL();
     $my = JFactory::getUser();
     $ex_groups = array();
     $gid = @$GLOBALS[JNEWS . 'list_creatorfe'];
     if (!empty($my->id)) {
         if (!empty($my->username)) {
             $greeting_message = _HI . ' ' . $my->username;
         } else {
             $greeting_message = '';
         }
         $doc6 = JFactory::getDocument();
         $doc6->addStyleSheet(JNEWS_JPATH_LIVE . '/components/' . JNEWS_OPTION . '/css/menu.css');
         $gid = !empty($GLOBALS[JNEWS . 'list_creatorfe']) ? $GLOBALS[JNEWS . 'list_creatorfe'] : 0;
         frontHTML::FEmenu();
         backHTML::controlPanelBottonStart(_JNEWS_UCP_USER_MENU, 'usermenu.png');
         switch ($pageUsed) {
             case 'list':
                 $listId = JRequest::getVar('listid');
                 // newsletter button
                 //			    	$link = 'option='.JNEWS_OPTION.'&act=mailing&listid='. $listId .'&listype=1&Itemid='.$Itemid;
                 //alex pagination
                 $link = 'option=' . JNEWS_OPTION . '&act=mailing&listid=' . $listId . '&listype=1';
                 $link = jNews_Tools::completeLink($link, false);
                 backHTML::quickiconButton($link, 'newsletterFE.png', _JNEWS_NEWSLETTER, false, 'all', false);
                 // smart newsletter button
                 //			    	$link = 'option='.JNEWS_OPTION.'&act=mailing&listid='. $listId .'&listype=7&Itemid='.$Itemid;
                 //alex pagination
                 $link = 'option=' . JNEWS_OPTION . '&act=mailing&listid=' . $listId . '&listype=7';
                 $link = jNews_Tools::completeLink($link, false);
                 backHTML::quickiconButton($link, 'smartnewsletterFE.png', _JNEWS_AUTONEWS, false, 'all', false);
                 break;
             default:
                 //					$link = 'option='.JNEWS_OPTION.'&act=show&Itemid='.$Itemid;
                 //alex pagination
                 $link = 'option=' . JNEWS_OPTION . '&act=show';
                 $link = jNews_Tools::completeLink($link, false);
                 backHTML::quickiconButton($link, 'my_subscriptions48.png', _JNEWS_UCP_USER_CONTACT, false, 'all', false);
                 //come back here
                 //$proceedToCheck = true;
                 break;
         }
         if (class_exists('jNews_Pro')) {
             $my = JFactory::getUser();
             $ownedlists = jNews_Lists::getOwnedlists($my->id);
             if (version_compare(JVERSION, '1.6.0', '<')) {
                 //j15
                 $usergid = $my->gid;
             } else {
                 //j16
                 $usergid = JAccess::getGroupsByUser($my->id, false);
             }
             $ex_groups = explode(',', $gid);
             if (is_array($usergid)) {
                 $canAccess = array_intersect($usergid, $ex_groups);
             }
             if (in_array($usergid, $ex_groups) || !empty($canAccess)) {
                 if ($GLOBALS[JNEWS . 'level'] > 2 && version_compare(JVERSION, '1.6.0', '>')) {
                     //					    $link = 'option='.JNEWS_OPTION.'&act=list&mid=1&listype=1&Itemid='.$Itemid;
                     //alex pagination
                     $link = 'option=' . JNEWS_OPTION . '&act=list&mid=1&listype=1';
                     $link = jNews_Tools::completeLink($link, false);
                     backHTML::quickiconButton($link, 'addedit.png', _JNEWS_MENU_LIST, false, 'all', false);
                 }
                 $listId = JRequest::getVar('listid');
                 $act = JRequest::getVar('act', '', '', 'WORD');
                 $task = JRequest::getVar('task');
                 if (empty($listId) || $act == 'mailing' && $task == 'save') {
                     // list button
                     $link = 'option=' . JNEWS_OPTION . '&act=list&listype=1&mid=1&Itemid=' . $Itemid;
                     $link = jNews_Tools::completeLink($link, false);
                     backHTML::quickiconButton($link, 'addedit.png', _JNEWS_MENU_LIST, false, $usergid, false);
                     if (empty($listId)) {
                         if ($GLOBALS[JNEWS . 'enable_jsub']) {
                             if (!empty($my->id)) {
                                 $ownedlists = jNews_Lists::getOwnedlists($my->id);
                             }
                             if (!empty($ownedlists)) {
                                 $listId = $ownedlists[0];
                             } else {
                                 $listId = jNews_Lists::getIDacclevel(18, $my->id);
                             }
                         } else {
                             $listId = jNews_Lists::getIDacclevel(18, $my->id);
                         }
                         frontHTML::cpanelHTML($listId, $Itemid);
                     }
                 }
             } else {
                 $lists = jNews_Lists::getLists(0, 0, true);
                 $access = false;
                 $id = 0;
                 if ($GLOBALS[JNEWS . 'enable_jsub']) {
                     if (!empty($my->id)) {
                         $ownedlists = jNews_Lists::getOwnedlists($my->id);
                     }
                     if (!empty($ownedlists)) {
                         $id = $my->id;
                     }
                 }
                 foreach ($lists as $list) {
                     $bit = jnews::checkPermissions($list->acc_level);
                     if ($bit) {
                         $access = true;
                         break;
                     }
                 }
                 $link = 'option=' . JNEWS_OPTION . '&act=list&mid=1&listype=1&Itemid=' . $Itemid;
                 $link = jNews_Tools::completeLink($link, false);
                 if (!empty($my->id)) {
                     $ownedlists = jNews_Lists::getOwnedlists($my->id);
                 }
                 if (empty($listId)) {
                     if ($GLOBALS[JNEWS . 'enable_jsub']) {
                         if (!empty($my->id)) {
                             $ownedlists = jNews_Lists::getOwnedlists($my->id);
                         }
                         if (!empty($ownedlists)) {
                             $listId = $ownedlists[0];
                         } else {
                             $listId = jNews_Lists::getIDacclevel(18, $my->id);
                         }
                     } else {
                         $listId = jNews_Lists::getIDacclevel(18, $my->id);
                     }
                 }
                 if ($GLOBALS[JNEWS . 'enable_jsub']) {
                     if ($access && !empty($ownedlists)) {
                         backHTML::quickiconButton($link, 'addedit.png', _JNEWS_MENU_LIST, false, 'all', false);
                         frontHTML::cpanelHTML($listId, $Itemid);
                     }
                 } else {
                     $creatorFe = jnews::checkPermissions($gid);
                     //traces
                     if ($access || $creatorFe) {
                         backHTML::quickiconButton($link, 'addedit.png', _JNEWS_MENU_LIST, false, 'all');
                         frontHTML::cpanelHTML($listId, $Itemid);
                     }
                 }
             }
         } else {
             if ($GLOBALS[JNEWS . 'level'] > 2) {
                 $link = 'option=' . JNEWS_OPTION . '&act=list&mid=1&listype=1&Itemid=' . $Itemid;
                 $link = jNews_Tools::completeLink($link, false);
                 backHTML::quickiconButton($link, 'addedit.png', _JNEWS_MENU_LIST, false, 'all', false);
             }
         }
         backHTML::controlPanelBottomEnd();
         if (class_exists('jNews_Auto')) {
             jNews_Auto::otherPanel();
         }
     } elseif ($GLOBALS[JNEWS . 'show_lists']) {
         $subscriberId = JRequest::getInt('subscriber');
         $subscriber = jNews_Subscribers::getSubscribersFromId(array($subscriberId), false);
         frontEnd::changeSubscriptions($subscriberId, md5($subscriber->email), '', 'save');
     }
 }
Пример #2
0
                            } else {
                                //j16
                                $db->setQuery("SELECT `enabled` FROM `#__extensions` WHERE `type` = 'plugin' AND `element`='cache' ");
                            }
                            $published = $db->loadResult();
                            if ($published) {
                                jNews::printM('warning', 'ONLY IF YOU USE YOUR OWN SERVER CRON TASK!');
                                jNews::printM('warning', 'You NEED to reduce the cache time on your website in order for the cron task to work properly!');
                                jNews::printM('warning', 'You need to put the cache time less than :' . $GLOBALS[JNEWS . 'cron_max_freq'] * 0.8 . ' minutes');
                                jNews::printM('warning', 'Or increase your jNews scheduler to :' . $cacheTime * 1.2 . ' minutes');
                            }
                        }
                    } else {
                        jnews::printM('error', _JNEWS_NOCRON_USED);
                    }
                    break;
                default:
                    $showPanel = true;
                    break;
            }
        } else {
            $showPanel = true;
        }
        break;
}
echo $message;
if ($showPanel) {
    frontEnd::introduction($subscriberId, $listId, $lisType);
}
frontHTML::_footer();
echo "\n\r" . '<!--  End : ' . jnews::version() . '   -->' . "\n\r";
Пример #3
0
 /**
  * @param string $action
  * @param string $task
  * to display the redirect  on the view
  */
 public static function leads($action, $task)
 {
     if (empty($GLOBALS[JNEWS . 'show_jlinks'])) {
         return true;
     }
     $acajLinkey = 'jnewslink5wroot';
     $acajNewsKey = 'jnewsKa2f6gpw';
     $acajAutoKey = 'jnewsK9dfn7lws';
     $acajSmartKey = 'jnewsK8kd92hf';
     $acajMailKey = 'jnewsKo02j6d4u5aco';
     static $ezlinks = false;
     static $loaded = false;
     //TODO put priority if easylinks and jlinks exist or add checking if easylinks is installed instead of jlinks
     if (!$loaded) {
         if (!defined('JOOBI_SECURE')) {
             define('JOOBI_SECURE', true);
         }
         $joobiEntryPoint = __FILE__;
         if (defined('JPATH_ROOT')) {
             $path = JPATH_ROOT;
         } elseif (isset($mosConfig_absolute_path)) {
             $path = $mosConfig_absolute_path;
         }
         $status = false;
         //if EasyLinks or jLinks is not installed on the website there is no need to proceed
         if (file_exists($path . DS . 'administrator' . DS . 'components' . DS . 'com_jlink' . DS . 'y.php')) {
             //Prioritize Easy Links	loading
             $status = @(include $path . DS . 'administrator' . DS . 'components' . DS . 'com_jlink' . DS . 'y.php');
             if (!$status && !defined('INSTALLER_FOLDER')) {
                 echo "We were unable to load Easy Links library.";
             } else {
                 $ezlinks = true;
             }
         }
         //if Easylinks is not installed or is installed but file include was not successful
         if (!$ezlinks) {
             //if jLinks is not installed on the website there is no need to proceed
             if (!file_exists($path . DS . 'joobi' . DS . 'entry.php')) {
                 return true;
             }
             $status = @(include $path . DS . 'joobi' . DS . 'entry.php');
             if (!$status && !defined('INSTALLER_FOLDER')) {
                 echo "We were unable to load Joobi library.";
             }
         }
         //file include trials failed
         if (!$status) {
             return true;
         }
         $loaded = true;
     }
     switch ($task) {
         case 'show':
             $linkForm = 'option=' . JNEWS_OPTION . '&act=leads&mid=7&type=50';
             $linkForm = jNews_Tools::completeLink($linkForm, false);
             $menuBack = new stdClass();
             $menuBack->popup = new stdClass();
             $menuBack->popup->isPop = false;
             $menuBack->link = $linkForm;
             $menuBack->action = 'back';
             $menuBack->onclick = new stdClass();
             $menuBack->onclick->custom = true;
             $menuBack->onclick->js = 'javascript:history.go(-1)';
             $menuBack->title = _JNEWS_MENU_BACK;
             frontHTML::formStart(_JNEWS_LEADS_REP, 0, '', $menuA);
             $gid = !empty($GLOBALS[JNEWS . 'list_creatorfe']) ? $GLOBALS[JNEWS . 'list_creatorfe'] : 0;
             frontHTML::FEmenu();
             frontHTML::formEndFN(null, '');
             $params = new stdClass();
             $params->controller = 'redirect-history';
             $params->task = 'show';
             $params->option = JNEWS_OPTION;
             $params->level = 50;
             $params->wid = WGet::extension('redirect.node', 'wid');
             $this->layout = WView::get('redirect_historylist', 'html', null, '', $params);
             $view = $this->layout->make();
             break;
         default:
             //default task = listing
             $linkForm = 'option=' . JNEWS_OPTION;
             $linkForm = jNews_Tools::completeLink($linkForm, false);
             $menuCpanel = new stdClass();
             $menuCpanel->popup = new stdClass();
             $menuCpanel->popup->isPop = false;
             $menuCpanel->link = $linkForm;
             $menuCpanel->action = 'cpanel';
             $menuCpanel->onclick = new stdClass();
             $menuCpanel->onclick->custom = true;
             $menuCpanel->onclick->js = 'javascript:history.go(-1)';
             $menuCpanel->title = _JNEWS_MENU_CPANEL;
             $menuA['cpanel'] = $menuCpanel;
             frontHTML::formStart(_JNEWS_LEADS_REP, 0, '', $menuA);
             frontHTML::FEmenu();
             frontHTML::formEndFN(null, '');
             $params = new stdClass();
             $params->controller = 'redirect';
             $params->task = 'listing';
             $params->option = JNEWS_OPTION;
             $params->wid = WGet::extension('redirect.node', 'wid');
             $this->layout = WView::get('redirects_listing', 'html', null, '', $params);
             $view = $this->layout->make();
             $view = str_replace('option=com_jcenter&controller=redirect-history', 'option=' . JNEWS_OPTION . '&act=leads&task=show&mid=7', $view);
             $view = str_replace('option=com_jcenter&controller=redirect&task=edit', 'option=' . JNEWS_OPTION . '&act=leads&mid=7&type=50', $view);
     }
     WPage::addScript(JOOBI_JS . 'rootscript.js');
     echo $view;
     return true;
 }
Пример #4
0
 function mailingEdit($subscriberId, $mailingId, $listId, $listType, $action)
 {
     global $my, $Itemid;
     if (ACA_CMSTYPE) {
         // joomla 15
         $issue_nb = JRequest::getVar('issue_nb', '0');
         $my =& JFactory::getUser();
     } else {
         //joomla 1x
         $issue_nb = intval(mosGetParam($_REQUEST, 'issue_nb', 0));
         global $my;
     }
     //endif
     $accessGrant = false;
     $new = 0;
     if (class_exists('pro')) {
         if ($issue_nb == 0) {
             $issue_nb = xmailing::countMailings($listId, '');
             $issue_nb++;
         }
         if ($listId > 0) {
             $list = lists::getOneList($listId);
             $mailing = xmailing::getOneMailing($list, $mailingId, $issue_nb, $new);
             $acc_level = $list->acc_level;
         } else {
             return false;
         }
         if (acajoom::checkPermissions('hello', 0, $acc_level)) {
             $accessGrant = true;
         }
     } else {
         if ($subscriberId != 0 and ($my->usertype == 'Administrator' or $my->usertype == 'Super Administrator')) {
             $accessGrant = true;
         }
     }
     if ($accessGrant) {
         if ($issue_nb == 0) {
             $issue_nb = xmailing::countMailings($listId, '');
             $issue_nb++;
         }
         if (empty($mailing)) {
             if ($mailingId > 0) {
                 $mailing = xmailing::getOneMailing('', $mailingId, $issue_nb, $new);
             } else {
                 if ($listId > 0) {
                     $list = lists::getOneList($listId);
                     $mailing = xmailing::getOneMailing($list, $mailingId, $issue_nb, $new);
                 } else {
                     return false;
                 }
             }
         }
         $mainLink = '.php?option=com_acajoom&act=savemailing';
         compa::completeLink($mainLink, false);
         $forms['main'] = '<form method="post" enctype="multipart/form-data" action="' . $mainLink . '" onsubmit="submitbutton();return false;" name="adminForm" >' . "\n\r";
         $forms['main'] .= '<input type="hidden" name="Itemid" value="' . $Itemid . '" />';
         $show = lisType::showType($mailing->list_type, 'editmailing');
         frontHTML::formStart(_ACA_EDIT_A . @constant($GLOBALS[ACA . 'listname' . $mailing->list_type]), $mailing->html, 'edit_mailing');
         mailingsHTML::editMailing($mailing, $new, $listId, $forms, $show);
         $go[] = acajoom::makeObj('act', $action);
         frontHTML::formEnd(_CMN_SAVE . ' ' . @constant($GLOBALS[ACA . 'listname' . $mailing->list_type]), $go);
     } else {
         echo acajoom::printM('red', _NOT_AUTH);
     }
     return true;
 }