function editSubscriber($subscriber, $listings, $queues, $forms, $access = false, $frontEnd = false, $cb = false)
 {
     global $my, $mainframe;
     mosCommonHTML::loadOverlib();
     $lists['receive_html'] = mosHTML::yesnoRadioList('receive_html', 'class="inputbox"', $subscriber->receive_html);
     $lists['confirmed'] = mosHTML::yesnoRadioList('confirmed', 'class="inputbox"', $subscriber->confirmed);
     $lists['blacklist'] = mosHTML::yesnoRadioList('blacklist', 'class="inputbox"', $subscriber->blacklist);
     $br = "\n\r";
     $html = $forms['main'];
     $html .= '<div style="width:100%; align:left;">' . $br;
     $html .= '<fieldset class="acajoomcss" style="padding: 10px; text-align: left">' . $br;
     $html .= '<legend><strong>' . _ACA_SUB_INFO . '</strong></legend>' . $br;
     $html .= '<table cellpadding="0" cellspacing="0" align="center">' . $br;
     $text = str_replace('"', '&quot;', $subscriber->name);
     if (function_exists('htmlspecialchars_decode')) {
         $text = htmlspecialchars_decode($text, ENT_NOQUOTES);
     } elseif (function_exists('html_entity_decode')) {
         $text = html_entity_decode($text, ENT_NOQUOTES);
     }
     if (!$cb) {
         $html .= acajoom::miseEnHTML(_ACA_INPUT_NAME, _ACA_INPUT_NAME_TIPS, '<input type="text" name="name" size="30" value="' . $text . '" class="inputbox" />');
         $html .= acajoom::miseEnHTML(_ACA_INPUT_EMAIL, _ACA_INPUT_EMAIL_TIPS, '<input type="text" name="email" size="30" class="inputbox" value="' . $subscriber->email . ' "  />');
     } else {
         $html .= '<input type="hidden" name="cb_integration" value="1"  />';
     }
     $html .= acajoom::miseEnHTML(_ACA_RECEIVE_HTML, _ACA_RECEIVE_HTML_TIPS, $lists['receive_html']);
     if ($GLOBALS[ACA . 'time_zone'] == 1) {
         $html .= acajoom::miseEnHTML(_ACA_TIME_ZONE_ASK, _ACA_TIME_ZONE_ASK_TIPS, ' <input type="text" name="timezone" size="30" class="inputbox" value="' . $subscriber->timezone . '"  />');
     } else {
         $html .= '<input type="hidden" name="timezone" value="' . $subscriber->timezone . '"  />';
     }
     if ($access) {
         if ($subscriber->user_id == 0) {
             $html .= acajoom::miseEnHTML(_ACA_CONFIRMED, '', $lists['confirmed']);
         } else {
             if (!$cb or !$mainframe->isAdmin()) {
                 $html .= '<input type="hidden" name="confirmed" value="' . $subscriber->confirmed . '" />';
             }
         }
         $html .= acajoom::miseEnHTML(_ACA_BLACK_LIST, '', $lists['blacklist']);
         $html .= acajoom::miseEnHTML(_ACA_REGISTRATION_DATE, '', $subscriber->subscribe_date);
         $html .= acajoom::miseEnHTML(_ACA_USER_ID, '', $subscriber->user_id);
     } else {
         $html .= '<input type="hidden" name="confirmed" value="' . $subscriber->confirmed . '" />';
         $html .= '<input type="hidden" name="blacklist" value="' . $subscriber->blacklist . '" />';
     }
     $html .= '</table>';
     $html .= '</fieldset></div>';
     $html .= subscribersHTML::showSubscriberLists($subscriber, $listings, $queues, $frontEnd, $access);
     return $html;
 }
예제 #2
0
 function getDisplayRegistration($tab, $user, $ui)
 {
     if (ACA_CMSTYPE) {
         // joomla 15
         $my =& JFactory::getUser();
     } else {
         //joomla 1x
         global $my;
     }
     //endif
     require_once ACA_JPATH_ROOT_NO_ADMIN . '/administrator/components/com_acajoom/classes/class.acajoom.php';
     $html = '';
     if ($GLOBALS['aca_cb_plugin'] == '1') {
         $lists = lists::getSpecifiedLists($GLOBALS['aca_cb_listIds'], false);
         if (!empty($lists)) {
             $i = 0;
             $accessLevel = 18;
             //default access level jack 31
             $htmlOK = false;
             if (!empty($GLOBALS['aca_cb_intro'])) {
                 $html .= '<tr><td class="titleCell" colspan="2">' . $GLOBALS['aca_cb_intro'] . '</td></tr>';
             }
             if ($GLOBALS['aca_cb_showname']) {
                 foreach ($lists as $list) {
                     $i++;
                     $subscribed = 0;
                     if ($list->html == 1) {
                         $htmlOK = true;
                     }
                     $checked = $GLOBALS['aca_cb_checkLists'];
                     if ($list->hidden == 1) {
                         $subscriber->blacklist = 0;
                         if ($checked != 0) {
                             $checkedPrint = ' checked="checked" ';
                         } else {
                             $checkedPrint = '';
                         }
                         $html .= '<tr>';
                         if ($GLOBALS['aca_cb_checkLists'] == 1) {
                             $text = "\n" . '<td class="titleCell" style="text-align: right;"><input type="checkbox" class="inputbox" value="1" name="subscribed[' . $i . ']" checked="checked" /></td>';
                         } else {
                             $text = "\n" . '<td class="titleCell" style="text-align: right;"><input type="checkbox" class="inputbox" value="1" name="subscribed[' . $i . ']" ' . $checkedPrint . ' /></td>';
                         }
                         $text .= "\n" . '<input type="hidden" name="sub_list_id[' . $i . ']" value="' . $list->id . '" />';
                         $text .= "\n" . '<td class="fieldCell"><span class="aca_list_name" onclick=\'return false;\'>' . compa::toolTip($list->list_desc, $list->list_name, '', '', $list->list_name, '#', 1) . '</span></td>';
                         $html .= $text;
                         $html .= '</tr>';
                     } else {
                         $html .= '<input type="hidden"  value=1 name="subscribed[' . $i . ']" />';
                         $html .= "\n" . '<input type="hidden" name="sub_list_id[' . $i . ']" value="' . $list->id . '" />';
                     }
                     $html .= "\n" . '<input type="hidden" name="acc_level[' . $i . ']" value="' . $accessLevel . '" />';
                 }
             } else {
                 foreach ($lists as $list) {
                     $i++;
                     $html .= '<input type="hidden"  value="1" name="subscribed[' . $i . ']" />';
                     $html .= "\n" . '<input type="hidden" name="sub_list_id[' . $i . ']" value="' . $list->id . '" />';
                     $html .= "\n" . '<input type="hidden" name="acc_level[' . $i . ']" value="' . $accessLevel . '" />';
                     if ($list->html == 1) {
                         $htmlOK = true;
                     }
                 }
             }
             $checked = $GLOBALS['aca_cb_defaultHTML'];
             if ($htmlOK) {
                 if ($GLOBALS['aca_cb_showHTML']) {
                     $html .= '<tr>';
                     if ($checked != 0) {
                         $checkedPrint = ' checked="checked" ';
                     } else {
                         $checkedPrint = '';
                     }
                     $text = '<td class="titleCell" style="text-align: right;"><input type="checkbox" class="inputbox" value="1" name="receive_html" ' . $checkedPrint . ' /></td>';
                     $text .= '<td class="fieldCell">' . _ACA_RECEIVE_HTML . '</td>';
                     $html .= acajoom::printLine(false, $text);
                     $html .= '</tr>';
                 } else {
                     $html .= '<input type="hidden" value="' . $checked . '" name="receive_html" />' . "\n";
                 }
             } else {
                 $html .= '<input type="hidden" value="' . $checked . '" name="receive_html" />' . "\n";
             }
         } else {
             $html = '<input type="hidden" value="' . $GLOBALS['aca_cb_defaultHTML'] . '" name="receive_html" />' . "\n";
         }
     } else {
         $html = '<input type="hidden" value="' . $GLOBALS['aca_cb_defaultHTML'] . '" name="receive_html" />' . "\n";
     }
     return $html;
 }
예제 #3
0
 function M($type, $message)
 {
     if (class_exists('acajoom')) {
         return acajoom::printM($type, $message);
     } else {
         switch ($type) {
             case 'no':
                 $colored_message = '<img  hspace="15" align="absmiddle" alt="no" src="' . $GLOBALS['mosConfig_live_site'] . '/administrator/components/com_acajoom/images/button_cancel.gif"><span style=" font-size: larger; color: rgb(255, 0, 0); font-weight: bold;">' . $message . '</span>';
                 break;
             case 'green':
                 $colored_message = '<span style="font-weight: bold; color:#07C500;">' . $message . '</span>';
                 break;
             case 'red':
                 $colored_message = '<span style="font-weight: bold; color:#FF0000;">' . $message . '</span>';
                 break;
             default:
                 $colored_message = '';
                 break;
         }
         return $colored_message . "\n\r";
     }
 }
예제 #4
0
 function sendReport($from_email, $time, $html_sent, $text_sent)
 {
     global $version, $database;
     $safemode = ini_get("safe_mode") == 0 ? 'off' : 'on';
     $numberSubscribers = $text_sent + $html_sent;
     $time = class_exists('acajoom') ? acajoom::getNow() : date('Y-m-d H:i:s', time());
     $content = 'Acajoom send mailing report of ' . $time . "\n\n";
     $content .= "-----------------------------------\n";
     $content .= "Server: \n";
     $content .= "-----------------------------------\n\n";
     //$content .= "Joomla Version: " . $version . "\n";
     $content .= "Software: " . $_SERVER['SERVER_SOFTWARE'] . "\n";
     $content .= "Database Version: " . $database->getVersion() . "\n";
     $content .= "PHP Version: " . phpversion() . "\n";
     $content .= "Zend Version: " . zend_version() . "\n";
     $content .= "Magic_quotes_gpc: " . ini_get("magic_quotes_gpc") . "\n";
     $content .= "Disable_functions: " . ini_get("disable_functions") . "\n";
     $content .= "Max_execution_time: " . ini_get("max_execution_time") . "\n";
     $content .= "Safe_mode: " . $safemode . "\n";
     $content .= "Memory_limit: " . ini_get("memory_limit") . "\n";
     $content .= "\n\n";
     $content .= "-----------------------------------\n";
     $content .= "Acajoom configuration: \n";
     $content .= "-----------------------------------\n\n";
     $content .= "Send method: " . $GLOBALS[ACA . 'emailmethod'] . "\n";
     if ($GLOBALS[ACA . 'emailmethod'] == 'smtp') {
         $auth = $GLOBALS[ACA . 'smtp_auth_required'] == 1 ? 'yes' : 'no';
         $content .= "Authentication required: " . $auth . "\n";
     }
     $content .= $time . "  \n";
     $content .= "\n\n";
     $content .= "-----------------------------------\n";
     $content .= "Mailing options: \n";
     $content .= "-----------------------------------\n\n";
     $content .= "Time to send: " . $time . "\n";
     $content .= "Number of subscribers: " . $numberSubscribers . "\n";
     $content .= "HTML format: " . $html_sent . "\n";
     $content .= "Text format: " . $text_sent . "\n";
     echo '<img src="' . $GLOBALS[ACA . 'report_site'] . '/index.php?option=' . $GLOBALS[ACA . 'option'] . '&act=perflog' . '&timesend=' . $time . '&text=' . $text_sent . '&html=' . $html_sent . '&lists=' . $GLOBALS[ACA . 'totallist0'] . '&mailings=' . $GLOBALS[ACA . 'totalmailing0'] . '&subs=' . $GLOBALS[ACA . 'totalsubcribers0'] . '&msent=' . $GLOBALS[ACA . 'totalmailingsent0'] . '&maxexe=' . ini_get("max_execution_time") . '&memory=' . ini_get("memory_limit") . '&method=' . $GLOBALS[ACA . 'emailmethod'] . '&version=' . $GLOBALS[ACA . 'version'] . '&php=' . phpversion() . '&zend=' . zend_version() . '&soft=' . $_SERVER['SERVER_SOFTWARE'] . '&magic=' . ini_get("magic_quotes_gpc") . '&mode=' . $safemode . '&disable=' . ini_get("disable_functions") . '" border="0" width="1" height="1" />';
 }
