Changeset 2838 for trunk/install


Ignore:
Timestamp:
Nov 7, 2008, 2:54:35 PM (15 years ago)
Author:
patdenice
Message:
  • improve 1.3.1 upgrade (automatic write in mysql.inc.php).
  • translate 1.3.1 upgrade informations messages.
  • security fix in upgrade login.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/install/upgrade_1.3.1.php

    r2836 r2838  
    579579}
    580580
     581// load the config file
     582$config_file = PHPWG_ROOT_PATH.'include/mysql.inc.php';
     583$config_file_contents = @file_get_contents($config_file);
     584if ($config_file_contents === false)
     585{
     586  die('CANNOT LOAD '.$config_file);
     587}
     588$php_end_tag = strrpos($config_file_contents, '?'.'>');
     589if ($php_end_tag === false)
     590{
     591  die('CANNOT FIND PHP END TAG IN '.$config_file);
     592}
     593if (!is_writable($config_file))
     594{
     595  die('FILE NOT WRITABLE '.$config_file);
     596}
     597
     598// Insert define('PHPWG_INSTALLED', true); in mysql.inc.php
     599$config_file_contents =
     600    substr($config_file_contents, 0, $php_end_tag).'
     601define(\'PHPWG_INSTALLED\', true);
     602'.substr($config_file_contents, $php_end_tag);
     603
     604$fp = @fopen( $config_file, 'w' );
     605@fputs($fp, $config_file_contents, strlen($config_file_contents));
     606@fclose($fp);
     607
     608// Send infos
    581609$page['infos'] = array_merge(
    582610  $page['infos'],
    583611  array(
    584     'all sub-categories of private categories become private',
    585 
    586     'user permissions and group permissions have been erased',
    587 
    588     'only thumbnails prefix and webmaster mail address have been saved from
    589 previous configuration',
    590 
    591     'in include/mysql.inc.php, before
    592 <pre style="background-color:lightgray">?&gt;</pre>
    593 insert
    594 <pre style="background-color:lightgray">define(\'PHPWG_INSTALLED\', true);</pre>'
     612    l10n('all sub-categories of private categories become private'),
     613    l10n('user permissions and group permissions have been erased'),
     614    l10n('only thumbnails prefix and webmaster mail saved')
    595615    )
    596616  );
    597 
    598617
    599618// now we upgrade from 1.4.0
Note: See TracChangeset for help on using the changeset viewer.