Exemplo n.º 1
0
 function saveMailing(&$mailingId, $listId)
 {
     global $database;
     $list = lists::getOneList($listId);
     $allow_html = compa::allow_html();
     $erro = new xerr(__FILE__, __FUNCTION__, __CLASS__);
     $xf = new xonfig();
     $listType = mosGetParam($_REQUEST, 'listype', 0);
     $senddate = mosGetParam($_REQUEST, 'senddate', '0000-00-00 00:00:00');
     if (mosGetParam($_REQUEST, 'task', '') == 'saveSend') {
         $senddate = acajoom::getNow();
     }
     $subject = mosGetParam($_REQUEST, 'subject', '', $allow_html);
     $content = mosGetParam($_REQUEST, 'content', '', $allow_html);
     $alt_content = mosGetParam($_REQUEST, 'alt_content', '', _MOS_ALLOWRAW);
     $published = mosGetParam($_REQUEST, 'published', 0);
     $visible = mosGetParam($_REQUEST, 'visible', 1);
     $html = mosGetParam($_REQUEST, 'html', 1);
     $new_list = mosGetParam($_REQUEST, 'new_list', 0);
     $fromname = mosGetParam($_REQUEST, 'fromname', '');
     $fromemail = mosGetParam($_REQUEST, 'fromemail', '');
     $frombounce = mosGetParam($_REQUEST, 'frombounce', '');
     $userid = mosGetParam($_REQUEST, 'userid', 0);
     $delay = mosGetParam($_REQUEST, 'delay', 1);
     $acc_level = mosGetParam($_REQUEST, 'acc_level', $list->acc_id);
     $issue_nb = mosGetParam($_REQUEST, 'issue_nb', 1);
     $delay = $delay * 24 * 60;
     $attachments = mosGetParam($_REQUEST, 'attachments', '');
     $attach = '';
     if (!empty($attachments)) {
         foreach ($attachments as $attachment) {
             $attach .= $attachment . "\n";
         }
     }
     if (!empty($_FILES['file_0']['name'])) {
         $otherAttachs = xmailing::uploadFiles();
         if (!empty($otherAttachs)) {
             foreach ($otherAttachs as $otherAttach) {
                 $attach .= '/' . $otherAttach . "\n";
             }
         }
     }
     $images = mosGetParam($_REQUEST, 'images', '');
     if ($html == 0) {
         $alt_content = $content;
     }
     if ($senddate != '0000-00-00 00:00:00' and $senddate > acajoom::getNow()) {
         $published = 2;
     }
     if ($new_list != 0) {
         $query = 'INSERT INTO `#__acajoom_mailings` (`list_id`, `list_type`, `send_date`, `subject`, `htmlcontent`, `textonly`, `attachments`, `images`, `published`, `html`, `visible`, `fromname`, `fromemail`, `frombounce`, `author_id`, `delay`, `issue_nb` , `acc_level` , `createdate`) VALUES( \'' . $listId . '\', \'' . $listType . '\', \'' . $senddate . '\', \'' . addslashes($subject) . '\', \'' . addslashes($content) . '\', \'' . addslashes($alt_content) . '\', \'' . $attach . '\', \'' . $images . '\', \'' . $published . '\', \'' . $html . '\', \'' . $visible . '\', \'' . $fromname . '\', \'' . $fromemail . '\', \'' . $frombounce . '\', \'' . $userid . '\', \'' . $delay . '\', \'' . $issue_nb . '\', \'' . $acc_level . '\' , \'' . acajoom::getNow() . '\' ) ';
         $database->setQuery($query);
         $database->query();
         $erro->err = $database->getErrorMsg();
         $query = 'SELECT max(id) FROM `#__acajoom_mailings` WHERE `list_id` = ' . $listId . ' AND `issue_nb` = \'' . $issue_nb . '\'';
         $query .= ' AND `published` != -1 ';
         $database->setQuery($query);
         $mailingId = $database->loadResult();
         $erro->err .= $database->getErrorMsg();
         if ($mailingId == 1) {
             $xf->update('firstmailing', $listType);
         }
         $xf->plus('totalmailing0', 1);
         $xf->plus('act_totalmailing0', 1);
         $xf->plus('totalmailing' . $listType, 1);
         $xf->plus('act_totalmailing' . $listType, 1);
         xmailing::insertStatsGlobal($mailingId);
     } else {
         $query = "UPDATE `#__acajoom_mailings` SET " . "\t`subject` = '" . addslashes($subject) . "', " . "\t`htmlcontent` = '" . addslashes($content) . "', " . "\t`textonly` = '" . addslashes($alt_content) . "', " . "\t`attachments` = '{$attach}', " . "\t`images` = '{$images}', " . "\t`published` = '{$published}', " . "\t`html` = {$html} , " . "\t`visible` = {$visible} , " . "\t`fromname` = '{$fromname}', " . "\t`fromemail` = '{$fromemail}', " . "\t`frombounce` = '{$frombounce}', " . "\t`author_id` =  '{$userid}' , " . "\t`delay` = {$delay} , " . "\t`acc_level` = {$acc_level} , " . "\t`send_date` = '{$senddate}' " . "\tWHERE `id` = {$mailingId} ";
         $database->setQuery($query);
         $database->query();
         $erro->err = $database->getErrorMsg();
     }
     if (!$erro->E(__LINE__, '8414', $database)) {
         return false;
     } else {
         lisType::updateNewsletters();
         if ($listType == 2) {
             if ($new_list) {
                 $subscribers = subscribers::getSubscribers(-1, -1, '', $total, $listId, '', 1, 1, '');
             } else {
                 $subscribers = subscribers::getSubscribers(-1, -1, '', $total, $listId, $mailingId, 1, 1, '');
             }
             $subsId = acajoom::convertObjectToIdList($subscribers, 'id');
             if (!empty($subsId)) {
                 $queues = queue::getAllOneList($listId);
                 if (!empty($queues)) {
                     if ($queues[0]->mailing_id == 0) {
                         $qids = acajoom::convertObjectToIdList($queues, 'qid');
                         $erro->ck = queue::updateQueues('', $qids, $listId, $acc_level, false);
                     } else {
                         $erro->ck = queue::updateQueues($subsId, '', $listId, $acc_level, false);
                     }
                 } else {
                     return true;
                 }
                 if (!$erro->Eck(__LINE__, '8415')) {
                     return false;
                 }
             }
         } elseif ($listType == 1 and $senddate > acajoom::getNow()) {
             $subscribers = subscribers::getSubscribers(-1, -1, '', $total, $listId, '', 1, 1, '');
             $subsId = acajoom::convertObjectToIdList($subscribers, 'id');
             if (!empty($subsId)) {
                 if ($new_list == 1) {
                     if (class_exists('auto')) {
                         $erro->ck = auto::insertQueuesForScheduledNews($subsId, $listId, $acc_level, $mailingId, $senddate);
                     }
                 } else {
                     $queues = queue::getQueueFromMailingId($mailingId);
                     if (!empty($queues)) {
                         $erro->ck = queue::updateQueueData('', $subsId, 1, $listId, $mailingId, $issue_nb, $senddate, 0, $acc_level, 2);
                         return $erro->Eck(__LINE__, '8417', 'put here 1 $d');
                     } else {
                         if (class_exists('auto')) {
                             $erro->ck = auto::insertQueuesForScheduledNews($subsId, $listId, $acc_level, $mailingId, $senddate);
                         }
                     }
                 }
                 return $erro->Eck(__LINE__, '8416', 'put here 2 $d');
             }
         }
         return true;
     }
 }