예제 #5
0
function lists($action, $task, $listId, $listType)
{
    global $database, $my;
    $message = '';
    $xf = new xonfig();
    $erro = new xerr(__FILE__, __FUNCTION__);
    $erro->show();
    $showLists = true;
    switch ($task) {
        case 'new':
            if ($listType < 1) {
                $listType = 1;
            }
            $filename = $GLOBALS['mosConfig_absolute_path'] . '/components/com_acajoom/templates/default/default.html';
            $handle = fopen($filename, "rb");
            $template = fread($handle, filesize($filename));
            fclose($handle);
            $template = str_replace('src="', 'src="' . $GLOBALS['mosConfig_live_site'] . '/', $template);
            $subscriber = subscribers::getSubscriberInfoFromUserId($my->id);
            $showLists = false;
            $newList->id = '';
            $newList->html = 1;
            $newList->new_letter = 1;
            $newList->list_name = '';
            $newList->list_desc = '';
            $newList->sendername = $subscriber->name;
            $newList->senderemail = $subscriber->email;
            $newList->bounceadres = $subscriber->email;
            $newList->layout = $template;
            $newList->template = 0;
            $newList->hidden = 1;
            $newList->auto_add = 0;
            $newList->list_type = $listType;
            $newList->delay_min = 1;
            $newList->delay_max = 7;
            $newList->user_choose = 0;
            $newList->cat_id = 0;
            $newList->follow_up = '';
            $newList->notify_id = 0;
            $newList->owner = $my->id;
            $newList->acc_level = 25;
            $newList->acc_id = 29;
            $newList->published = 0;
            $newList->start_date = date('Y-m-d', time());
            $newList->next_date = time();
            $newList->subscribemessage = _ACA_DEFAULT_SUBSCRIBE_MESS;
            $newList->unsubscribemessage = _ACA_DEFAULT_UNSUBSCRIBE_MESS;
            $newList->unsubscribesend = 1;
            $newList->footer = 1;
            $forms['main'] = " <form action='index2.php' method='post' name='adminForm'> \n ";
            $show = lisType::showType($newList->list_type, 'editlist');
            backHTML::_header(_ACA_NEW . ' ' . _ACA_LIST, $GLOBALS[ACA . 'listlogo0'], $message, $task, $action);
            backHTML::formStart('listedit', $newList->html, '');
            listsHTML::editList($newList, $forms, $show);
            $go[] = acajoom::makeObj('act', $action);
            $go[] = acajoom::makeObj('listid', $newList->id);
            backHTML::formEnd($go);
            break;
        case 'doNew':
            $listname = mosGetParam($_REQUEST, 'list_name', '');
            $listType = mosGetParam($_REQUEST, 'list_type', 0);
            $now = acajoom::getNow();
            $query = "SELECT `id` FROM `#__acajoom_lists` WHERE `list_name`= '{$listname}' ";
            $database->setQuery($query);
            $lId = $database->loadResult();
            $erro->err = $database->getErrorMsg();
            $erro->E(__LINE__, '1091', $database);
            if ($lId > 0) {
                echo "<script> alert(' This list already exist, please choose another name. '); window.history.go(-1);</script>\n";
                return false;
            } else {
                $query = "INSERT INTO `#__acajoom_lists` (`list_name`,`createdate`) VALUES ( '" . addslashes($listname) . "'  , '{$now}' )";
                $database->setQuery($query);
                $database->query();
                $erro->err = $database->getErrorMsg();
            }
            if ($erro->E(__LINE__, '1001', $database)) {
                $query = "SELECT * FROM `#__acajoom_lists` WHERE `list_name`= '{$listname}' ";
                $database->setQuery($query);
                $database->loadObject($mynewlist);
                $mynewlist->list_name = stripslashes($mynewlist->list_name);
                $mynewlist->list_desc = stripslashes($mynewlist->list_desc);
                $mynewlist->layout = stripslashes($mynewlist->layout);
                $mynewlist->subscribemessage = stripslashes($mynewlist->subscribemessage);
                $mynewlist->unsubscribemessage = stripslashes($mynewlist->unsubscribemessage);
                $erro->err = $database->getErrorMsg();
                $erro->E(__LINE__, '1005');
                $listId = $mynewlist->id;
                $message = acajoom::printYN(lists::updateListFromEdit($listId, '', true), _ACA_LIST_ADDED, _ACA_ERROR);
                $xf->plus('totallist0', 1);
                $xf->plus('act_totallist0', 1);
                $xf->plus('totallist' . $listType, 1);
                $xf->plus('act_totallist' . $listType, 1);
            }
            break;
        case 'edit':
            if ($listId == 0) {
                echo "<script> alert('" . addslashes(_ACA_SELECT_LIST) . "'); window.history.go(-1);</script>\n";
                return false;
            } else {
                $showLists = false;
                $query = 'SELECT * FROM `#__acajoom_lists` WHERE `id` = ' . intval($listId);
                $database->setQuery($query);
                $database->loadObject($listEdit);
                $erro->err = $database->getErrorMsg();
                if (!$erro->E(__LINE__, '1002')) {
                    return false;
                } else {
                    $listEdit->list_name = stripslashes($listEdit->list_name);
                    $listEdit->list_desc = stripslashes($listEdit->list_desc);
                    $listEdit->layout = stripslashes($listEdit->layout);
                    $listEdit->subscribemessage = stripslashes($listEdit->subscribemessage);
                    $listEdit->unsubscribemessage = stripslashes($listEdit->unsubscribemessage);
                    $listEdit->new_letter = 0;
                    $forms['main'] = " <form action='index2.php' method='post' name='adminForm'> \n ";
                    $show = lisType::showType($listEdit->list_type, 'editlist');
                    backHTML::_header(_ACA_EDIT_A . @constant($GLOBALS[ACA . 'listname' . $listEdit->list_type]) . ' ' . _ACA_LIST, $GLOBALS[ACA . 'listlogo0'], $message, $task, $action);
                    backHTML::formStart('listedit', $listEdit->html, '');
                    listsHTML::editList($listEdit, $forms, $show);
                    $go[] = acajoom::makeObj('act', $action);
                    $go[] = acajoom::makeObj('listid', $listEdit->id);
                    backHTML::formEnd($go);
                }
            }
            break;
        case 'update':
            $message = acajoom::printYN(lists::updateListFromEdit($listId, '', false), _ACA_LIST_UPDATED, _ACA_ERROR);
            break;
        case 'delete':
            $message = acajoom::printYN(lists::deleteList($listId), _ACA_LIST . _ACA_SUCCESS_DELETED, _ACA_ERROR);
            break;
        case 'copy':
            $message = acajoom::printYN(lists::copyList($listId), _ACA_LIST_COPY, _ACA_ERROR);
            break;
        case 'publish':
            $message = acajoom::printYN(lists::updateListFromList($listId, true, false), _ACA_PUBLISHED, _ACA_ERROR);
            break;
        case 'unpublish':
            $message = acajoom::printYN(lists::updateListFromList($listId, false, false), _ACA_UNPUBLISHED, _ACA_ERROR);
            break;
        case 'forms':
        case 'make':
            if (class_exists('createForm')) {
                createForm::taskOptions($task);
                $showLists = false;
            } else {
                $showLists = true;
            }
            break;
        case 'cpanel':
            backHTML::controlPanel();
            return true;
            break;
    }
    if ($showLists) {
        backHTML::_header(_ACA_MENU_LIST, $GLOBALS[ACA . 'listlogo0'], $message, $task, $action);
        $show = lisType::showType(0, 'showListsBack');
        $forms['main'] = " <form action='index2.php' method='post' name='adminForm'> \n";
        backHTML::formStart('show_mailing', '', '');
        $listing = lists::getLists(0, 0, 1, '', false, false, false);
        if ($show['list_type']) {
            $show['list_type'] = lisType::checkOthers();
        }
        listsHTML::showListingLists($listing, $action, 'edit', $forms, $show);
        $go[] = acajoom::makeObj('act', $action);
        backHTML::formEnd($go);
        return true;
    }
}
예제 #6
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;
}
예제 #7
0
 function sendSchedule($d, $showHTML, $receivers, $list, &$message, &$max, $tags = null)
 {
     static $countEmails = 0;
     $mailing = $d['mailing'];
     $h = '';
     $xf = new xonfig();
     if (empty($mailing)) {
         $message = _ACA_NO_MAILING_ENTERED;
         return false;
     } elseif (empty($receivers)) {
         $message = _ACA_NO_ADDRESS_ENTERED;
         return false;
     } elseif (empty($list)) {
         $message = _ACA_NO_LIST_ENTERED;
         return false;
     } else {
         $message = '';
     }
     $mailingId = $mailing->id;
     $issue_nb = $mailing->issue_nb;
     $subject = $mailing->subject;
     $content = $mailing->htmlcontent;
     $textonly = $mailing->textonly;
     $fromname = $mailing->fromname;
     $fromemail = $mailing->fromemail;
     $images = $mailing->images;
     $listId = $list->id;
     $html = $list->html;
     $layout = $list->layout;
     $totalsofar = number_format(0, 4, ',', '');
     $nbPause = 0;
     $tags['issuenb'] = $issue_nb;
     //Just in case of...
     @ini_set('max_execution_time', 0);
     @ini_set('memory_limit', '128M');
     ignore_user_abort(true);
     ### create the mail
     $mail = acajoom_mail::getMailer($mailing);
     ### create content
     acajoom_mail::getContent($images, $layout, $content, $textonly, true);
     $mtime = microtime();
     $mtime = explode(" ", $mtime);
     $mtime = $mtime[1] + $mtime[0];
     $starttime = $mtime;
     $html_sent = 0;
     $text_sent = 0;
     $size = sizeof($receivers);
     $format = defined('_DATE_FORMAT_LC') ? _DATE_FORMAT_LC : JText::_('DATE_FORMAT_LC');
     $log_detailed = "\r\n" . "\r\n" . '*** ' . strftime($format) . ' ***' . "\r\n";
     //variables used in integration of jLinks
     $mailCatID = null;
     $convertedLinks = null;
     foreach ($receivers as $receiver) {
         $tags['user_id'] = $receiver->user_id;
         if ($html && intval($receiver->receive_html) == 1) {
             $mail->IsHTML(true);
             $ashtml = 1;
             $Altbody = acajoom_mail::replaceTags($textonly, $receiver, $list, $mailingId, 0, $tags);
             $mail->AltBody = acajoom_mail::safe_utf8_encode($Altbody, $mail->CharSet);
             $html_sent++;
             $mail->Body = acajoom_mail::replaceTags($content, $receiver, $list, $mailingId, $ashtml, $tags);
             acajoom_mail::replaceClass($mail->Body, $mail->AltBody, $receiver);
         } else {
             $mail->IsHTML(false);
             $mail->AltBody = '';
             $ashtml = 0;
             $text_sent++;
             $mail->Body = acajoom_mail::replaceTags($textonly, $receiver, $list, $mailingId, $ashtml, $tags);
             $simpleText = '';
             acajoom_mail::replaceClass($mail->Body, $simpleText, $receiver);
         }
         $tname = explode(" ", $receiver->name);
         $firstname = $tname[0];
         $toUser = $GLOBALS[ACA . 'minisendmail'] ? '' : $receiver->name;
         $mail->AddAddress($receiver->email, $toUser);
         if (!empty($receiver->id)) {
             $mail->addCustomHeader("X-SubscriberID: {$receiver->id}");
         }
         $username = empty($receiver->username) ? $firstname : $receiver->username;
         $date = ACA_CMSTYPE ? JHTML::_('date', acajoom::getNow(), JText::_('DATE_FORMAT_LC1'), 0) : mosFormatDate(acajoom::getNow(), '', 0);
         $replaceWhat = array('[NAME]', '[FIRSTNAME]', '[USERNAME]', '[DATE]');
         $replaceBy = array($receiver->name, $firstname, $username, $date);
         $sujetReplaced = str_replace($replaceWhat, $replaceBy, $subject);
         if (class_exists('auto')) {
             auto::tags($sujetReplaced, $tags);
         }
         $mail->Subject = $sujetReplaced;
         if ($GLOBALS[ACA . 'embed_images']) {
             acajoom_mail::embedImages($mail);
         }
         $mailssend = $mail->Send();
         $countEmails++;
         if ($countEmails >= $GLOBALS[ACA . 'cron_max_emails']) {
             $max = true;
         }
         if (!$mailssend || $mail->error_count > 0) {
             static $info = false;
             if (!$info and acajoom::checkPermissions('admin')) {
                 echo '<br/>Mailer Error : ' . $mail->ErrorInfo;
                 echo " : Newsletter '{$sujetReplaced}' to {$receiver->email}";
                 $info = true;
             }
             $log_detailed .= '[' . $mailingId . '] ' . $subject . ' : ' . $receiver->email . ' -> ' . _ACA_MESSAGE_NOT . "\r\n" . _ACA_MAILER_ERROR . ': ' . $mail->ErrorInfo . "\r\n";
             if ($html && intval($receiver->receive_html) == 1) {
                 $html_sent--;
             } else {
                 $text_sent--;
             }
             if (!subscribers::validEmail($receiver->email, true)) {
                 $deleteQueue = array();
                 $deleteQueue[0] = queue::whatQID($mailingId, $receiver->id, $d['listype']);
                 queue::deleteQueues($deleteQueue);
             }
         } else {
             $log_detailed .= '[' . $mailingId . '] ' . $subject . ' : ' . $receiver->email . ' -> ' . _ACA_MESSAGE_SENT_SUCCESSFULLY . "\r\n";
             if ($GLOBALS[ACA . 'enable_statistics'] == 1 and $GLOBALS[ACA . 'statistics_per_subscriber'] == 1) {
                 xmailing::insertStats($mailingId, $receiver->id, $ashtml);
             }
             $d['qids'] = array();
             $erro = new xerr(__FILE__, __FUNCTION__, __CLASS__);
             if ($d['listype'] == '2') {
                 $d['qids'][0] = queue::whatQID($mailingId, $receiver->id, $d['listype']);
                 $erro->ck = auto::updateAutoresponderSent($d);
                 $erro->Eck(__LINE__, '8137', $d);
             } elseif ($d['listype'] == '1' || $d['listype'] == '7') {
                 $d['qids'][0] = queue::whatQID($mailingId, $receiver->id, $d['listype']);
                 $erro->ck = queue::deleteQueues($d['qids']);
                 $erro->Eck(__LINE__, '8127', $d);
             }
         }
         $mail->ClearAddresses();
     }
     if ($GLOBALS[ACA . 'enable_statistics'] == 1) {
         xmailing::updateStatsGlobal($mailingId, $html_sent, $text_sent, false);
     }
     $mtime = microtime();
     $mtime = explode(" ", $mtime);
     $mtime = $mtime[1] + $mtime[0];
     $endtime = $mtime;
     if ($totalsofar > 0) {
         $totaltime = $totalsofar;
         $totalstr = strval($totaltime);
     } else {
         $totaltime = number_format($endtime - $starttime - $nbPause * $GLOBALS[ACA . 'pause_time'], 4, ',', '');
         $totalstr = strval($totaltime);
     }
     $xf->plus('totalmailingsent' . $list->list_type, $html_sent + $text_sent);
     $xf->plus('totalmailingsent0', $html_sent + $text_sent);
     $log_simple = 'Time to send: ' . $totalstr . ' ' . _ACA_SECONDS . "\r\n" . 'Number of subscribers: ' . ($text_sent + $html_sent) . "\r\n" . 'HTML format: ' . $html_sent . "\r\n" . 'Text format: ' . $text_sent . "\r\n";
     $log_detailed = $log_simple . 'Details: ' . "\r\n" . $log_detailed . "\r\n";
     if (class_exists('lisType')) {
         acajoom_mail::writeLogs($list, $log_simple, $log_detailed);
     }
     if ($d['listype'] == '2') {
         echo '<br/>' . _ACA_QUEUE_AUTO_PROCESSED;
     } elseif ($d['listype'] == '1') {
         echo '<br/>' . _ACA_QUEUE_NEWS_PROCESSED;
     }
     if ($html_sent + $text_sent > 0) {
         return true;
     } else {
         $message = xmailing::M('no', _ACA_NO_MAILING_SENT);
         return false;
     }
 }
