Project

General

Profile

« Previous | Next » 

Revision 1973

Added by darkviper about 11 years ago

/update-script.php last correction for loading PasswordHash packet and Typo fix line 87
/admin/pages/PageTree // SmallRawPageTree : adaption of Translate and WbAdapter

View differences:

upgrade-script.php
34 34
 * @deprecated   
35 35
 * @description  xyz
36 36
 */
37
if(!class_exists('PasswordHash', false))
37
// --- delete fatal disturbing files before upgrade starts -------------------------------
38
$aPreDeleteFiles = array(
39
// list of files
40
	dirname(__FILE__).'/framework/PasswordHash.php'
41
);
42
if(sizeof($aPreDeleteFiles > 0))
38 43
{
39
	include(dirname(__FILE__).'/framework/PasswordHashInterface.php');
40
	include(dirname(__FILE__).'/include/phpass/PasswordHash.php');
44
// if there are files defined
45
	$sMsg = '';
46
	foreach($aPreDeleteFiles as $sFileToDelete)
47
	{
48
	// iterate the list
49
		if(file_exists($sFileToDelete))
50
		{
51
			if(!is_writeable($sFileToDelete) || !@unlink($sFileToDelete))
52
			{
53
			// notice if deleting fails
54
				$sMsg .= '<span style="color:red;">FAILED</span> deleting: '
55
				       . $sFileToDelete.'<br />'.PHP_EOL;
56
			}
57
		}
58
	}
59
	if($sMsg) {
60
	// stop script if there's an error occured
61
		$sMsg = 'Fatal error occured during initial startup.<br /><br />'.PHP_EOL.$sMsg
62
		      . '<br />'.PHP_EOL.'Please delete all of the files above manually and '
63
		      . 'then <a href="http://'.$_SERVER["HTTP_HOST"].$_SERVER["SCRIPT_NAME"].'" '
64
		      . 'title="restart">klick here to restart the upgrade-script</a>.<br />'.PHP_EOL;
65
		die($sMsg);
66
	}
41 67
}
68
unset($aPreDeleteFiles);
69
$sMsg = '';
70
// ---------------------------------------------------------------------------------------
42 71
// Include config file
43 72
$config_file = dirname(__FILE__).'/config.php';
44 73
if(file_exists($config_file) && !defined('WB_URL'))
......
55 84
      . 'WHERE `name`=\'pages_directory\'';
56 85
$sPagesDirectory = WbDatabase::getInstance()->get_one($sql);
57 86
$sTmp = trim($sPagesDirectory, '/');
58
$sTmp = ($sTmp == '' ? '' : '/'.$sTmp);
87
$sTmpDir = ($sTmp == '' ? '' : '/'.$sTmp);
59 88
if($sTmp != $sPagesDirectory) {
60 89
	$sql = 'UPDATE `'.TABLE_PREFIX.'settings` '
61 90
		 . 'SET `value` = \''.$sTmpDir.'\' '

Also available in: Unified diff