Example #1
0
 function updateList($listId, $listUpdated, $status, $new)
 {
     $erro = new xerr(__FILE__, __FUNCTION__, __CLASS__);
     $total = 0;
     @set_time_limit(0);
     if ($listUpdated->list_type != '7' and $listUpdated->delay_min > $listUpdated->delay_max) {
         $listUpdated->delay_min = $listUpdated->delay_max;
     }
     $erro->ck = lists::updateListData($listUpdated);
     if (!$erro->Eck(__LINE__, '8304')) {
         return false;
     } else {
         if ($listUpdated->auto_add == 2) {
             subscribers::updateSubscribers(true);
             $subscribers = subscribers::getSubscribers(-1, -1, '', $total, 0, '', 1, 1, '');
             $subId = acajoom::convertObjectToIdList($subscribers, 'id');
             if (!empty($subId)) {
                 $erro->ck = queue::updateQueues($subId, '', $listId, $listUpdated->acc_id, $new);
                 if (!$erro->Eck(__LINE__, '8305')) {
                     return false;
                 }
             }
         } elseif ($status == '' and $listUpdated->list_type == 2) {
             $queues = queue::getAllOneList($listId);
             $qid = acajoom::convertObjectToIdList($queues, 'qid');
             $erro->ck = queue::updatePublished($qid, $status);
             if (!$erro->Eck(__LINE__, '8306')) {
                 return false;
             }
         } else {
             if (class_exists('auto')) {
                 auto::updateListNb($listUpdated->list_type, $listUpdated->id);
             }
         }
     }
     lisType::updateNewsletters();
     return true;
 }
