print s('However, there is too little diskspace for this conversion') . '<br/>'; print s('Please do a manual conversion.') . ' ' . PageLinkButton('converttoutf8', s('Run manual conversion to UTF8')); print '</div>'; } } ## 2.11.7 and up Sql_Query(sprintf('alter table %s add column privileges text', $tables['admin']), 1); Sql_Query('alter table ' . $tables['list'] . ' add column category varchar(255) default ""', 1); Sql_Query('alter table ' . $tables['user_attribute'] . ' change column value value text'); Sql_Query('alter table ' . $tables['message'] . ' change column textmessage textmessage longtext'); Sql_Query('alter table ' . $tables['message'] . ' change column message message longtext'); Sql_Query('alter table ' . $tables['messagedata'] . ' change column data data longtext'); Sql_Query('alter table ' . $tables['bounce'] . ' add index statusidx (status(20))', 1); ## fetch the list of TLDs, if possible if (defined('TLD_AUTH_LIST')) { refreshTlds(true); } ## changed terminology Sql_Query(sprintf('update %s set status = "invalid email address" where status = "invalid email"', $tables['usermessage'])); ## for some reason there are some config entries marked non-editable, that should be include_once dirname(__FILE__) . '/defaultconfig.php'; foreach ($default_config as $configItem => $configDetails) { if (empty($configDetails['hidden'])) { Sql_Query(sprintf('update %s set editable = 1 where item = "%s"', $tables['config'], $configItem)); } else { Sql_Query(sprintf('update %s set editable = 0 where item = "%s"', $tables['config'], $configItem)); } } ## replace old header and footer with the new one ## but only if there are untouched from the default, which seems fairly common $oldPH = @file_get_contents(dirname(__FILE__) . '/ui/old_public_header.inc');
$upgrade_required = 0; $canUpgrade = checkAccess("upgrade"); if (Sql_Table_exists($tables["config"], 1)) { $dbversion = getConfig("version"); if ($dbversion != VERSION && $canUpgrade) { Error($GLOBALS['I18N']->get('Your database is out of date, please make sure to upgrade') . '<br/>' . $GLOBALS['I18N']->get('Your version') . ' : ' . $dbversion . '<br/>' . $GLOBALS['I18N']->get('phplist version') . ' : ' . VERSION . '<br/>' . PageLink2("upgrade", $GLOBALS['I18N']->get('Upgrade'))); $upgrade_required = 1; } } else { Info($GLOBALS['I18N']->get('Database has not been initialised') . '. ' . $GLOBALS['I18N']->get('go to') . ' ' . PageLink2("initialise&firstinstall=1", $GLOBALS['I18N']->get('Initialise Database')) . ' ' . $GLOBALS['I18N']->get('to continue'), 1); $GLOBALS["firsttime"] = 1; $_SESSION["firstinstall"] = 1; return; } ## trigger this somewhere else? refreshTlds(); # check for latest version $checkinterval = sprintf('%d', getConfig("check_new_version")); if (!isset($checkinterval)) { $checkinterval = 7; } $showUpdateAvail = !empty($_GET['showupdate']); ## just to check the design $thisversion = VERSION; $thisversion = preg_replace("/[^\\.\\d]/", "", $thisversion); $latestversion = getConfig('updateavailable'); $showUpdateAvail = $showUpdateAvail || !empty($latestversion) && !versionCompare($thisversion, $latestversion); if (!$showUpdateAvail && $checkinterval) { ##https://mantis.phplist.com/view.php?id=16815 $query = sprintf('select date_add(value, interval %d day) < now() as needscheck from %s where item = "updatelastcheck"', $checkinterval, $tables["config"]); $needscheck = Sql_Fetch_Row_Query($query);