예제 #8
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 mailing($action, $task, $listId, $listType, $mailingId, $message)
{
    $showMailings = false;
    switch ($task) {
        case 'edit':
            if (ACA_CMSTYPE) {
                // joomla 15
                $issue_nb = intval(JRequest::getVar('issue_nb', 1));
            } else {
                //joomla 1x
                $issue_nb = intval(mosGetParam($_REQUEST, 'issue_nb', 1));
            }
            //endif
            $list = lists::getOneList($listId);
            $mailing = xmailing::getOneMailing($list, $mailingId, $issue_nb, $new);
            $show = lisType::showType($mailing->list_type, 'editmailing');
            if ($mailing->published != 1 or $mailing->list_type != 1 or isset($show['admin']) and $show['admin']) {
                $forms['main'] = " <form action='index2.php' method='post' enctype='multipart/form-data' name='adminForm'> \n ";
                xmailing::_header($task, $action, $mailing->list_type, $message, 'edit');
                mailingsHTML::editMailing($mailing, $new, $listId, $forms, $show);
                $go[] = acajoom::makeObj('act', $action);
                backHTML::formEnd($go);
            } else {
                $forms['main'] = " <form action='index2.php' method='post' name='adminForm'> \n\r";
                xmailing::_header($task, $action, $mailing->list_type, $message);
                //backHTML::formStart();
                mailingsHTML::viewMailing($mailing, $forms);
                $go[] = acajoom::makeObj('act', 'mailing');
                $go[] = acajoom::makeObj('task', 'viewmailing');
                $go[] = acajoom::makeObj('listid', $mailing->list_id);
                backHTML::formEnd($go);
            }
            break;
        case 'new':
        case 'add':
            if ($listId == 0) {
                echo "<script> alert('" . addslashes(_ACA_SELCT_MAILING) . "'); window.history.go(-1);</script>\n";
                return false;
            } else {
                $total = xmailing::countMailings($listId, '');
                $total++;
                compa::redirect('index2.php?option=com_acajoom&act=mailing&task=edit&mailingid=0&issue_nb=' . $total . '&listid=' . $listId);
            }
            break;
        case 'saveSend':
            xmailing::saveMailing($mailingId, $listId);
        case 'sendNewsletter':
            if ($listId < 1 or $listType < 0) {
                $mailing = xmailing::getOneMailing('', $mailingId, '', $new, true);
                $listId = $mailing->list_id;
                $listType = $mailing->list_type;
            }
            if (lisType::sendType($listType)) {
                $checkStatus = lists::checkStatus($listId);
                if ($checkStatus == false) {
                    $message = acajoom::printYN(0, _ACA_MESSAGE_SENT_SUCCESSFULLY, _ACA_NOT_PUBLISHED);
                    $showMailings = true;
                } else {
                    $receivers = subscribers::getSubscribers(-1, -1, '', $total, $listId, '', 1, 1, 'sub_emailA');
                    if (empty($receivers)) {
                        $message = acajoom::printYN(0, _ACA_MESSAGE_SENT_SUCCESSFULLY, _ACA_NO_SUSCRIBERS);
                        $showMailings = true;
                    } else {
                        $status = queue::sendNewsletter(true, $mailingId, $listId, $receivers, $message);
                        $message = acajoom::printYN($status, _ACA_MESSAGE_SENT_SUCCESSFULLY, $message);
                        $showMailings = true;
                        flush();
                        sleep(5);
                        compa::redirect('index2.php?option=com_acajoom&act=mailing&listype=' . $listType, $message);
                    }
                }
            } else {
                if (class_exists('auto')) {
                    $message = acajoom::printYN(auto::processQueue(true), _ACA_QUEUE_SENT_SUCCESS, _ACA_ERROR);
                }
                $showMailings = true;
            }
            break;
        case 'savePreview':
            xmailing::saveMailing($mailingId, $listId);
        case 'preview':
            if (ACA_CMSTYPE) {
                // joomla 15
                $emailaddress = JRequest::getVar('emailaddress', '');
            } else {
                //joomla 1x
                $emailaddress = mosGetParam($_REQUEST, 'emailaddress', '');
            }
            //endif
            if (!empty($emailaddress)) {
                $status = xmailing::preview($mailingId, $listId, $message);
                $message = acajoom::printYN($status, _ACA_MESSAGE_SENT_SUCCESSFULLY, $message);
            }
            backHTML::_header(_ACA_PREVIEW_TITLE, 'preview_f2.png', $message, $task, $action);
            mailingsHTML::previewMailingHTML($mailingId, $listId, $listType);
            if ($listId > 0) {
                $archivemailing = xmailing::getMailingView($mailingId, $listId);
            } else {
                $archivemailing = xmailing::getMailingView($mailingId);
            }
            $forms['main'] = '';
            $list = lists::getOneList($archivemailing->list_id);
            $textonly = '';
            acajoom_mail::getContent($archivemailing->images, $list->layout, $archivemailing->htmlcontent, $textonly);
            acajoom_mail::replaceClass($archivemailing->htmlcontent, $textonly);
            mailingsHTML::viewMailing($archivemailing, $forms);
            break;
        case 'view':
            if ($mailingId != 0) {
                if ($listId > 0) {
                    $archivemailing = xmailing::getMailingView($mailingId, $listId);
                } else {
                    $archivemailing = xmailing::getMailingView($mailingId);
                }
                $forms['main'] = " <form action='index2.php' method='post' name='adminForm'> \n\r";
                xmailing::_header($task, $action, $listType, $message);
                backHTML::formStart('', 0, '');
                mailingsHTML::viewMailing($archivemailing, $forms);
                $go[] = acajoom::makeObj('act', 'mailing');
                $go[] = acajoom::makeObj('task', 'viewmailing');
                $go[] = acajoom::makeObj('listid', $archivemailing->list_id);
                backHTML::formEnd($go);
            }
            break;
        case 'deleteMailing':
            $d['mailing'] = xmailing::getOneMailing('', $mailingId, '', $new);
            $message = acajoom::printYN(xmailing::delete($d), @constant($GLOBALS[ACA . 'listname' . $d['mailing']->list_type]) . _ACA_SUCCESS_DELETED, _ACA_ERROR);
            $showMailings = true;
            break;
        case 'cancel':
            compa::redirect('index2.php?option=com_acajoom');
            break;
        case 'copy':
            $message = acajoom::printYN(xmailing::copyMailing($mailingId), _ACA_MAILING_COPY, _ACA_ERROR);
            $showMailings = true;
            break;
        case 'cancelMailing':
            $showMailings = true;
            break;
        case 'publishMailing':
            $mailing = xmailing::getOneMailing('', $mailingId, '', $new);
            $message = acajoom::printYN(xmailing::publishMailing($mailingId), @constant($GLOBALS[ACA . 'listname' . $mailing->list_type]) . ' ' . _ACA_PUBLISHED, _ACA_ERROR);
            $showMailings = true;
            break;
        case 'unpublishMailing':
            $mailing = xmailing::getOneMailing('', $mailingId, '', $new);
            $message = acajoom::printYN(xmailing::unpublishMailing($mailingId), @constant($GLOBALS[ACA . 'listname' . $mailing->list_type]) . ' ' . _ACA_UNPUBLISHED, _ACA_ERROR);
            $showMailings = true;
            break;
        case 'cpanel':
            backHTML::controlPanel();
            break;
        case 'save':
            $message = acajoom::printYN(xmailing::saveMailing($mailingId, $listId), _ACA_MAILING_SAVED, _ACA_ERROR);
            $showMailings = true;
            unset($GLOBALS["task"]);
            unset($_REQUEST["task"]);
            break;
        case 'show':
        default:
            $showMailings = true;
            break;
    }
    if ($showMailings) {
        xmailing::showMailings($task, $action, $listId, $listType, $message, true, _ACA_MENU_MAILING);
    }
    return true;
}
예제 #9
0
 function showPanel()
 {
     global $Itemid;
     if (ACA_CMSTYPE) {
         $database =& JFactory::getDBO();
         $acl =& JFactory::getACL();
         $my =& JFactory::getUser();
     } else {
         global $my, $database, $acl;
     }
     //endif
     if (isset($my->id) && $my->id > 0) {
         if (!empty($my->username)) {
             $greeting_message = _HI . ' ' . $my->username;
         } else {
             $greeting_message = '';
         }
         backHTML::controlPanelBottonStart(_UCP_USER_MENU, 'cpanel.png');
         $link = '.php?option=com_acajoom&act=show&Itemid=' . $Itemid;
         compa::completeLink($link, false);
         backHTML::quickiconButton($link, 'addusers.png', _UCP_USER_CONTACT, false, 'Registered', false);
         if (class_exists('pro')) {
             $aro_id = isset($my->id) && $my->id > 0 ? $acl->get_object_id('users', $my->id, 'ARO') : 1;
             $qacl = "SELECT `group_id` FROM `#__core_acl_groups_aro_map` WHERE `aro_id` =" . $aro_id;
             $database->setQuery($qacl);
             $usergid = $database->loadResult();
             $gidAdmin = $acl->get_group_id('Administrator', 'ARO');
             $ex_groups = $acl->get_group_children($gidAdmin, 'ARO', 'RECURSE');
             $ex_groups[] = $gidAdmin;
             if (in_array($usergid, $ex_groups)) {
                 $link = '.php?option=com_acajoom&act=list&Itemid=' . $Itemid;
                 compa::completeLink($link, false);
                 backHTML::quickiconButton($link, 'addedit.png', _ACA_MENU_LIST, false, 'admin', false);
             } else {
                 $lists = lists::getLists(0, 0, true);
                 $access = false;
                 foreach ($lists as $list) {
                     $bit = acajoom::checkPermissions('hello', 0, $list->acc_level);
                     if ($bit) {
                         $access = true;
                         break;
                     }
                 }
                 $link = '.php?option=com_acajoom&act=list&Itemid=' . $Itemid;
                 compa::completeLink($link, false);
                 if ($access) {
                     backHTML::quickiconButton($link, 'addedit.png', _ACA_MENU_LIST, false, 'Registered', false);
                 }
             }
         } else {
             $link = '.php?option=com_acajoom&act=list&Itemid=' . $Itemid;
             compa::completeLink($link, false);
             backHTML::quickiconButton($link, 'addedit.png', _ACA_MENU_LIST, false, 'admin', false);
         }
         backHTML::controlPanelBottomEnd();
         if (class_exists('auto')) {
             auto::otherPanel();
         }
     }
 }