Exemplo n.º 2
0
 function checkNewVersion()
 {
     static $available = false;
     $xf = new xonfig();
     $canUpdate = false;
     if ($this->canUpdate()) {
         foreach ($this->compsList as $compList) {
             if ($compList[0] == $this->local['component'] and $compList[1] == $this->local['type'] and $this->checkVersion($this->local['version'], $compList[2])) {
                 $joomlaVer = new joomlaVersion();
                 $joomla = $joomlaVer->getShortVersion();
                 $value = $compList[3] . '_' . $compList[2];
                 if (empty($this->local[$value . '_requirement']) or $this->requiredVersion($joomla, $this->local[$value . '_requirement'])) {
                     $xf->update('update_avail', '1');
                     $available = true;
                     if (isset($this->local[$value . '_message']) and defined('_ACA_UPDATE_MESS' . $this->local[$value . '_message'])) {
                         $xf->update('update_message', @constant('_ACA_UPDATE_MESS' . $this->local[$value . '_message']));
                     } else {
                         $xf->update('update_message', '');
                     }
                 } else {
                     $xf->update('update_avail', '0');
                 }
             } else {
                 $xf->update('update_avail', '0');
             }
         }
     }
     $xf->update('date_update', acajoom::getNow());
     return $available;
 }
Exemplo n.º 3
0
 function updateActiveList()
 {
     $xf = new xonfig();
     $j = 0;
     $nb = array();
     for ($i = 1; $i < $GLOBALS[ACA . 'nblist']; $i++) {
         if ($GLOBALS[ACA . 'listype' . $i] == 1) {
             $j++;
             $nb[$j] = $i;
         }
     }
     $activeList = implode(",", $nb);
     return $xf->update('activelist', $activeList);
 }