Example #2
0
/**
* @copyright Copyright (C) 2009 Joobi Limited All rights reserved.
* @license This file is released under the GPL license (http://www.gnu.org/licenses )
* @link http://www.ijoobi.com
*/
function subscribers($action, $task, $userid, $listId, $cid)
{
    $erro = new xerr(__FILE__, __FUNCTION__);
    if (ACA_CMSTYPE) {
        // joomla 15
        $subscriberId = intval(JRequest::getVar('subscriber_id', ''));
        $message = JRequest::getVar('message', '');
    } else {
        //joomla 1x
        $subscriberId = intval(mosGetParam($_REQUEST, 'subscriber_id', ''));
        $message = mosGetParam($_REQUEST, 'message', '');
    }
    //endif
    $doShowSubscribers = true;
    subscribers::updateSubscribers();
    switch ($task) {
        case 'updateOneSub':
            $doShowSubscribers = true;
            $message = acajoom::printYN(subscribers::updateOneSubscriber(), _ACA_UPDATED_SUCCESSFULLY, _ACA_ERROR);
            backHTML::_header(_ACA_MENU_SUBSCRIBERS, 'addusers.png', $message, $task, $action);
            break;
        case 'deleteOneSub':
            $doShowSubscribers = true;
            $message = acajoom::printYN(subscribers::deleteOneSubscriber($subscriberId), _ACA_SUBSCRIBER_DELETED, _ACA_ERROR);
            backHTML::_header(_ACA_MENU_SUBSCRIBERS, 'addusers.png', $message, $task, $action);
            break;
        case 'cancelSub':
            $doShowSubscribers = true;
            backHTML::_header(_ACA_MENU_SUBSCRIBERS, 'addusers.png', $message, $task, $action);
            break;
        case 'edit':
            foreach ($cid as $id) {
                compa::redirect('index2.php?option=com_acajoom&act=subscribers&task=show&userid=' . $id);
            }
            break;
        case 'show':
            $doShowSubscribers = false;
            $qid[0] = $userid;
            $subscriber = subscribers::getSubscribersFromId($qid, false);
            $lists = lists::getLists(0, 0, 1, '', false, false);
            $queues = queue::getSubscriberLists($userid);
            $forms['main'] = " <form action='index2.php' method='post' name='adminForm'> \n";
            backHTML::_header(_ACA_MENU_SUBSCRIBERS, 'addusers.png', $message, $task, $action);
            backHTML::formStart('', 0, '');
            echo subscribersHTML::editSubscriber($subscriber, $lists, $queues, $forms, acajoom::checkPermissions('admin'), false, false);
            $go[] = acajoom::makeObj('act', $action);
            $go[] = acajoom::makeObj('subscriber_id', $subscriber->id);
            $go[] = acajoom::makeObj('user_id', $subscriber->user_id);
            backHTML::formEnd($go);
            break;
        case 'new':
        case 'add':
            $doShowSubscribers = false;
            $newSubscriber->id = '';
            $newSubscriber->user_id = 0;
            $newSubscriber->name = '';
            $newSubscriber->email = '';
            $newSubscriber->receive_html = 1;
            $newSubscriber->confirmed = 1;
            $newSubscriber->blacklist = 0;
            $newSubscriber->timezone = '00:00:00';
            $newSubscriber->language_iso = 'eng';
            $newSubscriber->params = '';
            $newSubscriber->subscribe_date = acajoom::getNow();
            $lists = lists::getLists(0, 0, 1, '', false, false);
            $queues = '';
            $forms['main'] = " <form action='index2.php' method='post' name='adminForm'> \n";
            backHTML::_header(_ACA_MENU_SUBSCRIBERS, 'addusers.png', $message, $task, $action);
            backHTML::formStart('', 0, '');
            echo subscribersHTML::editSubscriber($newSubscriber, $lists, $queues, $forms, acajoom::checkPermissions('admin'), false, false);
            $go[] = acajoom::makeObj('act', $action);
            $go[] = acajoom::makeObj('subscriber_id', $newSubscriber->id);
            $go[] = acajoom::makeObj('user_id', $newSubscriber->user_id);
            backHTML::formEnd($go);
            break;
        case 'doNew':
            $doShowSubscribers = true;
            $message = acajoom::printYN(subscribers::insertOneSubscriber(), _ACA_UPDATED_SUCCESSFULLY, _ACA_ERROR);
            backHTML::_header(_ACA_MENU_SUBSCRIBERS, 'addusers.png', $message, $task, $action);
            break;
        case 'delete':
            if (!is_array($cid) || count($cid) < 1) {
                echo "<script> alert('Select an item to delete'); window.history.go(-1);</script>\n";
                return false;
            } else {
                $status = true;
                foreach ($cid as $id) {
                    $erro->ck = subscribers::deleteOneSubscriber($id);
                    if (!$erro->ck) {
                        $status = false;
                    }
                }
                $message = acajoom::printYN($status, _ACA_SUBSCRIBER_DELETED, _ACA_ERROR);
                backHTML::_header(_ACA_MENU_SUBSCRIBERS, 'addusers.png', $message, $task, $action);
            }
            break;
        case 'update':
            if (!is_array($cid) || count($cid) < 1) {
                echo "<script> alert('Select an item to update'); window.history.go(-1);</script>\n";
                return false;
            } else {
                foreach ($cid as $id) {
                    if (ACA_CMSTYPE) {
                        // joomla 15
                        $changes = JRequest::getVar($id, array(0));
                    } else {
                        //joomla 1x
                        $changes = mosGetParam($_REQUEST, $id, array(0));
                    }
                    //endif
                    if (!isset($changes['receive_html'])) {
                        $changes['receive_html'] = 0;
                    }
                    if (!isset($changes['confirmed'])) {
                        $changes['confirmed'] = 0;
                    }
                }
            }
            $message = acajoom::print_message(_ACA_UPDATED_SUCCESSFULLY, 1);
            break;
        case 'export':
            $doShowSubscribers = false;
            subscribersHTML::export($action, $listId);
            break;
        case 'doExport':
            $message = acajoom::printYN(subscribers::export($listId), _EXPORT, _ACA_ERROR);
            backHTML::_header(_ACA_MENU_SUBSCRIBERS, 'addusers.png', $message, $task, $action);
            break;
        case 'import':
            $doShowSubscribers = false;
            $lists = lists::getLists(0, 0, 1, 'listnameA', false, false, true);
            subscribersHTML::import($action, $lists);
            break;
        case 'doImport':
            $message = acajoom::printYN(subscribers::import($listId), _ACA_IMPORT_FINISHED, _ACA_ERROR);
            backHTML::_header(_ACA_MENU_SUBSCRIBERS, 'addusers.png', $message, $task, $action);
            break;
            break;
        case 'subscribeAll':
            break;
        case 'unsubscribeAll':
            break;
        case 'cancel':
            if ($listId != 0) {
                $listId = 0;
            } else {
                compa::redirect('index2.php?option=com_acajoom');
            }
            backHTML::_header(_ACA_MENU_SUBSCRIBERS, 'addusers.png', $message, $task, $action);
            break;
        case 'cpanel':
            backHTML::controlPanel();
            $doShowSubscribers = 0;
            break;
        default:
            backHTML::_header(_ACA_MENU_SUBSCRIBERS, 'addusers.png', $message, $task, $action);
            break;
    }
    if ($doShowSubscribers) {
        if (ACA_CMSTYPE) {
            // joomla 15
            $start = intval(JRequest::getVar('start', 0));
            $conf =& JFactory::getConfig();
            $mail->Mailer = $conf->getValue('config.mailer');
            // $GLOBALS['mosConfig_mailer'];
            $limit = intval(JRequest::getVar('limit', $conf->getValue('config.list_limit')));
            $emailsearch = JRequest::getVar('emailsearch', '');
        } else {
            //joomla 1x
            $mail->Mailer = $GLOBALS['mosConfig_mailer'];
            $start = intval(mosGetParam($_REQUEST, 'start', 0));
            $limit = intval(mosGetParam($_REQUEST, 'limit', $GLOBALS['mosConfig_list_limit']));
            $emailsearch = mosGetParam($_REQUEST, 'emailsearch', '');
        }
        //endif
        $total = 0;
        $subscribers = subscribers::getSubscribers($start, $limit, $emailsearch, $total, $listId, '', '', '', 'sub_dateD');
        if ($listId != 0) {
            $showAdmin = true;
        } else {
            $showAdmin = false;
        }
        $dropDownList = lisType::getListsDropList(0, '', '');
        if (ACA_CMSTYPE) {
            // joomla 15
            $lists['listid'] = JHTML::_('select.genericlist', $dropDownList, 'listid', 'class="inputbox" size="1" onchange="document.AcajoomFilterForm.submit();"', 'id', 'list_name', $listId);
        } else {
            //joomla 1x
            $lists['listid'] = mosHTML::selectList($dropDownList, 'listid', 'class="inputbox" size="1" onchange="document.AcajoomFilterForm.submit();"', 'id', 'list_name', $listId);
        }
        //endif
        $forms['main'] = " <form action='index2.php' method='post' name='adminForm'> \n";
        $forms['select'] = " <form action='index2.php' method='post' name='AcajoomFilterForm'> \n";
        backHTML::formStart('show_mailing', 0, '');
        subscribersHTML::showSubscribers($subscribers, $action, $listId, $lists, $start, $limit, $total, $showAdmin, $listId, $emailsearch, $forms);
    }
    return true;
}
Example #3
0
/**
* @copyright Copyright (C) 2009 Joobi Limited All rights reserved.
* @license This file is released under the GPL license (http://www.gnu.org/licenses )
* @link http://www.ijoobi.com
*/
function com_install()
{
    @ini_set('max_execution_time', 0);
    @ini_set('memory_limit', '128M');
    if (defined('JPATH_ROOT') and class_exists('JFactory')) {
        // joomla 15
        define('ACA_JPATH_ROOT', JPATH_ROOT);
    } else {
        define('ACA_JPATH_ROOT', $GLOBALS['mosConfig_absolute_path']);
    }
    //endif
    require_once ACA_JPATH_ROOT . '/components/com_acajoom/defines.php';
    require_once WPATH_ADMIN . 'config.acajoom.php';
    require_once WPATH_ADMIN . 'admin.acajoom.html.php';
    require_once WPATH_CLASS . 'class.acajoom.php';
    $update = new wupdate();
    $xf = new xonfig();
    $return = '';
    if (ACA_CMSTYPE) {
        $database =& JFactory::getDBO();
    } else {
        global $database;
    }
    //endif
    if (!is_writable(ACA_JPATH_ROOT_NO_ADMIN . $acajoomConfigFile['upload_url'])) {
        @chmod(ACA_JPATH_ROOT_NO_ADMIN . $acajoomConfigFile['upload_url'], 0777);
    }
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../administrator/components/com_acajoom/images/acajoom_icon.png'\n\t  WHERE admin_menu_link='option=com_acajoom'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/edit.png',\n\t  name='" . _ACA_MENU_LIST . "',\n\t  admin_menu_alt='" . _ACA_MENU_LIST . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=list'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/users_add.png' ,\n\t  name='" . _ACA_MENU_SUBSCRIBERS . "',\n\t  admin_menu_alt='" . _ACA_MENU_SUBSCRIBERS . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=subscribers'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/messaging_inbox.png' ,\n\t  name='" . _ACA_MENU_NEWSLETTERS . "',\n\t  admin_menu_alt='" . _ACA_MENU_NEWSLETTERS . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=mailing&listype=1'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/messaging_config.png' ,\n\t  name='" . _ACA_MENU_AUTOS . "',\n\t  admin_menu_alt='" . _ACA_MENU_AUTOS . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=mailing&listype=2'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/query.png' ,\n\t   name='" . _ACA_MENU_STATS . "',\n\t   admin_menu_alt='" . _ACA_MENU_STATS . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=statistics'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/menus.png' ,\n\t   name='" . _ACA_MENU_CONF . "',\n\t   admin_menu_alt='" . _ACA_MENU_CONF . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=configuration'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/restore.png' ,\n\t  name='" . _ACA_MENU_UPDATE . "',\n\t  admin_menu_alt='" . _ACA_MENU_UPDATE . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=update'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/credits.png' ,\n\t  name='" . _ACA_MENU_ABOUT . "',\n\t  admin_menu_alt='" . _ACA_MENU_ABOUT . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=about'";
    $q = " SELECT `text` FROM `#__acajoom_xonfig` WHERE `akey` = 'version' ";
    $database->setQuery($q);
    $vers = $database->loadResult();
    $err = $database->getErrorMsg();
    if (!empty($err)) {
        $q = " SELECT `text` FROM `#__acajoom_xonfig` WHERE `key` = 'version' ";
        $database->setQuery($q);
        $vers = $database->loadResult();
        if (!empty($vers) and $update->checkVersion($vers, '1.0.6')) {
            ### UPDATE database if before 1.0.7
            $query[] = "ALTER TABLE `#__acajoom_mailings` CHANGE `images` `images` TEXT NOT NULL ";
            $query[] = "ALTER TABLE `#__acajoom_lists` ADD `footer` TINYINT( 1 ) NOT NULL DEFAULT '1' ";
            $query[] = "ALTER TABLE `#__acajoom_lists` ADD `notify_id` INT( 10 ) NOT NULL DEFAULT '0' ";
            $query[] = "ALTER TABLE `#__acajoom_xonfig` DROP INDEX `key` ";
            $query[] = "ALTER TABLE `#__acajoom_xonfig` CHANGE `key` `akey` VARCHAR( 32 ) NOT NULL ";
            $query[] = "ALTER TABLE `#__acajoom_xonfig` CHANGE `value` `value` INT( 11 ) NOT NULL ";
            $query[] = "ALTER TABLE `#__acajoom_stats_global` DROP `listid`  ";
            $query[] = "ALTER TABLE `#__acajoom_stats_global` DROP INDEX `listid` ";
            $query[] = "ALTER TABLE `#__acajoom_stats_global` ADD PRIMARY KEY ( `mailing_id` ) ";
            $query[] = "ALTER TABLE `#__acajoom_stats_details` DROP `listid` ";
            $query[] = "ALTER TABLE `#__acajoom_stats_details` DROP INDEX `listid` ";
            $query[] = "ALTER TABLE `#__acajoom_stats_details` ADD PRIMARY KEY ( `mailing_id` , `subscriber_id` ) ";
            ### 1.0.9
            $query[] = " ALTER TABLE `#__acajoom_mailings` CHANGE `fromname` `fromname` VARCHAR( 64 ) NOT NULL  ";
            $query[] = " ALTER TABLE `#__acajoom_lists` CHANGE `sendername` `sendername` VARCHAR( 64 ) NOT NULL  ";
        }
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.0.8')) {
        $query[] = " ALTER TABLE `#__acajoom_mailings` CHANGE `fromname` `fromname` VARCHAR( 64 ) NOT NULL  ";
        $query[] = " ALTER TABLE `#__acajoom_lists` CHANGE `sendername` `sendername` VARCHAR( 64 ) NOT NULL  ";
        ### upgrade path for new versions
        $xf->insert('wait_for_user', '0', 0);
        $xf->insert('report_site', 'http://www.ijoobi.com', 0);
        $xf->insert('use_sef', '0', 0);
        $xf->insert('send_error', '1', 0);
        $xf->insert('report_error', '1', 0);
        $xf->insert('wait_for_user', '0', 0);
        $xf->insert('show_archive', '1', 0);
        $xf->insert('update_notification', '1', 0);
        $xf->update('send_log_address', '@ijoobi.com');
        $xf->update('update_url', 'http://www.ijoobi.com/update/');
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.1.0')) {
        $query[] = "ALTER TABLE `#__acajoom_lists` ADD `notification` INT( 10 ) NOT NULL DEFAULT '0' ";
        $xf->update('listname1', '_ACA_NEWSLETTER');
        $xf->update('listnames1', '_ACA_MENU_NEWSLETTERS');
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.1.4')) {
        $xf->insert('last_sub_update', '', 0);
        $xf->insert('level', '1', 0);
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.3.0')) {
        $xf->insert('show_author', '0', 0);
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.5.5')) {
        $xf->insert('addEmailRedLink', '0', 0);
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.5.5')) {
        $query[] = " ALTER TABLE `#__acajoom_subscribers` ADD INDEX `subscribe_date` ( `subscribe_date` )   ";
        $query[] = " ALTER TABLE `#__acajoom_queue` CHANGE `subscriber_id` `subscriber_id` INT( 11 ) DEFAULT '0' NOT NULL  ";
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.6.4')) {
        $xf->insert('show_jcalpro', '0', 0);
        $xf->insert('redirectconfirm', '', 0);
        $xf->insert('itemidAca', '99', 0);
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '3.2.0')) {
        $xf->insert('fullcheck', '0', 0);
    }
    $query2 = "SHOW COLUMNS FROM `#__acajoom_lists` ";
    $database->setQuery($query2);
    $columns = $database->loadResultArray();
    if (!in_array('cat_id', $columns)) {
        $query[] = "ALTER TABLE `#__acajoom_lists` CHANGE `choose_time` `cat_id` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0'";
    }
    if (!in_array('next_date', $columns)) {
        $query[] = "ALTER TABLE `#__acajoom_lists` ADD `next_date` INT( 11 ) NOT NULL AFTER `notify_id` ";
    }
    if (!in_array('start_date', $columns)) {
        $query[] = "ALTER TABLE `#__acajoom_lists` ADD `start_date` DATE NOT NULL AFTER `next_date`";
    }
    $query[] = 'UPDATE `#__acajoom_lists` SET `acc_level` = 24 WHERE `acc_level` = 0';
    foreach ($acajoomConfigFile as $key => $val) {
        if (!isset($GLOBALS[ACA . $key])) {
            $xf->insert($key, $val, 0);
        }
    }
    if (!empty($vers) and $update->checkVersion($vers, '1.2.2')) {
        $query[] = "UPDATE `#__acajoom_lists` SET `acc_id` = '29' WHERE `acc_id` = '25' ";
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '3.0.0')) {
        $xf->insert('disabletooltip', '0', 0);
        $xf->insert('minisendmail', '0', 0);
    }
    $query[] = "ALTER TABLE `#__acajoom_lists` CHANGE `cat_id` `cat_id` VARCHAR( 250 ) NOT NULL DEFAULT ''";
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '3.2.3')) {
        $xf->insert('embed_images', '0', 0);
        $xf->insert('clean_stats', '90', 0);
        $xf->insert('word_wrap', '0', 0);
        $query[] = "UPDATE `#__acajoom_lists` SET `cat_id`  = CONCAT(`cat_id`,':',`notify_id`), `notify_id`= 0 WHERE `list_type` = 7 AND `notify_id` > 0";
    }
    //Query to quickly synchronise all your subscribers during the install!
    $query[] = "INSERT IGNORE INTO `#__acajoom_subscribers` ( `user_id` , `name` , `email` , `receive_html` , `confirmed` , `blacklist` , `subscribe_date` )" . "SELECT U.id, U.name, U.email, '1', '1', U.block , U.registerDate from `#__users` as U;";
    if (!defined('WADMIN')) {
        define('WADMIN', 'administrator' . DS . 'components' . DS . 'com_acajoom' . DS);
    }
    if (!defined('WFRONT')) {
        define('WFRONT', 'components' . DS . 'com_acajoom' . DS);
    }
    $file[] = 'templates';
    $file[] = 'templates/default';
    $file[] = 'templates/index.html';
    $file[] = 'templates/default/default.html';
    $file[] = 'templates/default/tpl0_abovefooter.jpg';
    $file[] = 'templates/default/tpl0_powered_by.gif';
    $file[] = 'templates/default/tpl0_spacer.gif';
    $file[] = 'templates/default/tpl0_top_header.jpg';
    $file[] = 'templates/default/tpl0_underban.jpg';
    $file[] = 'templates/default/index.html';
    foreach ($file as $key5 => $ins) {
        if (!file_exists(ACA_JPATH_ROOT . DS . WFRONT . $ins) && file_exists(ACA_JPATH_ROOT . DS . WADMIN . $ins)) {
            @rename(ACA_JPATH_ROOT . DS . WADMIN . $ins, ACA_JPATH_ROOT . DS . WFRONT . $ins);
        }
    }
    $size = sizeof($query);
    for ($index = 0; $index < $size; $index++) {
        $database->setQuery($query[$index]);
        $database->query();
    }
    if (empty($vers)) {
        $xf->filetoDatabase($acajoomConfigFile);
    }
    $return .= setupMaiOptions($acajoomConfigFile);
    $return .= installBots();
    $return .= installModule();
    if (acajoom::checkCB()) {
        $return .= installPlugin();
    }
    subscribers::updateSubscribers(true, true);
    require_once WPATH_ADMIN . 'version.php';
    $xf->update('component', $localVersion['component']);
    $xf->update('type', $localVersion['type']);
    $xf->update('version', $localVersion['version']);
    $xf->update('level', $localVersion['level']);
    $message = acajoom::printM('noimage', _ACA_THANKYOU);
    backHTML::_header(_ACA_MENU_INSTALL, 'install.png', $message, '', '');
    if ($acajoomConfigFile['type'] == 'PRO') {
        backHTML::about();
    } elseif ($acajoomConfigFile['type'] == 'Plus') {
        backHTML::installPRO();
    } else {
        backHTML::installPlus();
    }
    $link = 'index2.php?option=com_acajoom&act=start';
    echo '<table style="width: 100%; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="0" cellspacing="0"><tbody><tr>' . '<td style=" width: 140px;">&nbsp;</td><td style="text-align: center; vertical-align: middle; width: 140px;"><div id="cpanel">';
    backHTML::quickiconButton($link, 'inbox.png', _ACA_GET_STARTED, false, 'admin');
    echo '</div><td></td></td></tr></tbody></table>' . '<div style="clear:both;"></div>';
    echo '<br/><br/><br/><br/>';
    echo '<a href="http://www.ijoobi.com/index.php?option=com_content&view=article&id=7871:installation-errors&catid=29:acajoom&Itemid=72" target="_blank">If you have any error during the install process, please refer to our documentation at http://www.ijoobi.com/index.php?option=com_content&view=article&id=7871:installation-errors&catid=29:acajoom&Itemid=72</a>';
    echo '<br/><br/>';
    echo $return;
    return $return;
}
Example #4
0
 function userDeleted($user, $success)
 {
     require_once ACA_JPATH_ROOT_NO_ADMIN . '/administrator/components/com_acajoom/classes/class.acajoom.php';
     $erro = new xerr(__FILE__, __FUNCTION__);
     if (!empty($user->user_id)) {
         $subscriberId = subscribers::getSubscriberIdFromUserId($user->user_id);
         if (!empty($subscriberId)) {
             subscribers::deleteOneSubscriber($subscriberId);
         }
     }
     $erro->ck = subscribers::updateSubscribers();
     $erro->Eck(__LINE__, '7009');
     return true;
 }