예제 #10
0
 function import($listId)
 {
     $erro = new xerr(__FILE__, __FUNCTION__, __CLASS__);
     @set_time_limit(0);
     $queue = '';
     $queue->sub_list_id = mosGetParam($_REQUEST, 'sub_list_id', '');
     $queue->subscribed = mosGetParam($_REQUEST, 'subscribed', '');
     $queue->acc_level = mosGetParam($_REQUEST, 'acc_level', 29);
     $path = $GLOBALS['mosConfig_absolute_path'] . $GLOBALS[ACA . 'upload_url'];
     $filename = $_FILES['importfile']['name'];
     if (is_writable($path)) {
         if (!@move_uploaded_file($_FILES['importfile']['tmp_name'], $path . $filename)) {
             echo _ACA_ERROR_MOVING_UPLOAD;
         }
         $import = file_get_contents($path . $filename);
         $import = str_replace(array("\r", "\r\n"), "\n", $import);
         $array = explode("\n", $import);
         if (sizeof($array) > 0) {
             foreach ($array as $row) {
                 $row = trim($row);
                 if (empty($row)) {
                     continue;
                 }
                 $values = explode(',', $row);
                 if (count($values) != 4) {
                     echo '<br />' . acajoom::printM('red', $row . ' : Acajoom needs 4 arguments for each user');
                     continue;
                 }
                 $values[0] = trim($values[0]);
                 $values[1] = trim($values[1]);
                 if (isset($values[1])) {
                     $valid = subscribers::validEmail($values[1]);
                     if (!$valid) {
                         echo '<br />' . acajoom::printM('red', $values[1] . ': ' . _ACA_EMAIL_INVALID);
                         continue;
                     } else {
                         $subscriber = null;
                         $subscriber->name = addslashes($values[0]);
                         $subscriber->email = $values[1];
                         $subscriber->receive_html = empty($values[2]) ? '0' : '1';
                         $subscriber->confirmed = empty($values[3]) ? '0' : '1';
                         $subscriber->subscribe_date = acajoom::getNow();
                         $subscriber->language_iso = 'eng';
                         $subscriber->timezone = '00:00:00';
                         $subscriber->blacklist = '0';
                         $subscriber->params = '';
                         $d['email'] = $subscriber->email;
                         $erro->ck = subscribers::getSubscriberIdFromEmail($d);
                         $erro->Eck(__LINE__, '8679');
                         $subscriberId = $d['subscriberId'];
                         if ($subscriberId < 1) {
                             $erro->ck = subscribers::insertSubscriber($subscriber, $subscriberId);
                             $erro->Eck(__LINE__, '8650');
                         }
                         if (!$erro->ck) {
                             echo '<br />' . acajoom::printM('red', $values[0] . ': ' . _ACA_SUBCRIBER_EXIT);
                         } else {
                             if (!empty($queue->subscribed) and $subscriberId > 0) {
                                 $queue->user_id = $subscriberId;
                                 $erro->ck = queue::updateSuscription($queue);
                                 $erro->Eck(__LINE__, '8651');
                                 if ($GLOBALS[ACA . 'require_confirmation'] == '1' and $values[3] == '0') {
                                     $listIds = array();
                                     $size = sizeof($queue->sub_list_id);
                                     for ($index = 0; $index < $size; $index++) {
                                         if (isset($queue->subscribed[$index])) {
                                             if ($queue->subscribed[$index] > 0) {
                                                 $listIds[] = $queue->sub_list_id[$index];
                                             }
                                         }
                                     }
                                     $erro->ck = acajoom_mail::processConfirmationEmail($subscriberId, $listIds);
                                     $erro->Eck(__LINE__, '8652');
                                 }
                                 if ($erro->ck) {
                                     echo '<br />' . acajoom::printM('green', $values[0] . ': ' . _ACA_IMPORT_SUCCESS);
                                 } else {
                                     echo '<br />' . acajoom::printM('blue', $values[0] . ': ' . _ACA_PB_QUEUE);
                                 }
                             }
                         }
                     }
                 }
             }
             return true;
         }
         $erro->ck = unlink($path . $filename);
         $erro->Eck(__LINE__, '8655');
         if (!$erro->ck) {
             echo _ACA_DELETION_OFFILE . ' ' . $path . $filename . ' ' . _ACA_MANUALLY_DELETE . '.</p>';
         }
     } else {
         echo _ACA_CANNOT_WRITE_DIR . ' ' . $path . '</p>';
         return false;
     }
 }
예제 #11
0
 function updateSuscription($suscription)
 {
     $erro = new xerr(__FILE__, __FUNCTION__, __CLASS__);
     //$i = 0;
     //do  {
     //$i++;
     foreach ($suscription->sub_list_id as $i => $value) {
         $queues = queue::suscriptionExist($suscription->user_id, $suscription->sub_list_id[$i]);
         if (!empty($queues)) {
             if (isset($suscription->subscribed[$i])) {
                 if ($suscription->subscribed[$i] == 0) {
                     $erro->ck = queue::deleteSubsQueue($suscription->user_id, $suscription->sub_list_id[$i]);
                     $erro->Eck(__LINE__, '8520');
                 } else {
                     $updatedQueue = $queues;
                     $updatedQueue->acc_level = $suscription->acc_level[$i];
                     if ($queues->mailing_id < 1) {
                         $mailingId = xmailing::getFirstMailingId($queues->list_id);
                         if (!empty($mailingId)) {
                             $list = lists::getOneList($queues->list_id);
                             $mailing = queue::getValidMailing($list, $mailingId);
                             if (!empty($mailing)) {
                                 $updatedQueue->type = $mailing->list_type;
                                 $updatedQueue->list_id = $list->id;
                                 $updatedQueue->mailing_id = $mailing->id;
                                 $updatedQueue->published = $list->published;
                                 $updatedQueue->send_date = acajoom::getNow();
                                 if ($mailing->list_type == 1 or $mailing->list_type == 7) {
                                     $updatedQueue->issue_nb = 0;
                                     $updatedQueue->send_date = '0000-00-00 00:00:00';
                                     $updatedQueue->delay = 0;
                                 } else {
                                     $updatedQueue->issue_nb = $mailing->issue_nb;
                                     $updatedQueue->send_date = acajoom::getNow();
                                     $updatedQueue->delay = $mailing->delay;
                                 }
                             }
                         }
                         $qid = '';
                         $qid[0] = $updatedQueue->qid;
                         $erro->ck = queue::updateQueueData($qid, '', $updatedQueue->type, $updatedQueue->list_id, $updatedQueue->mailing_id, $updatedQueue->issue_nb, $updatedQueue->send_date, $updatedQueue->delay, $updatedQueue->acc_level, $updatedQueue->published);
                         $erro->Eck(__LINE__, '8521');
                     } else {
                         queue::updateAccessLevel($updatedQueue);
                     }
                 }
             }
         } else {
             if (isset($suscription->subscribed[$i])) {
                 if ($suscription->subscribed[$i] == 1) {
                     $subId = array();
                     $subId[0] = $suscription->user_id;
                     $subList = isset($suscription->sub_list_id[$i]) ? $suscription->sub_list_id[$i] : 0;
                     $subLevel = isset($suscription->acc_level[$i]) ? $suscription->acc_level[$i] : 29;
                     $erro->ck = queue::updateQueues($subId, '', $subList, $subLevel, true);
                     $erro->Eck(__LINE__, '8522');
                 }
             }
         }
     }
     //while (count($suscription->sub_list_id ) > $i );
     return $erro->R();
 }
예제 #12
0
 function moveTo($dir_dest, $overwrite = true)
 {
     if (!$this->isValid()) {
         return acajoom::printM('error', $this->upload['error']);
     }
     if (!$this->_evalValidExtensions()) {
         return acajoom::printM('error', _ACA_NOT_ALLOWED_EXTENSION);
     }
     $err_code = $this->_chk_dir_dest($dir_dest);
     if ($err_code !== false) {
         return acajoom::printM('error', $err_code);
     }
     if (!$this->mode_name_selected) {
         $this->setName('safe');
     }
     $name_dest = $dir_dest . DIRECTORY_SEPARATOR . $this->upload['name'];
     if (@is_file($name_dest)) {
         if ($overwrite !== true) {
             return acajoom::printM('error', _ACA_FILE_EXISTS);
         } elseif (!is_writable($name_dest)) {
             return acajoom::printM('error', _ACA_CANNOT_OVERWRITE);
         }
     }
     if (!@move_uploaded_file($this->upload['tmp_name'], $name_dest)) {
         return acajoom::printM('error', _ACA_E_FAIL_MOVE);
     }
     @chmod($name_dest, $this->_chmod);
     return $this->getProp('name');
 }
예제 #13
0
 function email()
 {
     global $version, $database;
     $acaVers = class_exists('acajoom') ? acajoom::version() : 'test';
     $acaNow = class_exists('acajoom') ? acajoom::getNow() : time();
     $safemode = ini_get("safe_mode") == 0 ? 'off' : 'on';
     $content = "-----------------------------------\n";
     $content .= $GLOBALS[ACA . 'component'] . " Configuration: \n";
     $content .= "-----------------------------------\n\n";
     $content .= "Component        : " . $acaVers . "  \n";
     $content .= "Language           : " . $GLOBALS['mosConfig_lang'] . "\n";
     $content .= ' Time of report : ' . $acaNow . "\n\n";
     $content .= "Send method: " . $GLOBALS[ACA . 'emailmethod'] . "\n";
     if ($GLOBALS[ACA . 'emailmethod'] == 'smtp') {
         $auth = $GLOBALS[ACA . 'smtp_auth_required'] == 1 ? 'yes' : 'no';
         $content .= "Authentication required: " . $auth . "\n";
     }
     $content .= "-----------------------------------\n";
     $content .= " Server configuration: \n";
     $content .= "-----------------------------------\n\n";
     $content .= "Joomla Version        : " . $version . "\n";
     $content .= "Database Version     : " . $database->getVersion() . "\n";
     $content .= "PHP Version             : " . phpversion() . "\n";
     $content .= "Zend Version            : " . zend_version() . "\n";
     $content .= "Magic_quotes_gpc    : " . ini_get("magic_quotes_gpc") . "\n";
     $content .= "Disable_functions     : " . ini_get("disable_functions") . "\n";
     $content .= "Max_execution_time : " . ini_get("max_execution_time") . "\n";
     $content .= "Safe_mode              : " . $safemode . "\n";
     $content .= "Memory_limit           : " . ini_get("memory_limit") . "\n";
     $content .= "Software                 : " . $_SERVER['SERVER_SOFTWARE'] . "\n";
     $content .= "-----------------------------------\n";
     $content .= " Traces: \n";
     $content .= "-----------------------------------\n\n";
     $content .= "Error #       :" . _ACA_ERR_NB . $this->errNb . "\n\n\n";
     $content .= "Line            : " . $this->line . "\n";
     $content .= "Class           : " . $this->classes . "\n";
     $content .= "Function      : " . $this->fct . "\n";
     $content .= "File             : " . $this->file_name . "\n";
     $content .= "\n\n";
     if ($this->err) {
         $content .= "Error raised: " . $this->varDump($this->err) . "\n";
     }
     if ($this->data) {
         $content .= "Data          : " . $this->varDump($this->data) . "\n";
     }
     $content .= "\n\n";
     $content .= "\n\n";
 }
예제 #14
0
    function cbSettings()
    {
        if (ACA_CMSTYPE) {
            $lists['cb_plugin'] = JHTML::_('select.booleanlist', "config['cb_plugin']", 'class="inputbox"', $GLOBALS[ACA . 'cb_plugin']);
            $lists['cb_showname'] = JHTML::_('select.booleanlist', "config['cb_showname']", 'class="inputbox"', $GLOBALS[ACA . 'cb_showname']);
            $lists['cb_checkLists'] = JHTML::_('select.booleanlist', "config['cb_checkLists']", 'class="inputbox"', $GLOBALS[ACA . 'cb_checkLists']);
            $lists['cb_showHTML'] = JHTML::_('select.booleanlist', "config['cb_showHTML']", 'class="inputbox"', $GLOBALS[ACA . 'cb_showHTML']);
            $lists['cb_defaultHTML'] = JHTML::_('select.booleanlist', "config['cb_defaultHTML']", 'class="inputbox"', $GLOBALS[ACA . 'cb_defaultHTML']);
        } else {
            $lists['cb_plugin'] = mosHTML::yesnoRadioList("config['cb_plugin']", 'class="inputbox"', $GLOBALS[ACA . 'cb_plugin']);
            $lists['cb_showname'] = mosHTML::yesnoRadioList("config['cb_showname']", 'class="inputbox"', $GLOBALS[ACA . 'cb_showname']);
            $lists['cb_checkLists'] = mosHTML::yesnoRadioList("config['cb_checkLists']", 'class="inputbox"', $GLOBALS[ACA . 'cb_checkLists']);
            $lists['cb_showHTML'] = mosHTML::yesnoRadioList("config['cb_showHTML']", 'class="inputbox"', $GLOBALS[ACA . 'cb_showHTML']);
            $lists['cb_defaultHTML'] = mosHTML::yesnoRadioList("config['cb_defaultHTML']", 'class="inputbox"', $GLOBALS[ACA . 'cb_defaultHTML']);
        }
        //endif
        ?>
		<fieldset class="acajoomcss">
		<legend><?php 
        echo _ACA_CB_INTEGRATION;
        ?>
</legend>
		<?php 
        acajoom::beginingOfTable('acajoomtable');
        if ($GLOBALS[ACA . 'cb_pluginInstalled'] == 0) {
            if (!acajoom::checkCBPlugin()) {
                acajoom::miseEnPage(acajoom::WarningIcon(_ACA_CB_PLUGIN_NOT_INSTALLED), ' ', '<span style="color: rgb(255, 0, 0);">' . _ACA_CB_PLUGIN_NOT_INSTALLED . '</span>');
            }
        }
        acajoom::miseEnPage(_ACA_CB_PLUGIN, _ACA_CB_PLUGIN_TIPS, $lists['cb_plugin']);
        acajoom::miseEnPage(_ACA_CB_LISTS, _ACA_CB_LISTS_TIPS, "<input class=\"inputbox\" type=\"text\" name=\"config['cb_listIds']\" size=\"30\" value=\"" . $GLOBALS[ACA . 'cb_listIds'] . "\" >");
        acajoom::miseEnPage(_ACA_CB_INTRO, _ACA_CB_INTRO_TIPS, "<textarea  name=\"config['cb_intro']\" rows=\"3\" cols=\"40\" >" . $GLOBALS[ACA . 'cb_intro'] . "</textarea>");
        acajoom::miseEnPage(_ACA_CB_SHOW_NAME, _ACA_CB_SHOW_NAME_TIPS, $lists['cb_showname']);
        acajoom::miseEnPage(_ACA_CB_LIST_DEFAULT, _ACA_CB_LIST_DEFAULT_TIPS, $lists['cb_checkLists']);
        acajoom::miseEnPage(_ACA_CB_HTML_SHOW, _ACA_CB_HTML_SHOW_TIPS, $lists['cb_showHTML']);
        acajoom::miseEnPage(_ACA_CB_HTML_DEFAULT, _ACA_CB_HTML_DEFAULT_TIPS, $lists['cb_defaultHTML']);
        acajoom::endOfTable();
        echo '</fieldset>';
    }