Exemplo n.º 4
0
 function checkCBPlugin()
 {
     $xf = new xonfig();
     if (!file_exists($GLOBALS['mosConfig_absolute_path'] . '/components/com_comprofiler/plugin/user/plug_acajoomcbplugin/acajoom_cb.php')) {
         $xf->update('cb_pluginInstalled', '0');
         return false;
     }
     $xf->update('cb_pluginInstalled', '1');
     return true;
 }
Exemplo n.º 5
0
function installPlugin()
{
    if (ACA_CMSTYPE) {
        $database =& JFactory::getDBO();
    } else {
        global $database;
    }
    //endif
    $return = '<b>' . _ACA_INSTALL_PLUGIN . '</b> : ';
    $error = '';
    $files = array('acajoom_cb.php', 'acajoom_cb.xml', 'index.html');
    if (!is_file(ACA_JPATH_ROOT . '/components/com_comprofiler/plugin/user/plug_acajoomcbplugin/acajoom_cb.php')) {
        @mkdir(ACA_JPATH_ROOT . '/components/com_comprofiler/plugin/user/plug_acajoomcbplugin', 0755);
        @chmod(ACA_JPATH_ROOT . '/components/com_comprofiler/plugin/user/plug_acajoomcbplugin', 0755);
    }
    foreach ($files as $file) {
        if (is_file(ACA_JPATH_ROOT . '/components/com_comprofiler/plugin/user/plug_acajoomcbplugin/' . $file)) {
            @unlink(WPATH_ADMIN . 'cbplugin/' . $file);
        } else {
            if (!@rename(WPATH_ADMIN . 'cbplugin/' . $file, ACA_JPATH_ROOT . '/components/com_comprofiler/plugin/user/plug_acajoomcbplugin/' . $file)) {
                $error .= '<br /> Error copying plugin file ' . $file . ' to CB plugin directory.';
            }
        }
    }
    if (is_file(ACA_JPATH_ROOT . '/components/com_comprofiler/plugin/user/plug_acajoomcbplugin/acajoom_cb.php')) {
        @chmod(ACA_JPATH_ROOT . '/components/com_comprofiler/plugin/user/plug_acajoomcbplugin', 0755);
    }
    if (!@rmdir(WPATH_ADMIN . 'cbplugin/')) {
        $error .= '<br /> Error deleting the temporary cbplugin directory.';
    }
    $query = "SELECT `id` FROM `#__comprofiler_plugin` WHERE `folder` = 'plug_acajoomcbplugin' ";
    $database->setQuery($query);
    $database->query();
    $id = $database->loadResult();
    $mysqlerror = $database->getErrorMsg();
    if (!empty($mysqlerror)) {
        $error .= '<br />Error getting plugin information from cb plugin table. Database error: <br />' . $mysqlerror . '';
    } else {
        if ($id < 1) {
            $row->name = 'Acajoom CB Plugin';
            $row->element = 'acajoom_cb';
            $row->type = 'user';
            $row->folder = 'plug_acajoomcbplugin';
            $row->ordering = '99';
            $query = "INSERT INTO `#__comprofiler_plugin` (`name` , `element`, `type`, `ordering`, `folder`) VALUES ( " . "'{$row->name}', " . "'{$row->element}', " . "'{$row->type}', " . "'{$row->ordering}', " . " '{$row->folder}' ) ";
            $database->setQuery($query);
            $database->query();
            $error .= $database->getErrorMsg();
            if (!empty($error)) {
                $error .= '<br />Error adding plug information to CB plug table.';
            }
            $query = "SELECT `id` FROM `#__comprofiler_plugin` WHERE `folder` = 'plug_acajoomcbplugin' ";
            $database->setQuery($query);
            $database->query();
            $id = $database->loadResult();
            $error .= $database->getErrorMsg();
            $row = '';
            $row->title = 'Mailing Lists';
            $row->description = 'Listing of all the mailing lists for Acajoom';
            $row->ordering = '99';
            $row->width = '.5';
            $row->enabled = '0';
            $row->pluginclass = 'getAcajoomTab';
            $row->pluginid = $id;
            $row->sys = '0';
            $row->params = 'NULL';
            $row->displaytype = 'tab';
            $row->position = 'cb_tabmain';
            $query = "INSERT INTO `#__comprofiler_tabs` (`title` , `description`, `ordering`, `width`, `enabled`, " . " `pluginclass` , `pluginid`, `sys`, `displaytype`, `params` , `position` ) VALUES ( " . "'{$row->title}', " . "'{$row->description}', " . "'{$row->ordering}', " . "'{$row->width}', " . "'{$row->enabled}', " . "'{$row->pluginclass}', " . "'{$row->pluginid}', " . "'{$row->sys}', " . "'{$row->displaytype}', " . "'{$row->params}', " . "'{$row->position}' ) ";
            $database->setQuery($query);
            $database->query();
            $error .= $database->getErrorMsg();
            if (!empty($error)) {
                $error .= '<br />Error adding plug information to CB tab table.';
            }
        }
    }
    if (empty($error)) {
        $xf = new xonfig();
        $xf->update('cb_pluginInstalled', '1');
        $return .= acajoom::printM('green', _ACA_INSTALL_SUCCESS) . '<br />';
    } else {
        $return .= $error . acajoom::printM('red', _ACA_INSTALL_ERROR) . '<br />';
    }
    return $return;
}
Exemplo n.º 6
0
function configuration($action, $task)
{
    global $database;
    $config = array();
    $redirect = true;
    $xf = new xonfig();
    $message = mosGetParam($_REQUEST, 'message', '');
    switch ($task) {
        case 'sendQueue':
            if (class_exists('auto')) {
                echo acajoom::printYN(auto::processQueue(true, true), _ACA_QUEUE_SENT_SUCCESS, _ACA_ERROR);
            }
            backHTML::_header(_ACA_MENU_CONF, 'menu.png', $message, $task, $action);
            configHTML::showConfigEdit($GLOBALS);
            break;
        case 'reset':
            $xf->update('next_autonews', '');
            $xf->update('last_cron', '');
            $xf->update('last_sub_update', '');
            $query = "UPDATE #__acajoom_lists SET `next_date` = '0' WHERE list_type = 7";
            $database->setQuery($query);
            $database->query();
            echo acajoom::printYN(true, ' Smart-Newsletter counter reset successful! ', _ACA_ERROR);
            backHTML::_header(_ACA_MENU_CONF, 'menu.png', $message, $task, $action);
            configHTML::showConfigEdit($GLOBALS);
        case 'syncUsers':
            echo acajoom::printYN(subscribers::syncSubscribers(), _ACA_SYNC_USERS_SUCCESS, _ACA_ERROR);
            backHTML::_header(_ACA_MENU_CONF, 'menu.png', $message, $task, $action);
            configHTML::showConfigEdit($GLOBALS);
        case 'apply':
            $clear_log = mosGetParam($_REQUEST, 'clear_log', 0);
            if ($clear_log != 0) {
                unlink($GLOBALS['save_log_file']);
            }
            if (empty($config)) {
                $config = $_REQUEST['config'];
            }
            $message = acajoom::printYN($xf->saveConfig($config), _ACA_CONFIG_UPDATED, _ACA_ERROR);
            $xf->updateActiveList();
            compa::redirect('index2.php?option=com_acajoom&act=configuration&message=' . $message);
            break;
        case 'save':
            $clear_log = mosGetParam($_REQUEST, 'clear_log', 0);
            if ($clear_log != 0) {
                @unlink($GLOBALS['save_log_file']);
            }
            if (empty($config)) {
                $config = $_REQUEST['config'];
            }
            $message = acajoom::printYN($xf->saveConfig($config), _ACA_CONFIG_UPDATED, _ACA_ERROR);
            $xf->updateActiveList();
            backHTML::controlPanel();
            break;
        case 'cancel':
            compa::redirect('index2.php?option=com_acajoom');
            break;
        case 'cpanel':
            backHTML::controlPanel();
            break;
        default:
            backHTML::_header(_ACA_MENU_CONF, 'menu.png', $message, $task, $action);
            configHTML::showConfigEdit($GLOBALS);
            break;
    }
    return true;
}
Exemplo n.º 7
0
 function updateSubscribers($force = false, $install = false)
 {
     global $database;
     $time = isset($GLOBALS[ACA . 'last_sub_update']) && $GLOBALS[ACA . 'last_sub_update'] > 0 ? $GLOBALS[ACA . 'last_sub_update'] : 200000;
     $newTask = mktime(date("H") - 1, date("i"), date("s"), date("m"), date("d"), date("Y"));
     if ($force or $newTask > $GLOBALS[ACA . 'last_sub_update']) {
         $erro = new xerr(__FILE__, __FUNCTION__, __CLASS__);
         $xf = new xonfig();
         $newtime = mktime(date("H", $time), date("i", $time), date("s", $time), date("m", $time), date("d", $time) - 2, date("Y", $time));
         if ($install) {
             $newtime = 0;
         }
         $oneDay = date('Y-m-d H:i:s', $newtime);
         $query = 'SELECT M.* FROM `#__users` AS M ' . ' LEFT JOIN `#__acajoom_subscribers` AS N ON M.id = N.user_id OR M.email = N.email ';
         $query .= ' WHERE M.registerDate > \'' . $oneDay . '\'';
         $query .= ' AND  N.id IS NULL AND M.block=0 ';
         $database->setQuery($query);
         $rows = $database->loadObjectList();
         $erro->err = $database->getErrorMsg();
         $erro->E(__LINE__, '8638', $database);
         if ($erro->result and !empty($rows)) {
             foreach ($rows as $row) {
                 $query = "INSERT INTO `#__acajoom_subscribers` (`user_id`,`subscribe_date`, `name`,`email`,`confirmed`)";
                 $query .= " VALUES ( {$row->id} , '{$row->registerDate}', '{$row->name}', '{$row->email}' , 1 ) ";
                 $database->setQuery($query);
                 $database->query();
                 $erro->err = $database->getErrorMsg();
                 $xf->plus('totalsubcribers0', 1);
                 $xf->plus('act_totalsubcribers0', 1);
                 $lists = lists::getLists(0, 0, null, '', true, false, false);
                 if (!empty($lists)) {
                     foreach ($lists as $list) {
                         $qid[0] = subscribers::getSubscriberId($row->registerDate);
                         $subscriber = subscribers::getSubscribersFromId($qid, false);
                         $subId = array();
                         if (isset($subscriber->id)) {
                             $subId[0] = $subscriber->id;
                             $erro->ck = queue::updateQueues($subId, '', $list->id, @$list->acc_id, true);
                             $erro->Eck(__LINE__, '8640');
                         }
                     }
                 }
             }
         }
         $query = 'SELECT M.* FROM `#__acajoom_subscribers` AS M ' . ' LEFT JOIN `#__users` AS N ON N.id = M.user_id ';
         $query .= ' WHERE N.registerDate > \'' . $oneDay . '\'';
         $query .= ' AND M.subscribe_date > \'' . $oneDay . '\'';
         $query .= ' AND  N.id IS NULL  AND M.user_id>0 ORDER BY N.id ';
         $database->setQuery($query);
         $rows = $database->loadObjectList();
         $erro->err = $database->getErrorMsg();
         $erro->E(__LINE__, '8641', $database);
         if ($erro->result and !empty($rows)) {
             foreach ($rows as $row) {
                 $query = 'DELETE FROM `#__acajoom_subscribers` WHERE `id` = ' . $row->id;
                 $database->setQuery($query);
                 $database->query();
                 $erro->err = $database->getErrorMsg();
                 $erro->E(__LINE__, '8643', $database);
                 $xf->plus('act_totalsubcribers0', -1);
                 $erro->ck = queue::deleteSubsQueue($row->id, '');
                 $erro->Eck(__LINE__, '8644');
             }
         }
         $query = 'SELECT N.id, N.name , N.email , N.block  FROM `#__users` AS N ' . ' LEFT JOIN `#__acajoom_subscribers` AS M ON N.id = M.user_id ';
         $query .= ' WHERE  N.registerDate > \'' . $oneDay . '\'';
         $query .= ' AND M.subscribe_date > \'' . $oneDay . '\'';
         $query .= ' AND M.name != N.name  OR M.email != N.email OR N.block = M.confirmed ';
         $database->setQuery($query);
         $rows = $database->loadObjectList();
         $erro->err = $database->getErrorMsg();
         $erro->E(__LINE__, '8646', $database);
         if ($erro->result and !empty($rows)) {
             foreach ($rows as $row) {
                 if ($row->block == 1) {
                     $status = 0;
                 } else {
                     $status = 1;
                 }
                 $query = "UPDATE `#__acajoom_subscribers` SET `name` ='" . $row->name . "' " . ", `email` = '" . $row->email . "' " . ", `confirmed` ='" . $status . "'  WHERE `user_id` = " . $row->id;
                 $database->setQuery($query);
                 $database->query();
                 $erro->err = $database->getErrorMsg();
             }
         }
         $query = 'SELECT N.id , N.email FROM `#__users` AS N ';
         $query .= 'LEFT JOIN `#__acajoom_subscribers` AS M ON N.email = M.email ';
         $query .= ' WHERE N.registerDate > \'' . $oneDay . '\'';
         $query .= ' AND M.subscribe_date > \'' . $oneDay . '\'';
         $query .= ' AND M.user_id = 0 AND N.block = 0 ';
         $database->setQuery($query);
         $rows = $database->loadObjectList();
         $erro->err = $database->getErrorMsg();
         if ($erro->E(__LINE__, '8662', $database) and !empty($rows)) {
             foreach ($rows as $row) {
                 $query = "UPDATE `#__acajoom_subscribers` AS S SET `user_id` = " . $row->id;
                 $query .= " WHERE S.email = '{$row->email}'";
                 $database->setQuery($query);
                 $database->query();
                 $erro->err = $database->getErrorMsg();
             }
         }
         $xf->update('last_sub_update', time());
         return $erro->R();
     }
 }
