Пример #1
0
define('_ACA_JCALTAGS_START_TIPS', compa::encodeutf('Select Yes if you want to insert the start date of the event'));
define('_ACA_JCALTAGS_READMORE', compa::encodeutf('Read more:'));
define('_ACA_JCALTAGS_READMORE_TIPS', compa::encodeutf('Select Yes if you want to insert a <b>read more link</b> for this event'));
define('_ACA_REDIRECTCONFIRMATION', compa::encodeutf('Redirect URL'));
define('_ACA_REDIRECTCONFIRMATION_TIPS', compa::encodeutf('If you require a confirmation e-mail, the user will be confirmed and redirected to this URL if he clicks on the confirmation link.'));
//since 2.0.0 compatibility with Joomla 1.5
if (!defined('_CMN_SAVE') and defined('CMN_SAVE')) {
    define('_CMN_SAVE', CMN_SAVE);
}
if (!defined('_CMN_SAVE')) {
    define('_CMN_SAVE', 'Save');
}
if (!defined('_NO_ACCOUNT')) {
    define('_NO_ACCOUNT', 'No account yet?');
}
if (!defined('_CREATE_ACCOUNT')) {
    define('_CREATE_ACCOUNT', 'Register');
}
if (!defined('_NOT_AUTH')) {
    define('_NOT_AUTH', 'You are not authorised to view this resource.');
}
//since 3.0.0
define('_ACA_DISABLETOOLTIP', compa::encodeutf('Disable Tooltip'));
define('_ACA_DISABLETOOLTIP_TIPS', compa::encodeutf('Disable the tooltip on the frontend'));
define('_ACA_MINISENDMAIL', compa::encodeutf('Use Mini SendMail'));
define('_ACA_MINISENDMAIL_TIPS', compa::encodeutf('If your server use Mini SendMail, select this option to don\'t add the name of the user in the header of the e-mail'));
//Since 3.1.5
define('_ACA_READMORE', compa::encodeutf('Read more...'));
define('_ACA_VIEWARCHIVE', compa::encodeutf('Click here'));
//Acajoom GPL
define('_ACA_DESC_GPL', _ACA_DESC_NEWS);
Пример #2
0
 function import($listId)
 {
     $erro = new xerr(__FILE__, __FUNCTION__, __CLASS__);
     @set_time_limit(0);
     @ini_set('memory_limit', '128M');
     $queue = '';
     if (ACA_CMSTYPE) {
         // joomla 15
         $queue->sub_list_id = JRequest::getVar('sub_list_id', '');
         $queue->subscribed = JRequest::getVar('subscribed', '');
         $queue->acc_level = JRequest::getVar('acc_level', 29);
     } else {
         //joomla 1x
         $queue->sub_list_id = mosGetParam($_REQUEST, 'sub_list_id', '');
         $queue->subscribed = mosGetParam($_REQUEST, 'subscribed', '');
         $queue->acc_level = mosGetParam($_REQUEST, 'acc_level', 29);
     }
     //endif
     $path = ACA_JPATH_ROOT_NO_ADMIN . $GLOBALS[ACA . 'upload_url'];
     $filename = $_FILES['importfile']['name'];
     $path = str_replace(array('/', '\\'), DS, $path);
     if (is_writable($path)) {
         if (!@move_uploaded_file($_FILES['importfile']['tmp_name'], $path . $filename)) {
             $path .= DS;
             if (!@move_uploaded_file($_FILES['importfile']['tmp_name'], $path . $filename)) {
                 echo _ACA_ERROR_MOVING_UPLOAD;
                 echo '<br/>Please make sure the path ' . ACA_JPATH_ROOT_NO_ADMIN . $GLOBALS[ACA . 'upload_url'] . ' is writable';
             }
         }
         $import = file_get_contents($path . $filename);
         $import = str_replace(array("\r\n", "\r"), "\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 separated by a comma (,)');
                     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;
                         $values[0] = compa::encodeutf(trim($values[0]));
                         $subscriber->name = addslashes($values[0]);
                         $subscriber->email = $values[1];
                         $subscriber->receive_html = empty($values[2]) ? '0' : '1';
                         $subscriber->confirmed = (empty($values[3]) and !$GLOBALS[ACA . 'require_confirmation']) ? '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;
     }
 }
Пример #3
0
define('_ACA_JCALTAGS_START_TIPS', compa::encodeutf('Sélectionnez OUI si vous voulez que la date de début de l\'évènement soit ajoutée'));
define('_ACA_JCALTAGS_READMORE', compa::encodeutf('Lire la suite:'));
define('_ACA_JCALTAGS_READMORE_TIPS', compa::encodeutf('Sélectionnez OUI si vous voulez qu\'un lien pour lire la suite de de l\'évènement soit ajouté'));
define('_ACA_REDIRECTCONFIRMATION', compa::encodeutf('Redirect URL'));
define('_ACA_REDIRECTCONFIRMATION_TIPS', compa::encodeutf('If you require a confirmation courriel, the user will be confirmed and redirected to this URL if he clicks on the confirmation link.'));
//since 2.0.0 compatibility with Joomla 1.5
if (!defined('_CMN_SAVE') and defined('CMN_SAVE')) {
    define('_CMN_SAVE', CMN_SAVE);
}
if (!defined('_CMN_SAVE')) {
    define('_CMN_SAVE', 'Enregistrer');
}
if (!defined('_NO_ACCOUNT')) {
    define('_NO_ACCOUNT', 'Pas encore de compte&nbsp;?');
}
if (!defined('_CREATE_ACCOUNT')) {
    define('_CREATE_ACCOUNT', 'Enregistrez-vous');
}
if (!defined('_NOT_AUTH')) {
    define('_NOT_AUTH', 'Vous n\'êtes pas autorisé à voir cette ressource.');
}
//since 3.0.0
define('_ACA_DISABLETOOLTIP', compa::encodeutf('Disable Tooltip'));
define('_ACA_DISABLETOOLTIP_TIPS', compa::encodeutf('Disable the tooltip on the frontend'));
define('_ACA_MINISENDMAIL', compa::encodeutf('Use Mini SendCourriel'));
define('_ACA_MINISENDMAIL_TIPS', compa::encodeutf('If your server uses Mini SendCourriel, select this option to don\'t add the name of the user in the header of the courriel'));
//Since 3.1.5
define('_ACA_READMORE', compa::encodeutf('Lire la suite...'));
define('_ACA_VIEWARCHIVE', compa::encodeutf('Cliquez ici'));
//Acajoom GPL
define('_ACA_DESC_GPL', _ACA_DESC_NEWS);
Пример #4
0
function com_install()
{
    global $database;
    global $_VERSION;
    require_once $GLOBALS['mosConfig_absolute_path'] . '/components/com_acajoom/defines.php';
    require_once WPATH_ADMIN . 'config.acajoom.php';
    require_once WPATH_ADMIN . 'admin.acajoom.html.php';
    require_once WPATH_CLASS . 'class.acajoom.php';
    $update = new wupdate();
    $xf = new xonfig();
    $return = '';
    if (!is_writable($GLOBALS['mosConfig_absolute_path'] . $acajoomConfigFile['upload_url'])) {
        @chmod($GLOBALS['mosConfig_absolute_path'] . $acajoomConfigFile['upload_url'], 0777);
    }
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../administrator/components/com_acajoom/images/acajoom_icon.png'\n\t  WHERE admin_menu_link='option=com_acajoom'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/edit.png',\n\t  name='" . compa::encodeutf(_ACA_MENU_LIST) . "',\n\t  admin_menu_alt='" . _ACA_MENU_LIST . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=list'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/users_add.png' ,\n\t  name='" . compa::encodeutf(_ACA_MENU_SUBSCRIBERS) . "',\n\t  admin_menu_alt='" . _ACA_MENU_SUBSCRIBERS . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=subscribers'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/messaging_inbox.png' ,\n\t  name='" . compa::encodeutf(_ACA_MENU_NEWSLETTERS) . "',\n\t  admin_menu_alt='" . _ACA_MENU_NEWSLETTERS . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=mailing&listype=1'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/messaging_config.png' ,\n\t  name='" . compa::encodeutf(_ACA_MENU_AUTOS) . "',\n\t  admin_menu_alt='" . _ACA_MENU_AUTOS . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=mailing&listype=2'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/query.png' ,\n\t   name='" . compa::encodeutf(_ACA_MENU_STATS) . "',\n\t   admin_menu_alt='" . _ACA_MENU_STATS . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=statistics'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/menus.png' ,\n\t   name='" . compa::encodeutf(_ACA_MENU_CONF) . "',\n\t   admin_menu_alt='" . _ACA_MENU_CONF . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=configuration'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/restore.png' ,\n\t  name='" . compa::encodeutf(_ACA_MENU_UPDATE) . "',\n\t  admin_menu_alt='" . _ACA_MENU_UPDATE . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=update'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/credits.png' ,\n\t  name='" . compa::encodeutf(_ACA_MENU_ABOUT) . "',\n\t  admin_menu_alt='" . _ACA_MENU_ABOUT . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=about'";
    $q = " SELECT `text` FROM `#__acajoom_xonfig` WHERE `akey` = 'version' ";
    $database->setQuery($q);
    $vers = $database->loadResult();
    $err = $database->getErrorMsg();
    if (!empty($err)) {
        $q = " SELECT `text` FROM `#__acajoom_xonfig` WHERE `key` = 'version' ";
        $database->setQuery($q);
        $vers = $database->loadResult();
        if (!empty($vers) and $update->checkVersion($vers, '1.0.6')) {
            ### UPDATE database if before 1.0.7
            $query[] = "ALTER TABLE `#__acajoom_mailings` CHANGE `images` `images` TEXT NOT NULL ";
            $query[] = "ALTER TABLE `#__acajoom_lists` ADD `footer` TINYINT( 1 ) NOT NULL DEFAULT '1' ";
            $query[] = "ALTER TABLE `#__acajoom_lists` ADD `notify_id` INT( 10 ) NOT NULL DEFAULT '0' ";
            $query[] = "ALTER TABLE `#__acajoom_xonfig` DROP INDEX `key` ";
            $query[] = "ALTER TABLE `#__acajoom_xonfig` CHANGE `key` `akey` VARCHAR( 32 ) NOT NULL ";
            $query[] = "ALTER TABLE `#__acajoom_xonfig` CHANGE `value` `value` INT( 11 ) NOT NULL ";
            $query[] = "ALTER TABLE `#__acajoom_stats_global` DROP `listid`  ";
            $query[] = "ALTER TABLE `#__acajoom_stats_global` DROP INDEX `listid` ";
            $query[] = "ALTER TABLE `#__acajoom_stats_global` ADD PRIMARY KEY ( `mailing_id` ) ";
            $query[] = "ALTER TABLE `#__acajoom_stats_details` DROP `listid` ";
            $query[] = "ALTER TABLE `#__acajoom_stats_details` DROP INDEX `listid` ";
            $query[] = "ALTER TABLE `#__acajoom_stats_details` ADD PRIMARY KEY ( `mailing_id` , `subscriber_id` ) ";
            ### 1.0.9
            $query[] = " ALTER TABLE `#__acajoom_mailings` CHANGE `fromname` `fromname` VARCHAR( 64 ) NOT NULL  ";
            $query[] = " ALTER TABLE `#__acajoom_lists` CHANGE `sendername` `sendername` VARCHAR( 64 ) NOT NULL  ";
        }
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.0.8')) {
        $query[] = " ALTER TABLE `#__acajoom_mailings` CHANGE `fromname` `fromname` VARCHAR( 64 ) NOT NULL  ";
        $query[] = " ALTER TABLE `#__acajoom_lists` CHANGE `sendername` `sendername` VARCHAR( 64 ) NOT NULL  ";
        ### upgrade path for new versions
        $xf->insert('wait_for_user', '0', 0);
        $xf->insert('report_site', 'http://www.acajoom.com', 0);
        $xf->insert('use_sef', '0', 0);
        $xf->insert('send_error', '1', 0);
        $xf->insert('report_error', '1', 0);
        $xf->insert('wait_for_user', '0', 0);
        $xf->insert('show_archive', '1', 0);
        $xf->insert('update_notification', '1', 0);
        $xf->update('send_log_address', '@acajoom.com');
        $xf->update('update_url', 'http://www.acajoom.com/update/');
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.1.0')) {
        $query[] = "ALTER TABLE `#__acajoom_lists` ADD `notification` INT( 10 ) NOT NULL DEFAULT '0' ";
        $xf->update('listname1', '_ACA_NEWSLETTER');
        $xf->update('listnames1', '_ACA_MENU_NEWSLETTERS');
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.1.4')) {
        $xf->insert('last_sub_update', '', 0);
        $xf->insert('level', '1', 0);
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.3.0')) {
        $xf->insert('show_author', '0', 0);
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.5.5')) {
        $xf->insert('addEmailRedLink', '0', 0);
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.5.5')) {
        $query[] = " ALTER TABLE `#__acajoom_subscribers` ADD INDEX `subscribe_date` ( `subscribe_date` )   ";
        $query[] = " ALTER TABLE `#__acajoom_queue` CHANGE `subscriber_id` `subscriber_id` INT( 11 ) DEFAULT '0' NOT NULL  ";
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.6.4')) {
        $xf->insert('show_jcalpro', '0', 0);
        $xf->insert('redirectconfirm', '', 0);
        $xf->insert('itemidAca', '99', 0);
    }
    $query2 = "SHOW COLUMNS FROM `#__acajoom_lists` ";
    $database->setQuery($query2);
    $columns = $database->loadResultArray();
    if (!in_array('cat_id', $columns)) {
        $query[] = "ALTER TABLE `#__acajoom_lists` CHANGE `choose_time` `cat_id` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0'";
    }
    if (!in_array('next_date', $columns)) {
        $query[] = "ALTER TABLE `#__acajoom_lists` ADD `next_date` INT( 11 ) NOT NULL AFTER `notify_id` ";
    }
    if (!in_array('start_date', $columns)) {
        $query[] = "ALTER TABLE `#__acajoom_lists` ADD `start_date` DATE NOT NULL AFTER `next_date`";
    }
    $query[] = 'UPDATE `#__acajoom_lists` SET `acc_level` = 24 WHERE `acc_level` = 0';
    foreach ($acajoomConfigFile as $key => $val) {
        if (!isset($GLOBALS[ACA . $key])) {
            $xf->insert($key, $val, 0);
        }
    }
    if (!empty($vers) and $update->checkVersion($vers, '1.2.2')) {
        $query[] = "UPDATE `#__acajoom_lists` SET `acc_id` = '29' WHERE `acc_id` = '25' ";
    }
    if (!defined('WADMIN')) {
        define('WADMIN', 'administrator' . DS . 'components' . DS . 'com_acajoom' . DS);
    }
    if (!defined('WFRONT')) {
        define('WFRONT', 'components' . DS . 'com_acajoom' . DS);
    }
    $file[] = 'templates';
    $file[] = 'templates/default';
    $file[] = 'templates/index.html';
    $file[] = 'templates/default/default.html';
    $file[] = 'templates/default/tpl0_abovefooter.jpg';
    $file[] = 'templates/default/tpl0_powered_by.gif';
    $file[] = 'templates/default/tpl0_spacer.gif';
    $file[] = 'templates/default/tpl0_top_header.jpg';
    $file[] = 'templates/default/tpl0_underban.jpg';
    $file[] = 'templates/default/index.html';
    foreach ($file as $key5 => $ins) {
        if (!file_exists($GLOBALS['mosConfig_absolute_path'] . DS . WFRONT . $ins) && file_exists($GLOBALS['mosConfig_absolute_path'] . DS . WADMIN . $ins)) {
            @rename($GLOBALS['mosConfig_absolute_path'] . DS . WADMIN . $ins, $GLOBALS['mosConfig_absolute_path'] . DS . WFRONT . $ins);
        }
    }
    $size = sizeof($query);
    for ($index = 0; $index < $size; $index++) {
        $database->setQuery($query[$index]);
        $database->query();
    }
    if (empty($vers)) {
        $xf->filetoDatabase($acajoomConfigFile);
    }
    $return .= setupMaiOptions($acajoomConfigFile);
    $return .= installBots();
    $return .= installModule();
    if (acajoom::checkCB()) {
        $return .= installPlugin();
    }
    subscribers::updateSubscribers(true, true);
    require_once WPATH_ADMIN . 'version.php';
    $xf->update('component', $localVersion['component']);
    $xf->update('type', $localVersion['type']);
    $xf->update('version', $localVersion['version']);
    $xf->update('level', $localVersion['level']);
    $message = acajoom::printM('noimage', _ACA_THANKYOU);
    backHTML::_header(_ACA_MENU_INSTALL, 'install.png', $message, '', '');
    if ($acajoomConfigFile['type'] == 'PRO') {
        backHTML::about();
    } elseif ($acajoomConfigFile['type'] == 'Plus') {
        backHTML::installPRO();
    } else {
        backHTML::installPlus();
    }
    $link = 'index2.php?option=com_acajoom&act=start';
    echo '<table style="width: 100%; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="0" cellspacing="0"><tbody><tr>' . '<td style=" width: 140px;">&nbsp;</td><td style="text-align: center; vertical-align: middle; width: 140px;"><div id="cpanel">';
    backHTML::quickiconButton($link, 'inbox.png', _ACA_GET_STARTED, false, 'admin');
    echo '</div><td></td></td></tr></tbody></table>' . '<div style="clear:both;"></div>';
    echo '<br/><br/><br/><br/>';
    echo compa::encodeutf($return);
    return $return;
}