Project

General

Profile

« Previous | Next » 

Revision 1525

Added by Dietmar about 13 years ago

fix versions compare upgrade from WB version 2.7

View differences:

branches/2.8.x/CHANGELOG
13 13
=========================== add small Features 2.8.2 ==========================
14 14

  
15 15
----------------------------------- Fixes 2.8.2 --------------------------------
16
15 Nov-2011 Build 1525 Dietmar Woellbrink (Luisehahne)
17
# fix versions compare upgrade from WB version 2.7
16 18
13 Nov-2011 Build 1524 Dietmar Woellbrink (Luisehahne)
17 19
! fix secureform was not updated
18 20
13 Nov-2011 Build 1523 Dietmar Woellbrink (Luisehahne)
branches/2.8.x/wb/upgrade-script.php
4 4
 * @category        backend
5 5
 * @package         installation
6 6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8 7
 * @copyright       2009-2011, Website Baker Org. e.V.
9 8
 * @link			http://www.websitebaker2.org/
10 9
 * @license         http://www.gnu.org/licenses/gpl.html
......
50 49
$FAIL          = ' <span class="error">FAILED</span> ';
51 50
$DEFAULT_THEME = 'wb_theme';
52 51

  
53
$files2remove = array(
54

  
55
			'[ADMIN]/preferences/details.php',
56
			'[ADMIN]/preferences/email.php',
57
			'[ADMIN]/preferences/password.php',
52
$dir2remove = array(
58 53
/*
59 54
			'[TEMPLATE]/allcss/',
60 55
			'[TEMPLATE]/blank/',
......
63 58
*/
64 59
		 );
65 60

  
61
$files2remove = array(
66 62

  
63
			'[ADMIN]/preferences/details.php',
64
			'[ADMIN]/preferences/email.php',
65
			'[ADMIN]/preferences/password.php',
66

  
67
		 );
68

  
69

  
67 70
// analyze/check database tables
68 71
function mysqlCheckTables( $dbName )
69 72
{
......
196 199
<img src="templates/wb_theme/images/logo.png" alt="WebsiteBaker Project" />
197 200
<h1>WebsiteBaker Upgrade</h1>
198 201
<?php
199
	if( version_compare( WB_VERSION, '2.7.0', '<' )) {
200
		status_msg('<strong>Warning:</strong><br />It is not possible to upgrade from WebsiteBaker Versions before 2.7.0.<br />For upgrading to version '.VERSION.' you must upgrade first to v.2.7.0 at least!!!', 'warning', 'div');
202
	if( version_compare( WB_VERSION, '2.7', '<' )) {
203
		status_msg('<strong>Warning:</strong><br />It is not possible to upgrade from WebsiteBaker Versions before 2.7.0.<br />For upgrading to version '.VERSION.' you must upgrade first to v.2.7 at least!!!', 'warning', 'div');
201 204
		echo '<br /><br />';
202 205
		echo "</div>
203 206
		</body>
......
391 394
echo "<br />Adding field redirect_type to mod_menu_link table<br />";
392 395
db_add_field('redirect_type', 'mod_menu_link', "INT NOT NULL DEFAULT '302' AFTER `target_page_id`");
393 396

  
394
if (version_compare(WB_VERSION, '2.8.0') < 0)
397
if (version_compare(WB_VERSION, '2.8') < 0)
395 398
{
396 399
    /**********************************************************
397 400
     *  - Update search no results database filed to create
......
560 563
	$searches = array(
561 564
		'[ADMIN]',
562 565
		'[MEDIA]',
563
		'[PAGES]'
566
		'[PAGES]',
567
		'[TEMPLATE]'
564 568
	);
565 569
	$replacements = array(
566
		substr(ADMIN_PATH, strlen(WB_PATH)),
570
		substr(ADMIN_PATH, strlen(WB_PATH)+1),
567 571
		MEDIA_DIRECTORY,
568
		PAGES_DIRECTORY
572
		PAGES_DIRECTORY,
573
		'/templates',
569 574
	);
570 575

  
571 576
	$msg = '';
......
588 593
			    can not be removed automatically.<br /><br />Please delete them
589 594
				using FTP and restart upgrade-script!<br /><br />'.$msg;
590 595
        status_msg($msg, 'error warning', 'div');
591
		echo '<br /><br /></div></body></html>';
596
		echo '<br /><br /><br /><br /></div></body></html>';
592 597
		exit();
593 598
	}
594 599
/**********************************************************
600
 * - check for deprecated / never needed files
601
 */
602
?>
603
<h2>Step 4: Remove deprecated and old Templates</h2>
604
<?php
605

  
606
	$searches = array(
607
		'[ADMIN]',
608
		'[MEDIA]',
609
		'[PAGES]',
610
		'[TEMPLATE]'
611
	);
612
	$replacements = array(
613
		substr(ADMIN_PATH, strlen(WB_PATH)+1),
614
		MEDIA_DIRECTORY,
615
		PAGES_DIRECTORY,
616
		'/templates',
617
	);
618

  
619
	$msg = '';
620
	foreach( $dir2remove as $dir )
621
	{
622
		$dir = str_replace($searches, $replacements, $dir);
623
		$dir = WB_PATH.'/'.$dir;
624
		if( is_dir( $dir ))
625
		{ // try to delete dir
626
			if(!rm_full_dir($dir))
627
			{ // save in err-list, if failed
628
				$msg .= $dir.'<br />';
629
			}
630
		}
631
	}
632
	if($msg != '')
633
	{
634
		$msg = 'Following directories are deprecated, outdated or a security risk and
635
			    can not be removed automatically.<br /><br />Please delete them
636
				using FTP!<br /><br />'.$msg;
637
        status_msg($msg, 'error warning', 'div');
638
		echo '<br /><br /><br /><br /></div>';
639
	}
640
/**********************************************************
595 641
 *  - Reload all addons
596 642
 */
597 643

  
branches/2.8.x/wb/admin/interface/version.php
52 52

  
53 53
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
54 54
if(!defined('VERSION')) define('VERSION', '2.8.2');
55
if(!defined('REVISION')) define('REVISION', '1524');
55
if(!defined('REVISION')) define('REVISION', '1525');

Also available in: Unified diff