Exemple #1
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;
 }
Exemple #2
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;
 }