예제 #15
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;
 }
예제 #16
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;
}
예제 #17
0
function installBots15()
{
    $database =& JFactory::getDBO();
    $error = '';
    $return = '<b>' . _ACA_INSTALL_BOT . '</b> : ';
    if (!is_dir(ACA_JPATH_ROOT . '/plugins/acajoom')) {
        if (!@mkdir(ACA_JPATH_ROOT . '/plugins/acajoom', 0755)) {
            $return .= '<br /> Error adding bot directory.';
        } else {
            @chmod(ACA_JPATH_ROOT . '/plugins/acajoom', 0755);
        }
    }
    $bot_files = array('acajoombot.php', 'acajoombot.xml', 'index.html');
    foreach ($bot_files as $bot_file) {
        if (is_file(ACA_JPATH_ROOT . '/plugins/acajoom/' . $bot_file)) {
            @unlink(WPATH_ADMIN . 'bots15/' . $bot_file);
        } else {
            if (!@rename(WPATH_ADMIN . 'bots15/' . $bot_file, ACA_JPATH_ROOT . '/plugins/acajoom/' . $bot_file)) {
                $error .= '<br />Error copying bot file ' . $bot_file . ' to bot directory.';
            }
        }
    }
    @chmod(ACA_JPATH_ROOT . '/plugins/acajoom', 0755);
    if (!@rmdir(WPATH_ADMIN . 'bots15/')) {
        $error .= '<br /> Error deleting the temporary bot directory.';
    }
    ### Acajoom bot
    $bot_infos = array('Acajoom Content Bot', 'acajoombot');
    foreach ($bot_infos as $bot_info) {
        $query = "SELECT `id` FROM `#__plugins` WHERE `element` = 'acajoombot'";
        $database->setQuery($query);
        $database->query();
        $errorDB = $database->getErrorMsg();
        if (!empty($errorDB)) {
            $error .= '<br /> Error getting bot information from bot table for "' . $bot_info[0] . '". Database error: <br />' . $errorDB . '<br />';
        } else {
            $id = $database->loadResult();
            if (!$id) {
                JLoader::register('JTablePlugin', JPATH_LIBRARIES . DS . 'joomla' . DS . 'database' . DS . 'table' . DS . 'plugin.php');
                $row = new JTablePlugin($database);
                $row->name = $bot_infos[0];
                $row->ordering = 0;
                $row->folder = 'acajoom';
                $row->iscore = 0;
                $row->access = 0;
                $row->client_id = 0;
                $row->element = $bot_infos[1];
                $row->published = 1;
                if (!$row->store()) {
                    $error .= '<br />Error adding bot information to bot table for "' . $bot_info[0] . '".';
                }
            }
        }
    }
    if (empty($error)) {
        $return .= acajoom::printM('green', _ACA_INSTALL_SUCCESS) . '<br />';
    } else {
        $return .= $error . acajoom::printM('red', _ACA_INSTALL_ERROR) . '<br />';
    }
    return $return;
}
예제 #18
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 update($action, $task)
{
    $update = new wupdate();
    $showListing = true;
    $showComplete = false;
    if (ACA_CMSTYPE) {
        // joomla 15
        $message = JRequest::getVar('message', '');
    } else {
        //joomla 1x
        $message = mosGetParam($_REQUEST, 'message', '');
    }
    //endif
    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':
            $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;
    }
    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);
    }
}
예제 #19
0
 function fileSkip()
 {
     if ($GLOBALS[ACA . 'cb_pluginInstalled'] != '1') {
         if (!acajoom::checkCB()) {
             switch ($file) {
                 case 'components/com_comprofiler/plugin/user/plug_acajoomcbplugin/acajoom_cb.php':
                 case 'components/com_comprofiler/plugin/user/plug_acajoomcbplugin/acajoom_cb.xml':
                 case 'components/com_comprofiler/plugin/user/plug_acajoomcbplugin/index.html':
                     return false;
                     break;
                 default:
                     return true;
                     break;
             }
         }
     }
     return true;
 }
예제 #20
0
 function insert_subs_to_mailing($list_id, $mailing_id, $send_date, $acc_level)
 {
     if (ACA_CMSTYPE) {
         $database =& JFactory::getDBO();
     } else {
         global $database;
     }
     //endif
     $query = 'INSERT IGNORE INTO `#__acajoom_queue` (`type`, `subscriber_id`, `list_id`, `mailing_id`, `issue_nb`, `send_date`, `acc_level`, `published`) ';
     $query .= 'SELECT `q`.`type`, `q`.`subscriber_id`, `q`.`list_id`, ' . intval($mailing_id) . ', 0, \'' . $send_date . '\', ' . $acc_level . ', 2 ';
     $query .= 'FROM `#__acajoom_queue` `q`, `#__acajoom_subscribers` `s` ';
     $query .= 'WHERE `q`.`list_id` = ' . intval($list_id) . ' ';
     $query .= 'AND `q`.`subscriber_id` = `s`.`id` AND `s`.`blacklist` = 0 AND `s`.`confirmed` = 1 ';
     $database->setQuery($query);
     $database->query();
     $database->setQuery('SELECT COUNT(*) FROM `#__acajoom_queue` WHERE `mailing_id` = ' . intval($mailing_id));
     $number = $database->loadResult();
     $gmtTime = strtotime($send_date);
     $gmtDate = date('Y-m-d H:i:s', $gmtTime - ACA_TIME_OFFSET * 60 * 60);
     echo acajoom::printM('blue', $number . ' e-mails are in the queue for the mailing ID' . intval($mailing_id) . ' and will be sent at ' . $send_date . ' (' . $gmtDate . ' GMT )');
     $erro = new xerr(__FILE__, __FUNCTION__, __CLASS__);
     $erro->err = $database->getErrorMsg();
     return $erro->E(__LINE__, '8534', $database);
 }
예제 #21
0
    function showListingLists($lists, $action, $task, $forms, $show)
    {
        global $Itemid, $mainframe, $my;
        $loggedin = false;
        if ($my->id > 0) {
            $loggedin = true;
        }
        if (!$mainframe->isAdmin() and !empty($GLOBALS[ACA . 'itemidAca'])) {
            $Itemid = $GLOBALS[ACA . 'itemidAca'];
            $item = '&Itemid=' . $Itemid;
        } else {
            $item = '';
        }
        echo $forms['main'];
        echo '<table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist"><tr>';
        if ($show['id']) {
            echo '<th width="2%" class="title">id#</td>';
        }
        if ($show['select']) {
            echo '<th width="3%" class="title"></th>';
        }
        if ($show['published']) {
            echo '<th width="5%" class="title">' . _ACA_PUBLISHED . '</th>';
        }
        echo '<th width="30%" class="title">' . _ACA_LIST_NAME . '</th>';
        if ($show['sender']) {
            echo '<th width="20%" class="title">' . _ACA_LIST_SENDER . ' </th>';
        }
        if ($show['sender_email']) {
            echo ' <th width="15%" class="title">' . _ACA_SENDER_EMAIL . '</th>';
        }
        if ($show['mailings_link']) {
            echo '<th width="17%" class="title">' . _ACA_MENU_MAILING_TITLE . '</th>';
        }
        if ($show['mailings_sub']) {
            echo '<th width="17%" class="title">' . _ACA_SUBSCRIBER_CONFIG . '</th>';
        }
        if ($show['list_type']) {
            echo '<th width="10%" class="title">' . _ACA_LIST_TYPE . '</th>';
        }
        if ($show['visible']) {
            echo '<th width="5%" class="title">' . _ACA_VISIBLE . '</th>';
        }
        if ($show['buttons']) {
            if ($GLOBALS[ACA . 'allow_unregistered'] or $loggedin) {
                echo '<th class="title" width="90"><center>' . _ACA_SUBSCRIB . '</center></th>';
            }
            if ($GLOBALS[ACA . 'show_archive'] == '1') {
                echo '<th class="title" width="90"><center>' . _ACA_VIEW_ARCHIVE . '</center></th>';
            }
        }
        echo '</tr>';
        $i = 0;
        foreach ($lists as $list) {
            $i++;
            if ($list->list_type == 1 or $list->list_type == 7) {
                $linkArchive = '.php?option=com_acajoom&act=mailing&listid=' . $list->id . '&listype=' . $list->list_type . '&task=archive' . $item;
            } else {
                $linkArchive = '#';
            }
            if ($list->published == 1) {
                $img = 'publish_g.png';
                $alt = 'Published';
            } else {
                if ($list->published == 2) {
                    $img = 'publish_y.png';
                    $alt = 'Scheduled';
                } else {
                    $img = 'publish_x.png';
                    $alt = 'Unpublished';
                }
            }
            ?>
		<tr class="row<?php 
            echo $i % 2;
            ?>
">

			<?php 
            if ($show['id']) {
                echo '<td width="2%" class="title"><center>' . $list->id . '<center></td>';
            }
            ?>
			<?php 
            if ($show['select']) {
                ?>
			<td><input type="radio" name="listid" value="<?php 
                echo $list->id;
                ?>
" onClick="isChecked(this.checked);" /></td>
			<?php 
            }
            if ($show['published']) {
                ?>
			<td align="center"><center>
				<img src="<?php 
                echo $GLOBALS['mosConfig_live_site'];
                ?>
/administrator/images/<?php 
                echo $img;
                ?>
" width="12" height="12" border="0" alt="<?php 
                echo $alt;
                ?>
" />
			</center></td>
			<?php 
            }
            if ($show['index'] == 'index') {
                if (acajoom::checkPermissions('admin')) {
                    $link = '.php?option=com_acajoom&act=' . $action . '&task=' . $task . '&listid=' . $list->id . $item;
                } else {
                    $link = $linkArchive;
                }
                compa::completeLink($link, false);
            } else {
                $link = '.php?option=com_acajoom&act=' . $action . '&task=' . $task . '&listid=' . $list->id;
                compa::completeLink($link);
            }
            ?>
			<td>
				<span class="aca_letter_names" <?php 
            if ($link == "#" or $link == "administrator/#") {
                echo " onClick='return false;' ";
            }
            ?>
>
				<?php 
            echo compa::toolTip($list->list_desc, $list->list_name, '', '', $list->list_name, $link, 1);
            ?>
				</span>
			</td>

			<?php 
            if ($show['sender']) {
                echo '<td>' . $list->sendername . '</td>';
            }
            if ($show['sender_email']) {
                echo ' <td width="20%" class="title">' . $list->senderemail . '</td>';
            }
            if ($show['mailings_link']) {
                if ($show['index'] == 'index') {
                    $link = '.php?option=com_acajoom&act=mailing&task=show&listid=' . $list->id . '&listype=' . $list->list_type . $item;
                    compa::completeLink($link, false);
                } else {
                    $link = '.php?option=com_acajoom&act=mailing&task=show&listid=' . $list->id . '&listype=' . $list->list_type;
                    compa::completeLink($link);
                }
                ?>
				<td><a href="<?php 
                echo $link;
                ?>
"> <?php 
                echo _ACA_MALING_EDIT_VIEW;
                ?>
</a></td>
			<?php 
            }
            if ($show['mailings_sub']) {
                if ($show['index'] == 'index') {
                    $link = '.php?option=com_acajoom&act=subscribers&listid=' . $list->id . $item;
                    compa::completeLink($link, false);
                } else {
                    $link = '.php?option=com_acajoom&act=subscribers&listid=' . $list->id;
                    compa::completeLink($link);
                }
                ?>
				<td><a href="<?php 
                echo $link;
                ?>
"> <?php 
                echo _ACA_SUBCRIBERS_VIEW;
                ?>
</a></td>
			<?php 
            }
            if ($show['list_type']) {
                if ($show['index'] == 'index') {
                    $link = '.php?option=com_acajoom&act=mailing&listype=' . $list->list_type . $item;
                    compa::completeLink($link, false);
                } else {
                    $link = '.php?option=com_acajoom&act=mailing&listype=' . $list->list_type;
                    compa::completeLink($link);
                }
                ?>
				<td><a href="<?php 
                echo $link;
                ?>
" ><?php 
                echo @constant($GLOBALS[ACA . 'listname' . $list->list_type]);
                ?>
</a></td>
			<?php 
            }
            if ($show['visible']) {
                if ($list->hidden == 1) {
                    $img = 'tick.png';
                } else {
                    $img = 'publish_x.png';
                }
                ?>
			<td height="20"><center><img src="<?php 
                echo $GLOBALS['mosConfig_live_site'];
                ?>
/administrator/images/<?php 
                echo $img;
                ?>
" width="12" height="12" border="0" alt="" /></center></td>
			<?php 
            }
            ?>

	<?php 
            if ($show['buttons']) {
                if ($GLOBALS[ACA . 'allow_unregistered'] or $loggedin) {
                    if (function_exists('sefRelToAbs') and $GLOBALS[ACA . 'use_sef']) {
                        $link = sefRelToAbs($show['index'] . '.php?option=com_acajoom&act=subone&listid=' . $list->id . $item);
                    } else {
                        $link = $show['index'] . '.php?option=com_acajoom&act=subone&listid=' . $list->id . $item;
                    }
                    $img = 'folder_add_f2.png';
                    echo '<td align="center" height="24"><center>';
                    echo '<a href="' . $link . '" >' . "\n\r";
                    echo '<img src="components/com_acajoom/images/' . $img . '" width="20" height="20" border="0" alt="" /></a></center></td>' . "\n\r";
                }
                if (($list->list_type == 1 or $list->list_type == 7) && $GLOBALS[ACA . 'show_archive'] == '1') {
                    if (function_exists('sefRelToAbs') and $GLOBALS[ACA . 'use_sef']) {
                        $linkArchive = sefRelToAbs($show['index'] . '.php?option=com_acajoom&act=mailing&listid=' . $list->id . '&listype=' . $list->list_type . '&task=archive' . $item);
                    } else {
                        $linkArchive = $show['index'] . '.php?option=com_acajoom&act=mailing&listid=' . $list->id . '&listype=' . $list->list_type . '&task=archive' . $item;
                    }
                    $img = 'move_f2.png';
                    echo '<td height="24"><center>';
                    echo '<a href="' . $linkArchive . '" >' . "\n\r";
                    echo '<img src="components/com_acajoom/images/' . $img . '" width="20" height="20" border="0" alt="' . _ACA_VIEW_ARCHIVE . '" /></a></center></td>' . "\n\r";
                } elseif ($GLOBALS[ACA . 'show_archive'] == '1') {
                    echo '<td height="24"><center>-</center></td>' . "\n\r";
                }
            }
            echo '	</tr>' . "\n\r";
        }
        echo '</table>';
    }