Exemplo n.º 8
0
 function checkCBPlugin()
 {
     $xf = new xonfig();
     if (!file_exists(ACA_JPATH_ROOT . '/components/com_comprofiler/plugin/user/plug_acajoomcbplugin/acajoom_cb.php') and !file_exists(ACA_JPATH_ROOT . '/components/com_comprofiler/plugin/user/plug_acajoomcb/acajoom_cb.php')) {
         $xf->update('cb_pluginInstalled', '0');
         return false;
     }
     $xf->update('cb_pluginInstalled', '1');
     $xf->update('cb_integration', '1');
     return true;
 }
Exemplo n.º 9
0
function configuration($action, $task)
{
    if (ACA_CMSTYPE) {
        $database =& JFactory::getDBO();
    } else {
        global $database;
    }
    //endif
    $config = array();
    $redirect = true;
    $xf = new xonfig();
    if (ACA_CMSTYPE) {
        // joomla 15
        $message = JRequest::getVar('message', '');
    } else {
        //joomla 1x
        $message = mosGetParam($_REQUEST, 'message', '');
    }
    //endif
    switch ($task) {
        case 'sendQueue':
            if (class_exists('auto')) {
                echo acajoom::printYN(auto::processQueue(true, true), 'Queue processed', _ACA_ERROR);
            }
            auto::displayStatus();
            backHTML::_header(_ACA_MENU_CONF, 'menu.png', $message, $task, $action);
            configHTML::showConfigEdit($GLOBALS);
            break;
        case 'reset':
            $xf->update('next_autonews', '');
            $xf->update('last_cron', '');
            $xf->update('last_sub_update', '');
            $query = "UPDATE #__acajoom_lists SET `next_date` = '0' WHERE list_type = 7";
            $database->setQuery($query);
            $database->query();
            echo acajoom::printYN(true, ' Smart-Newsletter counter reset successful! ', _ACA_ERROR);
            backHTML::_header(_ACA_MENU_CONF, 'menu.png', $message, $task, $action);
            configHTML::showConfigEdit($GLOBALS);
            break;
        case 'syncUsers':
            echo acajoom::printYN(subscribers::syncSubscribers(), _ACA_SYNC_USERS_SUCCESS, _ACA_ERROR);
            backHTML::_header(_ACA_MENU_CONF, 'menu.png', $message, $task, $action);
            configHTML::showConfigEdit($GLOBALS);
            break;
        case 'apply':
            if (ACA_CMSTYPE) {
                // joomla 15
                $clear_log = JRequest::getVar('clear_log', '0');
            } else {
                //joomla 1x
                $clear_log = mosGetParam($_REQUEST, 'clear_log', 0);
            }
            //endif
            if ($clear_log != 0) {
                unlink(ACA_JPATH_ROOT_NO_ADMIN . $GLOBALS[ACA . 'save_log_file']);
            }
            if (empty($config)) {
                $config = $_REQUEST['config'];
            }
            $message = strip_tags(acajoom::printYN($xf->saveConfig($config), _ACA_CONFIG_UPDATED, _ACA_ERROR));
            $xf->updateActiveList();
            compa::redirect('index2.php?option=com_acajoom&act=configuration&message=' . $message);
            break;
        case 'save':
            if (ACA_CMSTYPE) {
                // joomla 15
                $clear_log = JRequest::getVar('clear_log', '0');
            } else {
                //joomla 1x
                $clear_log = mosGetParam($_REQUEST, 'clear_log', 0);
            }
            //endif
            if ($clear_log != 0) {
                @unlink(ACA_JPATH_ROOT_NO_ADMIN . $GLOBALS[ACA . 'save_log_file']);
            }
            if (empty($config)) {
                $config = $_REQUEST['config'];
            }
            $message = acajoom::printYN($xf->saveConfig($config), _ACA_CONFIG_UPDATED, _ACA_ERROR);
            $xf->updateActiveList();
            backHTML::controlPanel();
            break;
        case 'cancel':
            compa::redirect('index2.php?option=com_acajoom');
            break;
        case 'cpanel':
            backHTML::controlPanel();
            break;
        default:
            backHTML::_header(_ACA_MENU_CONF, 'menu.png', $message, $task, $action);
            configHTML::showConfigEdit($GLOBALS);
            break;
    }
    return true;
}
Exemplo n.º 10
0
function update($action, $task)
{
    $update = new wupdate();
    $showListing = true;
    $showComplete = false;
    $message = mosGetParam($_REQUEST, 'message', '');
    if (ini_get('safe_mode')) {
    } else {
        @set_time_limit(60 * $GLOBALS[ACA . 'script_timeout']);
    }
    /*if ((ini_get('allow_url_fopen') == false && !in_array('curl', get_loaded_extensions())) || ini_get('safe_mode') == true) {
    		 echo _ACA_WARNING_1011;
    		 return;
    	 }*/
    switch ($task) {
        case 'doUpdate':
            backHTML::_header(_ACA_MENU_UPDATE, 'update', $message, $task, $action);
            $update->doUpdate();
            $showListing = false;
            $showComplete = false;
            break;
        case 'version':
            $update->getVersion();
            break;
        case 'complete':
            $update->checkNewVersion();
            $update->completeCheck($message);
            $showComplete = true;
            $showListing = false;
            break;
        case 'cancel':
            compa::redirect('index2.php?option=com_acajoom&act=update');
            $showListing = false;
            break;
        case 'cpanel':
            compa::redirect('index2.php?option=com_acajoom');
            $showListing = false;
            break;
        case 'new1':
            backHTML::_header(_ACA_MENU_UPDATE, 'backup.png', $message, $task, $action);
            $message = acajoom::printYN(acajoom::upgrade_News1(), '<br />' . _ACA_IMPORT_SUCCESS . ' Anjel data', _ACA_ERROR);
            acajoom::resetUpgrade(1);
            echo '<br />' . $message;
            break;
        case 'new2':
            backHTML::_header(_ACA_MENU_UPDATE, 'backup.png', $message, $task, $action);
            $message = acajoom::printYN(acajoom::upgrade_News2(), '<br />' . _ACA_IMPORT_SUCCESS . ' Letterman data', _ACA_ERROR);
            acajoom::resetUpgrade(2);
            echo '<br />' . $message;
            break;
        case 'new3':
            backHTML::_header(_ACA_MENU_UPDATE, 'backup.png', $message, $task, $action);
            $message = acajoom::printYN(acajoom::upgrade_News3(), '<br />' . _ACA_IMPORT_SUCCESS . ' YaNC data', _ACA_ERROR);
            acajoom::resetUpgrade(3);
            echo '<br />' . $message;
            break;
        case 'show':
        default:
            $newVersion = $update->checkUpdate($message);
            if ($newVersion) {
                $xf = new xonfig();
                $xf->update('update_avail', 0);
            }
    }
    if ($showListing) {
        backHTML::_header(_ACA_MENU_UPDATE, 'backup.png', $message, $task, $action);
        backHTML::_upgrade();
        $forms['main'] = " <form action='index2.php' method='post' name='adminForm'> \n";
        echo $forms['main'];
        backHTML::formStart('', '', '');
        backHTML::showCompsList($update);
        $go[] = acajoom::makeObj('act', $action);
        backHTML::formEnd($go);
    } elseif ($showComplete) {
        backHTML::_header(_ACA_MENU_UPDATE, 'backup.png', $message, $task, $action);
        $forms['main'] = " <form action='index2.php' method='post' name='adminForm'> \n";
        echo $forms['main'];
        backHTML::formStart('', '', '');
        backHTML::showUpdateOptions($update);
        $go[] = acajoom::makeObj('act', $action);
        backHTML::formEnd($go);
    }
}