Example #5
0
 function userDeleted($user, $success)
 {
     require_once $GLOBALS['mosConfig_absolute_path'] . '/administrator/components/com_acajoom/classes/class.acajoom.php';
     $erro = new xerr(__FILE__, __FUNCTION__);
     $erro->ck = subscribers::updateSubscribers();
     $erro->Eck(__LINE__, '7009');
     return true;
 }
function com_install()
{
    global $database;
    global $_VERSION;
    require_once $GLOBALS['mosConfig_absolute_path'] . '/components/com_acajoom/defines.php';
    require_once WPATH_ADMIN . 'config.acajoom.php';
    require_once WPATH_ADMIN . 'admin.acajoom.html.php';
    require_once WPATH_CLASS . 'class.acajoom.php';
    $update = new wupdate();
    $xf = new xonfig();
    $return = '';
    if (!is_writable($GLOBALS['mosConfig_absolute_path'] . $acajoomConfigFile['upload_url'])) {
        @chmod($GLOBALS['mosConfig_absolute_path'] . $acajoomConfigFile['upload_url'], 0777);
    }
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../administrator/components/com_acajoom/images/acajoom_icon.png'\n\t  WHERE admin_menu_link='option=com_acajoom'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/edit.png',\n\t  name='" . compa::encodeutf(_ACA_MENU_LIST) . "',\n\t  admin_menu_alt='" . _ACA_MENU_LIST . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=list'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/users_add.png' ,\n\t  name='" . compa::encodeutf(_ACA_MENU_SUBSCRIBERS) . "',\n\t  admin_menu_alt='" . _ACA_MENU_SUBSCRIBERS . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=subscribers'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/messaging_inbox.png' ,\n\t  name='" . compa::encodeutf(_ACA_MENU_NEWSLETTERS) . "',\n\t  admin_menu_alt='" . _ACA_MENU_NEWSLETTERS . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=mailing&listype=1'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/messaging_config.png' ,\n\t  name='" . compa::encodeutf(_ACA_MENU_AUTOS) . "',\n\t  admin_menu_alt='" . _ACA_MENU_AUTOS . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=mailing&listype=2'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/query.png' ,\n\t   name='" . compa::encodeutf(_ACA_MENU_STATS) . "',\n\t   admin_menu_alt='" . _ACA_MENU_STATS . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=statistics'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/menus.png' ,\n\t   name='" . compa::encodeutf(_ACA_MENU_CONF) . "',\n\t   admin_menu_alt='" . _ACA_MENU_CONF . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=configuration'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/restore.png' ,\n\t  name='" . compa::encodeutf(_ACA_MENU_UPDATE) . "',\n\t  admin_menu_alt='" . _ACA_MENU_UPDATE . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=update'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/credits.png' ,\n\t  name='" . compa::encodeutf(_ACA_MENU_ABOUT) . "',\n\t  admin_menu_alt='" . _ACA_MENU_ABOUT . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=about'";
    $q = " SELECT `text` FROM `#__acajoom_xonfig` WHERE `akey` = 'version' ";
    $database->setQuery($q);
    $vers = $database->loadResult();
    $err = $database->getErrorMsg();
    if (!empty($err)) {
        $q = " SELECT `text` FROM `#__acajoom_xonfig` WHERE `key` = 'version' ";
        $database->setQuery($q);
        $vers = $database->loadResult();
        if (!empty($vers) and $update->checkVersion($vers, '1.0.6')) {
            ### UPDATE database if before 1.0.7
            $query[] = "ALTER TABLE `#__acajoom_mailings` CHANGE `images` `images` TEXT NOT NULL ";
            $query[] = "ALTER TABLE `#__acajoom_lists` ADD `footer` TINYINT( 1 ) NOT NULL DEFAULT '1' ";
            $query[] = "ALTER TABLE `#__acajoom_lists` ADD `notify_id` INT( 10 ) NOT NULL DEFAULT '0' ";
            $query[] = "ALTER TABLE `#__acajoom_xonfig` DROP INDEX `key` ";
            $query[] = "ALTER TABLE `#__acajoom_xonfig` CHANGE `key` `akey` VARCHAR( 32 ) NOT NULL ";
            $query[] = "ALTER TABLE `#__acajoom_xonfig` CHANGE `value` `value` INT( 11 ) NOT NULL ";
            $query[] = "ALTER TABLE `#__acajoom_stats_global` DROP `listid`  ";
            $query[] = "ALTER TABLE `#__acajoom_stats_global` DROP INDEX `listid` ";
            $query[] = "ALTER TABLE `#__acajoom_stats_global` ADD PRIMARY KEY ( `mailing_id` ) ";
            $query[] = "ALTER TABLE `#__acajoom_stats_details` DROP `listid` ";
            $query[] = "ALTER TABLE `#__acajoom_stats_details` DROP INDEX `listid` ";
            $query[] = "ALTER TABLE `#__acajoom_stats_details` ADD PRIMARY KEY ( `mailing_id` , `subscriber_id` ) ";
            ### 1.0.9
            $query[] = " ALTER TABLE `#__acajoom_mailings` CHANGE `fromname` `fromname` VARCHAR( 64 ) NOT NULL  ";
            $query[] = " ALTER TABLE `#__acajoom_lists` CHANGE `sendername` `sendername` VARCHAR( 64 ) NOT NULL  ";
        }
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.0.8')) {
        $query[] = " ALTER TABLE `#__acajoom_mailings` CHANGE `fromname` `fromname` VARCHAR( 64 ) NOT NULL  ";
        $query[] = " ALTER TABLE `#__acajoom_lists` CHANGE `sendername` `sendername` VARCHAR( 64 ) NOT NULL  ";
        ### upgrade path for new versions
        $xf->insert('wait_for_user', '0', 0);
        $xf->insert('report_site', 'http://www.acajoom.com', 0);
        $xf->insert('use_sef', '0', 0);
        $xf->insert('send_error', '1', 0);
        $xf->insert('report_error', '1', 0);
        $xf->insert('wait_for_user', '0', 0);
        $xf->insert('show_archive', '1', 0);
        $xf->insert('update_notification', '1', 0);
        $xf->update('send_log_address', '@acajoom.com');
        $xf->update('update_url', 'http://www.acajoom.com/update/');
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.1.0')) {
        $query[] = "ALTER TABLE `#__acajoom_lists` ADD `notification` INT( 10 ) NOT NULL DEFAULT '0' ";
        $xf->update('listname1', '_ACA_NEWSLETTER');
        $xf->update('listnames1', '_ACA_MENU_NEWSLETTERS');
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.1.4')) {
        $xf->insert('last_sub_update', '', 0);
        $xf->insert('level', '1', 0);
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.3.0')) {
        $xf->insert('show_author', '0', 0);
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.5.5')) {
        $xf->insert('addEmailRedLink', '0', 0);
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.5.5')) {
        $query[] = " ALTER TABLE `#__acajoom_subscribers` ADD INDEX `subscribe_date` ( `subscribe_date` )   ";
        $query[] = " ALTER TABLE `#__acajoom_queue` CHANGE `subscriber_id` `subscriber_id` INT( 11 ) DEFAULT '0' NOT NULL  ";
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.6.4')) {
        $xf->insert('show_jcalpro', '0', 0);
        $xf->insert('redirectconfirm', '', 0);
        $xf->insert('itemidAca', '99', 0);
    }
    $query2 = "SHOW COLUMNS FROM `#__acajoom_lists` ";
    $database->setQuery($query2);
    $columns = $database->loadResultArray();
    if (!in_array('cat_id', $columns)) {
        $query[] = "ALTER TABLE `#__acajoom_lists` CHANGE `choose_time` `cat_id` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0'";
    }
    if (!in_array('next_date', $columns)) {
        $query[] = "ALTER TABLE `#__acajoom_lists` ADD `next_date` INT( 11 ) NOT NULL AFTER `notify_id` ";
    }
    if (!in_array('start_date', $columns)) {
        $query[] = "ALTER TABLE `#__acajoom_lists` ADD `start_date` DATE NOT NULL AFTER `next_date`";
    }
    $query[] = 'UPDATE `#__acajoom_lists` SET `acc_level` = 24 WHERE `acc_level` = 0';
    foreach ($acajoomConfigFile as $key => $val) {
        if (!isset($GLOBALS[ACA . $key])) {
            $xf->insert($key, $val, 0);
        }
    }
    if (!empty($vers) and $update->checkVersion($vers, '1.2.2')) {
        $query[] = "UPDATE `#__acajoom_lists` SET `acc_id` = '29' WHERE `acc_id` = '25' ";
    }
    if (!defined('WADMIN')) {
        define('WADMIN', 'administrator' . DS . 'components' . DS . 'com_acajoom' . DS);
    }
    if (!defined('WFRONT')) {
        define('WFRONT', 'components' . DS . 'com_acajoom' . DS);
    }
    $file[] = 'templates';
    $file[] = 'templates/default';
    $file[] = 'templates/index.html';
    $file[] = 'templates/default/default.html';
    $file[] = 'templates/default/tpl0_abovefooter.jpg';
    $file[] = 'templates/default/tpl0_powered_by.gif';
    $file[] = 'templates/default/tpl0_spacer.gif';
    $file[] = 'templates/default/tpl0_top_header.jpg';
    $file[] = 'templates/default/tpl0_underban.jpg';
    $file[] = 'templates/default/index.html';
    foreach ($file as $key5 => $ins) {
        if (!file_exists($GLOBALS['mosConfig_absolute_path'] . DS . WFRONT . $ins) && file_exists($GLOBALS['mosConfig_absolute_path'] . DS . WADMIN . $ins)) {
            @rename($GLOBALS['mosConfig_absolute_path'] . DS . WADMIN . $ins, $GLOBALS['mosConfig_absolute_path'] . DS . WFRONT . $ins);
        }
    }
    $size = sizeof($query);
    for ($index = 0; $index < $size; $index++) {
        $database->setQuery($query[$index]);
        $database->query();
    }
    if (empty($vers)) {
        $xf->filetoDatabase($acajoomConfigFile);
    }
    $return .= setupMaiOptions($acajoomConfigFile);
    $return .= installBots();
    $return .= installModule();
    if (acajoom::checkCB()) {
        $return .= installPlugin();
    }
    subscribers::updateSubscribers(true, true);
    require_once WPATH_ADMIN . 'version.php';
    $xf->update('component', $localVersion['component']);
    $xf->update('type', $localVersion['type']);
    $xf->update('version', $localVersion['version']);
    $xf->update('level', $localVersion['level']);
    $message = acajoom::printM('noimage', _ACA_THANKYOU);
    backHTML::_header(_ACA_MENU_INSTALL, 'install.png', $message, '', '');
    if ($acajoomConfigFile['type'] == 'PRO') {
        backHTML::about();
    } elseif ($acajoomConfigFile['type'] == 'Plus') {
        backHTML::installPRO();
    } else {
        backHTML::installPlus();
    }
    $link = 'index2.php?option=com_acajoom&act=start';
    echo '<table style="width: 100%; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="0" cellspacing="0"><tbody><tr>' . '<td style=" width: 140px;">&nbsp;</td><td style="text-align: center; vertical-align: middle; width: 140px;"><div id="cpanel">';
    backHTML::quickiconButton($link, 'inbox.png', _ACA_GET_STARTED, false, 'admin');
    echo '</div><td></td></td></tr></tbody></table>' . '<div style="clear:both;"></div>';
    echo '<br/><br/><br/><br/>';
    echo compa::encodeutf($return);
    return $return;
}