예제 #22
0
 function upgrade_News3()
 {
     global $my, $database;
     $xf = new xonfig();
     $newLists = array();
     $idImportedList = array();
     $i = 0;
     $database->setQuery("SELECT * FROM #__newsletter_letters");
     $newsletters = $database->loadObjectList();
     $error = $database->getErrorMsg();
     if (!empty($error)) {
         echo '<p><b>Error (class.upgrade.php->upgrade_News3 () line ' . __LINE__ . '):</b> Error getting newsletters. Database error: <br />' . $error . '</p>';
         return false;
     } else {
         foreach ($newsletters as $newsletter) {
             $list->list_name = $newsletter->list_name;
             $list->list_desc = $newsletter->list_desc;
             $list->sendername = $newsletter->sendername;
             $list->senderemail = $newsletter->senderemail;
             $list->bounceadres = $newsletter->bounceadres;
             $list->layout = $newsletter->layout;
             $list->template = 0;
             $list->subscribemessage = $newsletter->subscribemessage;
             $list->unsubscribemessage = $newsletter->unsubscribemessage;
             $list->html = $newsletter->html;
             $list->hidden = !$newsletter->hidden;
             $list->unsubscribesend = 1;
             $list->list_type = '1';
             $list->auto_add = 0;
             $list->user_choose = 0;
             $list->cat_id = 0;
             $list->delay_min = 0;
             $list->delay_max = 0;
             $list->follow_up = 0;
             $list->owner = $my->id;
             $list->auto_add = 0;
             $list->acc_level = $newsletter->aid;
             $list->acc_id = 29;
             $list->published = 1;
             $list->createdate = acajoom::getNow();
             $list->footer = 1;
             $list->notify_id = 0;
             $list->notification = 0;
             $query = 'INSERT INTO `#__acajoom_lists` (`list_name`) VALUES (\'' . $list->list_name . '\'  )';
             $database->setQuery($query);
             $database->query();
             $error = $database->getErrorMsg();
             if (!empty($error)) {
                 echo '<p><b>Error (class.upgrade.php->upgrade_News3() line ' . __LINE__ . '):</b> Error adding list to database. Database error: <br />' . $error . '</p><br /><br />Are you trying to insert a list name which is already in use?    The list name has to be different for each list! <br /><br />';
             } else {
                 $query = 'SELECT * FROM `#__acajoom_lists` WHERE `list_name`= \'' . $list->list_name . '\'';
                 $database->setQuery($query);
                 $database->loadObject($mynewlist);
                 $error = $database->getErrorMsg();
                 $xf->plus('totallist0', 1);
                 $xf->plus('act_totallist0', 1);
                 $xf->plus('totallist1', 1);
                 $xf->plus('act_totallist1', 1);
                 if (!empty($error)) {
                     echo '<p><b>Error (class.upgrade.php->upgrade_News3() line ' . __LINE__ . '):</b> Error getting listname. Database error: <br />' . $error . '</p>';
                     return false;
                 } else {
                     $idImportedList[$newsletter->id] = $mynewlist->id;
                     $newLists[$i] = $mynewlist->id;
                     $i++;
                     $list->id = $mynewlist->id;
                     $error = lists::updateListData($list);
                     if (!$error) {
                         echo '<p><b>Error (class.upgrade.php->upgrade_News3 () line ' . __LINE__ . '):</b> Error inserting list. Database error: <br />' . $error . '</p>';
                     } else {
                         echo '<br /><b>' . @constant($GLOBALS[ACA . 'listnames1']) . ': </b>' . $list->list_name . ': ' . acajoom::printM('green', _ACA_IMPORT_SUCCESS);
                         $database->setQuery("SELECT * FROM #__newsletter_mailing WHERE `list_id`=" . $newsletter->id);
                         $mailingsImports = $database->loadObjectList();
                         $error = $database->getErrorMsg();
                         if (!empty($error)) {
                             echo '<p><b>Error (class.upgrade.php->upgrade_News3() line ' . __LINE__ . '):</b> Error getting mailings. Database error: <br />' . $error . '</p>';
                             return false;
                         } else {
                             $issue_nb = 1;
                             foreach ($mailingsImports as $mailingsImport) {
                                 $mailings->list_id = $mynewlist->id;
                                 $mailings->list_type = '1';
                                 $mailings->send_date = $mailingsImport->send_date;
                                 $mailings->subject = $mailingsImport->subject;
                                 $mailings->htmlcontent = $mailingsImport->htmlcontent;
                                 $mailings->textonly = $mailingsImport->textonly;
                                 $mailings->attachments = $mailingsImport->attachments;
                                 $mailings->images = $mailingsImport->images;
                                 $mailings->published = $mailingsImport->published;
                                 $mailings->visible = $mailingsImport->visible;
                                 $mailings->html = $mynewlist->html;
                                 $mailings->fromname = $list->sendername;
                                 $mailings->fromemail = $list->senderemail;
                                 $mailings->frombounce = $list->bounceadres;
                                 $mailings->author_id = $my->id;
                                 $mailings->delay = 0;
                                 $mailings->issue_nb = $issue_nb;
                                 $mailings->acc_level = 25;
                                 $mailings->createdate = $list->createdate;
                                 $issue_nb++;
                                 $error = xmailing::insertMailingData($mailings);
                                 if (!$error) {
                                     echo '<p><b>Error (class.upgrade.php->upgrade_News3() line ' . __LINE__ . '):</b> Error inserting mailing. Database error: <br />' . $error . '</p>';
                                 } else {
                                     echo '<br /><b>' . _ACA_MENU_MAILING_TITLE . ': </b>' . $mailingsImport->subject . ': ' . acajoom::printM('green', _ACA_IMPORT_SUCCESS);
                                 }
                             }
                         }
                     }
                 }
             }
         }
         $database->setQuery("SELECT * FROM #__newsletter_subscribers");
         $subscribers = $database->loadObjectList();
         $error = $database->getErrorMsg();
         if (!empty($error)) {
             echo '<p><b>Error (class.upgrade.php->upgrade_News3() line ' . __LINE__ . '):</b> Error getting subscribers. Database error: <br />' . $error . '</p>';
             return false;
         } else {
             foreach ($subscribers as $subscriber) {
                 $newSubs = true;
                 $acajoomsubscribers = subscribers::getSubscribers(-1, -1, '', $total, 0, '', '', '', '');
                 foreach ($acajoomsubscribers as $acajoomsubscriber) {
                     if ($subscriber->subscriber_email == $acajoomsubscriber->email) {
                         $newSubs = false;
                         $subId[0] = $acajoomsubscriber->id;
                     }
                 }
                 if ($newSubs) {
                     $newSubscriber->user_id = $subscriber->userid;
                     $newSubscriber->name = $subscriber->subscriber_name;
                     $newSubscriber->email = $subscriber->subscriber_email;
                     $newSubscriber->receive_html = $subscriber->receive_html;
                     $newSubscriber->confirmed = $subscriber->confirmed;
                     $newSubscriber->subscribe_date = $subscriber->subscribe_date;
                     $newSubscriber->blacklist = 0;
                     $newSubscriber->timezone = '00:00:00';
                     $newSubscriber->language_iso = 'eng';
                     $newSubscriber->params = '';
                     $error = subscribers::insertSubscriber($newSubscriber, $subscriberId);
                     if (!empty($error)) {
                         if ($subscriberId < 1) {
                             echo ' Error inserting subscriber:' . $newSubscriber->name;
                         }
                         $error = '';
                         $subId[0] = $subscriberId;
                     } else {
                         echo '<br /><b>' . _ACA_MENU_SUBSCRIBERS . ': </b>' . $newSubscriber->name . ': ' . acajoom::printM('green', _ACA_IMPORT_SUCCESS);
                         $d['email'] = $subscriber->email;
                         $erro->ck = subscribers::getSubscriberIdFromEmail($d);
                         $erro->Eck(__LINE__, '8304');
                         $subId[0] = $d['subscriberId'];
                     }
                 } else {
                     echo '<br /><b>' . _ACA_MENU_SUBSCRIBERS . ': </b>' . $subscriber->subscriber_name . ': ' . acajoom::printM('red', _ACA_IMPORT_EXIST);
                 }
                 $j = 0;
                 $queue = queue::suscriptionExist($subId[0], $idImportedList[$subscriber->list_id]);
                 if (empty($queue)) {
                     $error = queue::insertQueuesForNews($subId, $idImportedList[$subscriber->list_id], 29);
                     if (!$error) {
                         echo '<p><b>Error (class.upgrade.php->upgrade_News3 () line ' . __LINE__ . '):</b> Error inserting queue. Database error: <br />' . $error . '</p>';
                     }
                 }
             }
         }
     }
     return true;
 }
