Пример #1
0
 /** Function for transferring the acajoom license to jnews
 */
 function acaTojnewsLicenseUpd()
 {
     // get acajoom license key
     $query = " SELECT `text` FROM `#__acajoom_xonfig` WHERE `akey` = 'license'";
     $license = jNews_TableUpdate::_getTableQuery($query, $loadAction = 'loadResult');
     if (!empty($license)) {
         // update license
         jNews_Config::insert('license', $license, 0, true);
         // validate
         if (class_exists('jNews_Auto')) {
             jNews_Auto::good();
         }
     } else {
         // no need to update if there are no license to be updated
         return false;
     }
     return true;
 }
Пример #2
0
function setupMaiOptions($data)
{
    $xf = new jNews_Config();
    $return = '<br />' . _JNEWS_INSTALL_CONFIG . ' : ';
    $config = array();
    $exist = jnews::checkExisting();
    if ($exist['news1'] == 0) {
        $config['news1'] = '0';
    }
    if ($exist['news2'] == 0) {
        $config['news2'] = '0';
    }
    if ($exist['news3'] == 0) {
        $config['news3'] = '0';
    }
    $conf = JFactory::getConfig();
    $config['emailmethod'] = $conf->get('config.mailer');
    $config['sendmail_path'] = $conf->get('config.sendmail');
    $config['sendmail_from'] = $conf->get('config.mailfrom');
    $config['sendmail_email'] = $conf->get('config.mailfrom');
    $config['sendmail_name'] = $conf->get('config.fromname');
    $config['smtp_host'] = $conf->get('config.smtphost');
    $config['smtp_auth_required'] = $conf->get('config.smtpauth');
    $config['smtp_secure'] = $conf->get('config.smtpsecure');
    $config['smtp_username'] = $conf->get('config.smtpuser');
    $config['smtp_password'] = $conf->get('config.smtppass');
    $config['confirm_fromname'] = $conf->get('config.fromname');
    $config['confirm_fromemail'] = $conf->get('config.mailfrom');
    //		$config['confirm_return'] = $conf->get('config.mailfrom');
    $config['max_queue'] = $conf->get('max_queue');
    $config['max_attempts'] = $conf->get('max_attempts');
    $config['date_update'] = jnews::getNow();
    for ($index = 0; $index < $data['nblist']; $index++) {
        $xf->insert('listname' . $index, '', 0);
        $xf->insert('listnames' . $index, '', 0);
        $xf->insert('listype' . $index, '', 0);
        $xf->insert('listshow' . $index, '', 0);
        $xf->insert('classes' . $index, '', 0);
        $xf->insert('listlogo' . $index, '', 0);
        $xf->insert('totallist' . $index, '', 0);
        $xf->insert('act_totallist' . $index, '', 0);
        $xf->insert('totalmailing' . $index, '', 0);
        $xf->insert('totalmailingsent' . $index, '', 0);
        $xf->insert('act_totalmailing' . $index, '', 0);
        $xf->insert('totalsubcribers' . $index, '', 0);
        $xf->insert('act_totalsubcribers' . $index, '', 0);
    }
    //line to be changed code #73099111
    $activeList = '1';
    $config['classes1'] = 'jNews_Newsletter';
    $config['classes2'] = 'jNews_Autoresponder';
    $config['classes7'] = 'jNews_Autonews';
    $xf->insert('activelist', $activeList, 0, true);
    $config['listype0'] = '1';
    $config['listname0'] = '';
    $config['listnames0'] = _JNEWS_MAILING_ALL;
    $config['listshow0'] = '1';
    $config['listlogo0'] = 'subscribers.png';
    $config['classes0'] = '';
    $config['listype1'] = '1';
    $config['listname1'] = '_JNEWS_NEWSLETTER';
    $config['listnames1'] = '_JNEWS_MENU_NEWSLETTERS';
    $config['listshow1'] = '1';
    $config['listlogo1'] = 'newsletter.png';
    $nb = explode(',', $activeList);
    $size = sizeof($nb);
    for ($k = 0; $k < $size; $k++) {
        $index = $nb[$k];
        if (class_exists($config['classes' . $index])) {
            $classConfig = new $config['classes' . $index]();
            $config = array_merge($config, $classConfig->getActive());
        }
    }
    if ($xf->saveConfig($config)) {
        jnews::displayInfo(_JNEWS_INSTALL_SUCCESS, 'success');
    } else {
        jnews::displayInfo('Configuration file not updated', 'error');
    }
}