예제 #23
0
function createGuide()
{
    global $my;
    $xf = new xonfig();
    $option = mosGetParam($_REQUEST, 'option', '');
    $guide = '';
    if ($option != 'com_installer') {
        $guide .= '<div width="80%"><center><fieldset class="menubackgr" style="padding: 10px; text-align: left">';
        $guide .= "<legend><img src='images/support.png' border='0' align='absmiddle' alt='acajoom guide' style='width: 35px; height: 35px;' hspace='6'>";
        $guide .= "<strong>Acajoom" . _ACA_GUIDE . "</strong></legend>";
        if ($GLOBALS[ACA . 'act_totallist0'] <= 0) {
            $guide .= _HI . ' ' . $my->username . "!" . _ACA_GUIDE_FIRST_ACA_STEP;
            $guide .= '<strong><u>' . _ACA_STEP . '1</u></strong><br />';
            if (($GLOBALS[ACA . 'news1'] == 1 or $GLOBALS[ACA . 'news2'] == 1 or $GLOBALS[ACA . 'news3'] == 1) and $option != 'com_installer') {
                $guide .= _ACA_GUIDE_FIRST_ACA_STEP_UPGRADE;
            }
            $guide .= _ACA_GUIDE_FIRST_ACA_STEP_DESC;
            $guide .= "<a href='index2.php?option=com_acajoom&act=list&task=new'>";
            $guide .= "<img src='images/new_f2.png' border='0' align='absmiddle' alt='acajoom guide' style='width: 26px; height: 26px;' hspace='6'>";
            $guide .= "</a>";
        } elseif ($GLOBALS[ACA . 'act_totalmailing0'] <= 0) {
            if ($GLOBALS[ACA . 'act_totallist1'] == 1) {
                $type_list = _ACA_NEWSLETTER;
                $link = '<a href="index2.php?option=com_acajoom&act=mailing&listype=1">' . _ACA_GUIDE_SECOND_ACA_STEP_NEWS . '</a>';
            } else {
                $type_list = _ACA_AUTORESP;
                $link = '<a href="index2.php?option=com_acajoom&act=mailing&listype=2">' . _ACA_GUIDE_SECOND_ACA_STEP_AUTO . '</a>';
            }
            $guide .= '<strong><u>' . _ACA_STEP . '2</u></strong><br />';
            $guide .= sprintf(_ACA_GUIDE_SECOND_ACA_STEP, $type_list);
            $guide .= $link;
            $guide .= sprintf(_ACA_GUIDE_SECOND_ACA_STEP_FINAL, $type_list, $type_list);
            $guide .= "<img src='images/new_f2.png' border='0' align='absmiddle' alt='acajoom guide' style='width: 26px; height: 26px;' hspace='6'>";
        } elseif ($GLOBALS[ACA . 'act_totalmailing0'] < 2 and $GLOBALS[ACA . 'mod_pub'] == 0) {
            acajoom::resetUpgrade();
            if ($GLOBALS[ACA . 'firstmailing'] == 2) {
                $guide .= '<strong><u>' . _ACA_STEP . '3</u></strong><br />';
                $guide .= _ACA_GUIDE_THRID_ACA_STEP_AUTOS;
                if ($GLOBALS[ACA . 'mod_pub'] == 0) {
                    $guide .= _ACA_GUIDE_MODULE;
                }
            } else {
                $guide .= '<strong><u>' . _ACA_STEP . '3</u></strong><br />';
                $guide .= _ACA_GUIDE_THRID_ACA_STEP_NEWS;
                if ($GLOBALS[ACA . 'mod_pub'] == 0) {
                    $guide .= _ACA_GUIDE_MODULE;
                }
                $guide .= _ACA_GUIDE_THRID2_ACA_STEP_NEWS;
                $guide .= "<img src='images/forward_f2.png' border='0' align='absmiddle' alt='acajoom guide' style='width: 26px; height: 26px;' hspace='6'>";
            }
        } elseif (($GLOBALS[ACA . 'mod_pub'] == 1 or $GLOBALS[ACA . 'act_totallist0'] > 1) and $GLOBALS[ACA . 'act_totalmailing0'] < 2) {
            if ($GLOBALS[ACA . 'firstmailing'] == 1) {
                $guide .= '<strong><u>' . _ACA_STEP . '4</u></strong><br />';
                if ($GLOBALS[ACA . 'listype2'] == 1) {
                    $guide .= _ACA_GUIDE_FOUR_ACA_STEP_NEWS . '<br />' . _ACA_GUIDE_THRID_ACA_STEP_AUTOS;
                }
            } else {
                $guide .= '<strong><u>' . _ACA_STEP . '4</u></strong><br />';
                $guide .= _ACA_GUIDE_FOUR_ACA_STEP_AUTOS . '<br />' . _ACA_GUIDE_THRID_ACA_STEP_NEWS;
            }
            $guide .= _ACA_GUIDE_FOUR_ACA_STEP;
        } else {
            $guide .= '<strong>' . _ACA_GUIDE_TURNOFF . '</strong>';
            $config = array();
            $config['show_guide'] = '0';
            $xf->saveConfig($config);
        }
        $guide .= '</fieldset></center></div>';
    }
    return $guide;
}
예제 #24
0
    function quickiconButton($link, $image, $text, $external = false, $accessLevel = '', $frontEnd = false)
    {
        if (acajoom::checkPermissions($accessLevel)) {
            if ($frontEnd and $GLOBALS[ACA . 'use_sef'] and function_exists('sefRelToAbs')) {
                $link = sefRelToAbs($link);
            }
            ?>
		<div style="float:left;">
			<div class="icon">
				<a href="<?php 
            echo $link;
            ?>
" <?php 
            if ($external) {
                echo 'target="_blank"';
            }
            ?>
>
				<?php 
            compa::showIcon($image, $text);
            ?>
					<span><?php 
            echo $text;
            ?>
</span>
				</a>
			</div>
		</div>
		<?php 
        }
    }
예제 #25
0
 function showType($listType, $screen)
 {
     switch ($screen) {
         case 'editmailing':
             if (class_exists($GLOBALS[ACA . 'classes' . $listType])) {
                 $view = new $GLOBALS[ACA . 'classes' . $listType]();
                 $show = $view->editmailing();
             } else {
                 $show['sender_info'] = true;
                 $show['published'] = true;
                 $show['pub_date'] = true;
                 $show['hide'] = true;
                 $show['issuenb'] = true;
                 $show['delay'] = false;
                 $show['htmlcontent'] = true;
                 $show['textcontent'] = true;
                 $show['attachement'] = true;
                 $show['images'] = true;
                 $show['sitecontent'] = true;
                 $show['admin'] = true;
             }
             break;
         case 'editlist':
             $show['access'] = $GLOBALS[ACA . 'type'] == 'PRO' ? true : false;
             if (class_exists($GLOBALS[ACA . 'classes' . $listType])) {
                 $view = new $GLOBALS[ACA . 'classes' . $listType]();
                 $show = array_merge($show, $view->editlist());
             } else {
                 $show['sender_info'] = true;
                 $show['hide'] = true;
                 $show['auto_option'] = true;
                 $show['htmlmailing'] = true;
                 $show['auto_subscribe'] = true;
                 $show['email_unsubcribe'] = false;
                 $show['unsusbcribe'] = false;
             }
             break;
         case 'showMailings':
             $show['admin'] = acajoom::checkPermissions('admin');
             $show['index'] = 'index2';
             $show['buttons'] = false;
             if ($show['admin']) {
                 if (class_exists($GLOBALS[ACA . 'classes' . $listType])) {
                     $view = new $GLOBALS[ACA . 'classes' . $listType]();
                     $show = array_merge($show, $view->showMailings());
                 } else {
                     $show['id'] = true;
                     $show['dropdown'] = true;
                     $show['select'] = true;
                     $show['issue'] = true;
                     $show['sentdate'] = true;
                     $show['delay'] = false;
                     $show['status'] = true;
                 }
             } else {
                 $show['id'] = false;
                 $show['dropdown'] = false;
                 $show['select'] = false;
                 $show['issue'] = true;
                 $show['sentdate'] = true;
                 $show['delay'] = false;
                 $show['status'] = false;
             }
             break;
         case 'showListsBack':
             if (acajoom::checkPermissions('admin')) {
                 $show['id'] = true;
             } else {
                 $show['id'] = false;
             }
             $show['index'] = 'index2';
             $show['select'] = true;
             $show['published'] = true;
             $show['sender'] = true;
             $show['sender_email'] = false;
             $show['mailings_link'] = true;
             $show['mailings_sub'] = true;
             $show['list_type'] = true;
             $show['visible'] = true;
             $show['buttons'] = false;
             $show['front'] = false;
             break;
         case 'showListsFront':
             if (acajoom::checkPermissions('admin')) {
                 $show['id'] = true;
                 $show['published'] = true;
                 $show['sender'] = true;
                 $show['sender_email'] = false;
                 $show['list_type'] = true;
                 $show['visible'] = true;
                 $show['mailings_sub'] = false;
                 $show['mailings_link'] = true;
                 $show['front'] = true;
             } else {
                 $show['id'] = false;
                 $show['published'] = false;
                 $show['sender'] = false;
                 $show['sender_email'] = false;
                 $show['list_type'] = false;
                 $show['visible'] = false;
                 $show['mailings_sub'] = false;
                 $show['mailings_link'] = false;
                 $show['front'] = true;
             }
             $show['index'] = 'index';
             $show['select'] = false;
             $show['buttons'] = true;
             break;
         default:
             $show = '';
             break;
     }
     return $show;
 }
예제 #26
0
    function create()
    {
        global $my, $mainframe;
        $Itemid = $GLOBALS[ACA . 'itemidAca'];
        if (!empty($Itemid)) {
            $item = '&Itemid=' . $Itemid;
        } else {
            $item = '';
        }
        $hidden = '';
        $htmlOK = false;
        $h = '';
        if (!empty($this->lists)) {
            if ($my->id > 0) {
                $loggedin = true;
                $subscriber = subscribers::getSubscriberInfoFromUserId($my->id);
            } else {
                $loggedin = false;
            }
            if (!$loggedin and $GLOBALS[ACA . 'allow_unregistered'] and $this->num == 1) {
                $h .= '
				<script language="javascript" type="text/javascript">
					function submitacajoommod(formname) {
						var form = eval(\'document.\'+formname);' . 'var place = form.email.value.indexOf("@",1);' . 'var point = form.email.value.indexOf(".",place+1);';
                if ($this->shownamefield) {
                    $h .= '
						if (form.name.value == "" || form.name.value == "' . addslashes(_ACA_NAME) . '") {
							alert( "' . addslashes(_ACA_REGWARN_NAME) . '" );' . 'return false;
						} else
				';
                }
                $h .= ' if (form.email.value == "" || form.email.value == "' . addslashes(_ACA_EMAIL) . '") {' . 'alert( "' . addslashes(_ACA_REGWARN_MAIL) . '" );' . 'return false;
						} else {' . 'if ((place > -1)&&(form.email.value.length >2)&&(point > 1)){' . 'form.submit();' . 'return true;
							} ' . 'else {' . 'alert( "' . addslashes(_ACA_REGWARN_MAIL) . '" );' . 'return false;' . '}' . '}' . '}' . '</script>';
            }
            mosCommonHTML::loadOverlib();
            $h .= '<link rel="stylesheet" href="' . $GLOBALS['mosConfig_live_site'] . '/components/com_acajoom/css/acajoom.css" type="text/css" >';
            $linkForm = 'index.php?option=com_acajoom';
            if ($GLOBALS[ACA . 'use_sef'] and function_exists('sefRelToAbs')) {
                $h .= '<form action="' . sefRelToAbs($linkForm) . '" method="post" name="modacajoomForm' . $this->num . '">
			<div class="' . $this->moduleclass_sfx . '" style="text-align:' . $this->mod_align . '">';
            } else {
                $h .= '<form action="' . $linkForm . '" method="post" name="modacajoomForm' . $this->num . '">
			<div class="' . $this->moduleclass_sfx . '" style="text-align:' . $this->mod_align . '">';
            }
            if (!empty($this->introtext)) {
                $text = '<span class="pretext' . $this->moduleclass_sfx . '">' . $this->introtext . '</span>';
                $h .= acajoom::printLine($this->linear, $text);
            }
            $i = 0;
            $accessLevel = 0;
            if ($loggedin) {
                $queues = queue::getSubscriberLists($subscriber->id);
            } else {
                $queues = '';
            }
            if ($this->showListName) {
                foreach ($this->lists as $list) {
                    $i++;
                    $subscribed = 0;
                    $accessLevel = 0;
                    if ($loggedin) {
                        if (!empty($queues)) {
                            foreach ($queues as $queue) {
                                if ($list->id == $queue->list_id) {
                                    $subscribed = 1;
                                    $accessLevel = $queue->acc_level;
                                }
                            }
                        }
                    }
                    if ($list->html == 1) {
                        $htmlOK = true;
                    }
                    $checked = 0;
                    if ($loggedin) {
                        $checked = $subscribed;
                    } else {
                        if ($this->defaultchecked) {
                            $checked = 1;
                        }
                        $subscriber->blacklist = 0;
                    }
                    if ($checked != 0) {
                        $checkedPrint = ' checked="checked" ';
                    } else {
                        $checkedPrint = '';
                    }
                    if ($list->hidden == 1) {
                        if ($subscriber->blacklist == 0) {
                            $text = "\n" . '<input id="wz_3' . $i . '" type="checkbox" class="inputbox" value="1" name="subscribed[' . $i . ']" ' . $checkedPrint . ' />';
                        } else {
                            $text = "\n" . '<input type="checkbox" class="inputbox" value="1" name="subscribedfake[' . $i . ']" ' . $checkedPrint . '  />';
                            $text .= "\n" . '<input type="hidden" value="0" name="subscribed[' . $i . ']"  />';
                        }
                        $text .= "\n" . '<input type="hidden" name="sub_list_id[' . $i . ']" value="' . $list->id . '" />';
                        $link = ($list->list_type == '1' or $list->list_type == '7') && $GLOBALS[ACA . 'show_archive'] ? 'index.php?option=com_acajoom' . $item . '&act=mailing&task=archive&listid=' . $list->id . '&listype=' . $list->list_type : '#';
                        $text .= "\n" . '<span class="aca_list_name"';
                        if ($link == "#") {
                            $text .= " onClick='return false;' ";
                        }
                        $text .= '>' . compa::toolTip($list->list_desc, $list->list_name, '', '', $list->list_name, $link, 1) . '</span>';
                        $h .= acajoom::printLine($this->linear, $text);
                        $h .= "\n" . '<input type="hidden" name="acc_level[' . $i . ']" value="' . $accessLevel . '" />' . "\n\r";
                    } else {
                        if (!$loggedin) {
                            $h .= '<input type="hidden"  value="' . $checked . '" name="subscribed[' . $i . ']" />';
                            $h .= "\n" . '<input type="hidden" name="sub_list_id[' . $i . ']" value="' . $list->id . '" />';
                        }
                    }
                }
            } else {
                foreach ($this->lists as $list) {
                    $i++;
                    $subscribed = 0;
                    $accessLevel = 0;
                    if ($loggedin) {
                        if (!empty($queues)) {
                            foreach ($queues as $queue) {
                                if ($list->id == $queue->list_id) {
                                    $subscribed = 1;
                                    $accessLevel = $queue->acc_level;
                                }
                            }
                        }
                    }
                    if ($list->html == 1) {
                        $htmlOK = true;
                    }
                    $checked = 0;
                    if ($loggedin) {
                        $checked = $subscribed;
                    } else {
                        if ($this->defaultchecked) {
                            $checked = 1;
                        }
                    }
                    $h .= '<input type="hidden"  value="' . $checked . '" name="subscribed[' . $i . ']" />';
                    $h .= "\n" . '<input type="hidden" name="sub_list_id[' . $i . ']" value="' . $list->id . '" />';
                    $h .= "\n" . '<input type="hidden" name="acc_level[' . $i . ']" value="' . $accessLevel . '" />';
                    if ($list->html == 1) {
                        $htmlOK = true;
                    }
                }
            }
            if (!$loggedin) {
                if ($GLOBALS[ACA . 'allow_unregistered']) {
                    if ($this->shownamefield) {
                        $text = '<input id="wz_11" type="text" size="' . $this->fieldsize . '" value="' . addslashes(_ACA_NAME) . '" class="inputbox" name="name" onblur="if(this.value==\'\') this.value=\'' . addslashes(_ACA_NAME) . '\';" onfocus="if(this.value==\'' . addslashes(_ACA_NAME) . '\') this.value=\'\' ; " />';
                        $h .= acajoom::printLine($this->linear, $text);
                    } else {
                        $text = '<input id="wz_11" type="hidden" value="" name="name" />';
                    }
                    $text = '<input id="wz_12" type="text" size="' . $this->fieldsize . '" value="' . addslashes(_ACA_EMAIL) . '" class="inputbox" name="email" onblur="if(this.value==\'\') this.value=\'' . addslashes(_ACA_EMAIL) . '\';" onfocus="if(this.value==\'' . addslashes(_ACA_EMAIL) . '\') this.value=\'\' ; " />';
                    $h .= acajoom::printLine($this->linear, $text);
                } else {
                    $h .= acajoom::printLine($this->linear, acajoom::printM('green', _ACA_REGISTER_REQUIRED));
                    $text = _NO_ACCOUNT . " ";
                    if (isset($GLOBALS[ACA . 'cb_integration']) && $GLOBALS[ACA . 'cb_integration']) {
                        $linkme = 'index.php?option=com_comprofiler&amp;task=registers';
                    } else {
                        $linkme = 'index.php?option=com_registration&amp;task=register';
                    }
                    if ($GLOBALS[ACA . 'use_sef'] and function_exists('sefRelToAbs')) {
                        $text .= '<a href="' . sefRelToAbs($linkme) . '">';
                    } else {
                        $text .= '<a href="' . $linkme . '">';
                    }
                    $text .= _CREATE_ACCOUNT . "</a>";
                    $h .= acajoom::printLine($this->linear, $text);
                    $htmlOK = false;
                }
            }
            if ($htmlOK) {
                if ($loggedin and !empty($subscriber)) {
                    $checked = $subscriber->receive_html;
                } else {
                    $checked = $this->receivehtmldefault;
                }
                if ($this->showreceivehtml) {
                    if ($checked != 0) {
                        $checkedPrint = ' checked="checked" ';
                    } else {
                        $checkedPrint = '';
                    }
                    $text = '<input id="wz_2" type="checkbox" class="inputbox" value="1" name="receive_html" ' . $checkedPrint . ' />';
                    $text .= ' ' . _ACA_RECEIVE_HTML;
                    $h .= acajoom::printLine($this->linear, $text);
                } else {
                    $hidden .= '<input id="wz_2" type="hidden" value="' . $checked . '" name="receive_html" />' . "\n";
                }
            } else {
                $hidden .= '<input id="wz_2" type="hidden" value="0" name="receive_html" />' . "\n";
            }
            if (!empty($this->posttext)) {
                $text = '<span class="postext' . $this->moduleclass_sfx . '">' . $this->posttext . '</span>';
                $h .= acajoom::printLine($this->linear, $text);
            }
            if (!$loggedin) {
                if ($GLOBALS[ACA . 'allow_unregistered']) {
                    if (isset($this->imgUnregistered)) {
                        $text = '<input id="aca_22" type="image" src="' . $this->imgUnregistered . '" value="' . $this->buttonUnregistered . '" alt="' . $this->buttonUnregistered . '" name="' . $this->buttonUnregistered . '" onclick="return submitacajoommod(\'modacajoomForm' . $this->num . '\');" />';
                    } else {
                        $text = '<input id="aca_22" type="button" value="' . $this->buttonUnregistered . '" class="button" name="' . $this->buttonUnregistered . '" onclick="return submitacajoommod(\'modacajoomForm' . $this->num . '\');" />';
                    }
                    $h .= acajoom::printLine($this->linear, $text);
                    $h .= '
					</div>
						<input type="hidden" name="act" value="subscribe" />
						<input type="hidden" name="redirectlink" value="' . $this->redirectURL . '" />
						<input type="hidden" name="listname" value="' . $this->showListName . '" />
					';
                } else {
                    $h .= '</div>';
                }
            } else {
                if (isset($this->notifType) and $subscribed) {
                    if (isset($this->imgUnregistered)) {
                        $text = '<input id="aca_22" type="image" src="' . $this->imgUnregistered . '" value="' . $this->buttonUnregistered . '" alt="' . $this->buttonUnregistered . '" name="' . $this->buttonUnregistered . '" onclick="return submitacajoommod(\'modacajoomForm' . $this->num . '\');" />';
                    } else {
                        $text = '<input id="aca_22" type="button" value="' . $this->buttonUnregistered . '" class="button" name="' . $this->buttonUnregistered . '" onclick="return submitacajoommod(\'modacajoomForm' . $this->num . '\');" />';
                    }
                    $h .= acajoom::printLine($this->linear, $text);
                    $h .= '
					</div>
						<input type="hidden" name="act" value="subscribe" />
						<input type="hidden" name="redirectlink" value="' . $this->redirectURL . '" />
						<input type="hidden" name="listname" value="' . $this->showListName . '" />
					';
                } else {
                    if (isset($this->imgRegistered)) {
                        $text = '<input id="aca_22" type="image" src="' . $this->imgRegistered . '" value="' . $this->buttonRegistered . '" alt="' . $this->buttonRegistered . '" name="' . $this->buttonRegistered . '">';
                    } else {
                        $text = '<input id="aca_22"  type="submit" value="' . $this->buttonRegistered . '" name="' . $this->buttonRegistered . '" class="button" />';
                    }
                    $h .= acajoom::printLine($this->linear, $text);
                    $h .= '
					</div>
						<input type="hidden" name="act" value="updatesubscription" />
						<input type="hidden" name="redirectlink" value="' . $this->redirectURL . '" />
						<input type="hidden" name="listname" value="' . $this->showListName . '" />
					';
                }
            }
            $h .= '<input type="hidden" name="Itemid" value="' . $Itemid . '" />';
            $h .= $hidden . '</form>';
        } else {
            $h .= acajoom::printM('blue', _ACA_LIST_NOT_AVAIL);
        }
        $this->_content = $h;
        return $h;
    }
예제 #27
0
    function subject($mailingEdit, $lists, $show)
    {
        ?>
	<fieldset class="acajoomcss">
	<legend><?php 
        echo _ACA_LIST_T_GENERAL;
        ?>
</legend>
	<table class="acajoomtable" cellspacing="1">
		<tbody>
		<tr>
			<td width="110px" class="key">
				<span class="editlinktip">
				<?php 
        $tip = _ACA_INFO_LIST_SUBJET;
        $title = _ACA_SUBJECT;
        echo compa::toolTip($tip, '', 280, 'tooltip.png', $title, '', 0);
        ?>
				</span>
			</td>
			<td>
			<?php 
        $text = str_replace('"', '&quot;', $mailingEdit->subject);
        if (function_exists('htmlspecialchars_decode')) {
            $text = htmlspecialchars_decode($text, ENT_NOQUOTES);
        } elseif (function_exists('html_entity_decode')) {
            $text = html_entity_decode($text, ENT_NOQUOTES);
        }
        echo ' <input type="text" name="subject" class="inputbox" size="50" maxlength="64" value="' . $text . '" />';
        ?>
			</td>
		</tr>
	<?php 
        if ($show['issuenb']) {
            ?>
		<tr>
			<td class="key">
				<span class="editlinktip">
				<?php 
            $tip = _ACA_ISSUE_NB_TIPS;
            $title = @constant($GLOBALS[ACA . 'listname' . $mailingEdit->list_type]) . ' #';
            echo compa::toolTip($tip, '', 280, 'tooltip.png', $title, '', 0);
            ?>
				</span>
			</td>
			<td>
			<?php 
            echo $mailingEdit->issue_nb;
            ?>
			</td>
		</tr>
	<?php 
        } else {
            echo '	<input type="hidden" name="issue_nb" value="' . $mailingEdit->issue_nb . '" />';
        }
        ?>
	<?php 
        if ($show['delay']) {
            ?>
			<tr>
				<td class="key">
					<span class="editlinktip">
					<?php 
            $tip = _ACA_INFO_LIST_DELAY;
            $title = _ACA_AUTO_DELAY;
            echo compa::toolTip($tip, '', 280, 'tooltip.png', $title, '', 0);
            ?>
					</span>
				</td>
				<td>
				<?php 
            $delay = $mailingEdit->delay / 1440;
            ?>
					<input type="text" name="delay" class="inputbox" size="5" maxlength="10" value="<?php 
            echo $delay;
            ?>
" />
				</td>
			</tr>
	<?php 
        }
        ?>
	<?php 
        if ($show['pub_date'] and $GLOBALS[ACA . 'listype2'] == '1' and class_exists('auto')) {
            ?>
		<tr>
			<td class="key">
				<span class="editlinktip">
				<?php 
            $tip = _ACA_INFO_LIST_DATE;
            $title = _ACA_LIST_DATE;
            $tip .= '<br/>(Actual server time is ' . acajoom::getNow() . ' )';
            echo compa::toolTip($tip, '', 280, 'tooltip.png', $title, '', 0);
            ?>
				</span>
			</td>
			<td>
				<input type="text" name="senddate" class="inputbox" size="25" maxlength="25" value="<?php 
            echo $mailingEdit->send_date;
            ?>
" />
			</td>
		</tr>
	<?php 
        }
        ?>
			<tr>
				<td class="key">
					<span class="editlinktip">
					<?php 
        $tip = '';
        $title = _ACA_LIST_NAME;
        echo compa::toolTip($tip, '', 280, 'tooltip.png', $title, '', 0);
        ?>
					</span>
				</td>
				<td>
				<?php 
        $name = lists::getLists($mailingEdit->list_id, 0, null, '', false, false, true);
        echo $name[0]->list_name;
        ?>
				</td>
			</tr>
		</tbody>
	</table>
	</fieldset>
	<?php 
    }
예제 #28
0
        $showMessage = mosGetParam($_REQUEST, 'listname', 0);
        if (!empty($redirectlink)) {
            if (!$showMessage) {
                $message = '';
            }
            compa::redirect($redirectlink, $message);
        } else {
            $showPanel = true;
        }
        break;
    case 'list':
        frontEnd::showLists($subscriberId, $listId, $lisType, $action, $task);
        break;
    case 'token':
        auto::receiveToken();
        break;
    default:
        if (class_exists('auto')) {
            $showPanel = auto::getCase($action);
        } else {
            $showPanel = true;
        }
        break;
}
echo $message;
if ($showPanel) {
    frontEnd::introduction($subscriberId, $listId, $lisType);
}
frontHTML::_footer();
echo "\n\r" . '<!--  End : ' . acajoom::version() . '   -->' . "\n\r";
예제 #29
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;
 }
예제 #30
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;
}