Project

General

Profile

« Previous | Next » 

Revision 1484

Added by Luisehahne over 13 years ago

move fixes 2.8.2 to 2.8.3
fixes will be shown in an extra readme
an package with the fixed files will be created
for all users who downloaded the 2.8.2 before 29 Jul-2011

View differences:

branches/2.8.x/CHANGELOG
11 11
! = Update/Change
12 12

  
13 13
=============================== FEATURES FREEZE ================================
14
------------------------------------- 2.8.3 ------------------------------------
15
31 Jul-2011 Build 1484 Dietmar Woellbrink (Luisehahne)
16
! move fixes 2.8.2 to 2.8.3
17
! fixes will be shown in an extra readme
18
! an package with the fixed files will be created
19
! for all users who downloaded the 2.8.2 before 29 Jul-2011
14 20
------------------------------------- 2.8.2 ------------------------------------
15 21
25 Jul-2011 Build 1480 Dietmar Woellbrink (Luisehahne)
16 22
! Changed version to 2.8.2
branches/2.8.x/wb/config.php
1
<?php
2 0

  
branches/2.8.x/wb/upgrade-script.php
18 18

  
19 19
@require_once('config.php');
20 20

  
21
// this function checks the basic configurations of an existing WB intallation
22
function status_msg($message, $class='check', $element='span') {
21
require_once(WB_PATH.'/framework/functions.php');
22
require_once(WB_PATH.'/framework/class.admin.php');
23
$admin = new admin('Addons', 'modules', false, false);
24

  
25
/* display a status message on the screen **************************************
26
 * @param string $message: the message to show
27
 * @param string $class:   kind of message as a css-class
28
 * @param string $element: witch HTML-tag use to cover the message
29
 * @return void
30
 */
31
function status_msg($message, $class='check', $element='span')
32
{
23 33
	// returns a status message
24
	echo '<'.$element .' class="' .$class .'">' .$message .'</' .$element.'>';
34
	$msg  = '<'.$element.' class="'.$class.'">';
35
	$msg .= '<strong>'.strtoupper(strtok($class, ' ')).'</strong><br />';
36
	$msg .= $message.'</'.$element.'>';
37
	echo $msg;
25 38
}
26 39

  
27 40
// database tables including in WB package
......
33 46
    'mod_output_filter','mod_wrapper','mod_wysiwyg'
34 47
);
35 48

  
49
$OK            = ' <span class="ok">OK</span> ';
50
$FAIL          = ' <span class="error">FAILED</span> ';
51
$DEFAULT_THEME = 'wb_theme';
52

  
53
$files2remove = array(
54

  
55
			'[ADMIN]/preferences/details.php',
56
			'[ADMIN]/preferences/email.php',
57
			'[ADMIN]/preferences/password.php',
58
/*
59
			'[TEMPLATE]/allcss/',
60
			'[TEMPLATE]/blank/',
61
			'[TEMPLATE]/round/',
62
			'[TEMPLATE]/simple/',
63
*/
64
		 );
65

  
66

  
36 67
// analyze/check database tables
37 68
function mysqlCheckTables( $dbName )
38 69
{
......
63 94
            $x++;
64 95
        }
65 96
    }
66

  
67

  
68

  
69

  
70 97
    return $data;
71 98
}
72 99

  
73

  
74 100
// check existings tables for upgrade or install
75 101
function check_wb_tables()
76 102
{
......
99 125
// check existing tables
100 126
$all_tables = check_wb_tables();
101 127

  
102
// only for array tests
103
function show_array($array=array())
104
{
105
    print '<pre>';
106
    print_r ($array);
107
    print '</pre>';
108
}
109

  
110
require_once(WB_PATH.'/framework/functions.php');
111
require_once(WB_PATH.'/framework/class.admin.php');
112
$admin = new admin('Addons', 'modules', false, false);
113 128
?>
114 129
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
115 130
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
......
218 233
	exit();
219 234
}
220 235
echo '<h2>Step 2: Updating database entries</h2>';
221
$OK   = '<span class="ok">OK</span>';
222
$FAIL = '<span class="error">FAILED</span>';
223 236

  
224 237
// function to add a var/value-pair into settings-table
225 238
function db_add_key_value($key, $value) {
......
267 280
 *  - Adding field default_theme to settings table
268 281
 */
269 282
echo "<br />Adding default_theme to settings table<br />";
283
db_update_key_value('settings', 'default_theme', $DEFAULT_THEME);
284
/*
270 285
$cfg = array(
271 286
	'default_theme' => 'wb_theme'
272 287
);
273

  
274 288
foreach($cfg as $key=>$value) {
275 289
	db_add_key_value($key, $value);
276 290
}
277

  
291
*/
278 292
/**********************************************************
279 293
 *  - install droplets
280 294
 */
......
351 365
echo "<br />Adding mediasettings to settings table<br />";
352 366
$cfg = array(
353 367
	'mediasettings' => '',
354
	'rename_files_on_upload' => 'ph.*?,cgi,pl,pm,exe,com,bat,pif,cmd,src,asp,aspx'
368
	'rename_files_on_upload' => 'ph.*?,cgi,pl,pm,exe,com,bat,pif,cmd,src,asp,aspx,js'
355 369
);
370
db_update_key_value('settings', 'rename_files_on_upload', $cfg['rename_files_on_upload']);
371

  
356 372
foreach($cfg as $key=>$value) {
357 373
	db_add_key_value($key, $value);
358 374
}
......
505 521
 * upgrade media folder index protect files
506 522
 */
507 523
$dir = (WB_PATH.MEDIA_DIRECTORY);
508
echo '<h4>Upgrade '.MEDIA_DIRECTORY.'/ index.php protect files</h4>';
524
echo '<h4>Upgrade '.MEDIA_DIRECTORY.'/ index.php protect files</h4><br />';
509 525
$array = rebuildFolderProtectFile($dir);
510 526
if( sizeof( $array ) ){
511
	print 'Upgrade '.MEDIA_DIRECTORY.'/ index.php protect files'." $OK<br />";
527
	print '<br /><strong>Upgrade '.sizeof( $array ).' '.MEDIA_DIRECTORY.'/ protect files</strong>'." $OK<br />";
512 528
} else {
513
	print 'Upgrade '.MEDIA_DIRECTORY.'/ index.php protect files'." $FAIL!<br />";
529
	print '<br /><strong>Upgrade '.MEDIA_DIRECTORY.'/ protect files</strong>'." $FAIL!<br />";
514 530
	print implode ('<br />',$array);
515 531
}
516 532

  
......
531 547
 *  - Set Version to new Version
532 548
 */
533 549
echo '<br />Update database version number to '.VERSION.' : ';
534
echo ($database->query("UPDATE `".TABLE_PREFIX."settings` SET `value`='".VERSION."' WHERE `name` = 'wb_version'")) ? " $OK<br />" : " $FAIL<br />";
550
// echo ($database->query("UPDATE `".TABLE_PREFIX."settings` SET `value`='".VERSION."' WHERE `name` = 'wb_version'")) ? " $OK<br />" : " $FAIL<br />";
551
db_update_key_value('settings', 'wb_version', VERSION);
535 552

  
553
/* *****************************************************************************
554
 * - check for deprecated / never needed files
555
 */
556
?>
557
<h2>Step 3: Remove deprecated and old files</h2>
558
<?php
559

  
560
	$searches = array(
561
		'[ADMIN]',
562
		'[MEDIA]',
563
		'[PAGES]'
564
	);
565
	$replacements = array(
566
		substr(ADMIN_PATH, strlen(WB_PATH)),
567
		MEDIA_DIRECTORY,
568
		PAGES_DIRECTORY
569
	);
570

  
571
	$msg = '';
572
	foreach( $files2remove as $file )
573
	{
574
		$file = str_replace($searches, $replacements, $file);
575
		$file = WB_PATH.'/'.$file;
576
		if( file_exists( $file ))
577
		{ // try to unlink file
578
			if(!unlink($file))
579
			{ // save in err-list, if failed
580
				$msg .= $file.'<br />';
581
			}
582
		}
583
	}
584

  
585
	if($msg != '')
586
	{
587
		$msg = 'Following files are deprecated, outdated or a security risk and
588
			    can not be removed automatically.<br /><br />Please delete them
589
				using FTP and restart upgrade-script!<br /><br />'.$msg;
590
        status_msg($msg, 'error warning', 'div');
591
		echo '<br /><br /></div></body></html>';
592
		exit();
593
	}
536 594
/**********************************************************
537 595
 *  - Reload all addons
538 596
 */
......
544 602
	while(false !== ($file = readdir($handle))) {
545 603
		if($file != '' AND substr($file, 0, 1) != '.' AND $file != 'admin.php' AND $file != 'index.php') {
546 604
			load_module(WB_PATH.'/modules/'.$file );
547
			upgrade_module($file, true);
605
		   // 	upgrade_module($file, true);
548 606
		}
549 607
	}
550 608
	closedir($handle);
......
584 642

  
585 643
// require(WB_PATH.'/framework/initialize.php');
586 644

  
587
if(!defined('DEFAULT_THEME')) { define('DEFAULT_THEME', 'wb_theme'); }
645
if(!defined('DEFAULT_THEME')) { define('DEFAULT_THEME', $DEFAULT_THEME); }
588 646
if(!defined('THEME_PATH')) { define('THEME_PATH', WB_PATH.'/templates/'.DEFAULT_THEME);}
589 647

  
590 648
echo '<p style="font-size:120%;"><strong>Congratulations: The upgrade script is finished ...</strong></p>';
branches/2.8.x/wb/config.php.bak
1
<?php
0 2

  
branches/2.8.x/wb/admin/media/upload.php
86 86
		$info = pathinfo($filename);
87 87
		$ext = isset($info['extension']) ? $info['extension'] : '';
88 88

  
89
		if ( ($filename != '') && !preg_match("/\." . $forbidden_file_types . "$/i", $ext) )
89
		if ( ($filename != '') && !preg_match("/" . $forbidden_file_types . "$/i", $ext) )
90 90
		{
91 91
			// Move to relative path (in media folder)
92 92
			if(file_exists($relative.$filename) AND $overwrite == true) {
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', '1480');
55
if(!defined('REVISION')) define('REVISION', '1484');
branches/2.8.x/wb/admin/users/index.php
30 30

  
31 31
// Get existing value from database
32 32
// $database = new database();
33
$query = "SELECT user_id, username, display_name FROM ".TABLE_PREFIX."users WHERE user_id != '1' ORDER BY display_name,username";
33
$query = "SELECT user_id, username, display_name, active FROM ".TABLE_PREFIX."users WHERE user_id != '1' ORDER BY display_name,username";
34 34
$results = $database->query($query);
35 35
if($database->is_error()) {
36 36
	$admin->print_error($database->get_error(), 'index.php');
......
42 42
	// Insert first value to say please select
43 43
	$template->set_var('VALUE', '');
44 44
	$template->set_var('NAME', $TEXT['PLEASE_SELECT'].'...');
45
	$template->set_var('STATUS', 'text-decoration :none;' );
45 46
	$template->parse('list', 'list_block', true);
46 47
	// Loop through users
47 48
	while($user = $results->fetchRow()) {
branches/2.8.x/wb/framework/functions.php
707 707
{
708 708
	global $admin, $MESSAGE;
709 709
	$retVal = array();
710
    if( ($sAbsDir=='') || ($sAbsDir == WB_PATH) ) { return $retVal;}
710
	$wb_path = rtrim(str_replace('\/\\', '/', WB_PATH), '/');
711
    if( ($sAbsDir=='') || ($sAbsDir == $wb_path) ) { return $retVal;}
711 712

  
712 713
	if ( $make_dir==true ) {
713 714
		// Check to see if the folder already exists
......
727 728
	{
728 729
        // if(file_exists($sAbsDir.'/index.php')) { unlink($sAbsDir.'/index.php'); }
729 730
	    // Create default "index.php" file
730
		$rel_pages_dir = str_replace(WB_PATH, '', dirname($sAbsDir) );
731
		$rel_pages_dir = str_replace($wb_path, '', dirname($sAbsDir) );
731 732
		$step_back = str_repeat( '../', substr_count($rel_pages_dir, '/')+1 );
732 733

  
733 734
		$sResponse  = $_SERVER['SERVER_PROTOCOL'].' 301 Moved Permanently';
......
742 743
			"\t".'header(\'Location: '.WB_URL.'/index.php\');'."\n".
743 744
			'// *************************************************'."\n";
744 745
		$filename = $sAbsDir.'/index.php';
746

  
745 747
		// write content into file
746
		if ($handle = fopen($filename, 'w')) {
747
			fwrite($handle, $content);
748
			fclose($handle);
749
			change_mode($filename, 'file');
748
		if(is_writable($filename)) {
749
		    if(file_put_contents($filename, $content)) {
750
				print 'create => '.str_replace( $wb_path,'',$filename).'<br />';
751
		        change_mode($filename, 'file');
752
		    }
750 753
		}
751
		// $admin->print_success($MESSAGE['MEDIA']['DIR_MADE']);
752 754
	} else {
753
		// $admin->print_error($MESSAGE['GENERIC_BAD_PERMISSIONS']);
754 755
			$retVal[] = $MESSAGE['GENERIC_BAD_PERMISSIONS'];
755 756
	}
756 757
	return $retVal;
757 758
}
758 759

  
759
// Rebuild new protected files in the given directory and subs
760 760
function rebuildFolderProtectFile($dir='')
761 761
{
762
	$retVal = array();
762
 $retVal = array();
763
 $dir = rtrim(str_replace('\/\\', '/', $dir), '/');
763 764
    try {
764
		$iterator = new RecursiveDirectoryIterator($dir);
765
		foreach (new RecursiveIteratorIterator($iterator, RecursiveIteratorIterator::SELF_FIRST) as $file)
766
		{
767
		  if ($file->isDir()) {
768
		     $protect_file = ($file->getPathname());
769
		     $retVal[] = createFolderProtectFile($protect_file,false);
770
		  } else {
771
		     // print ($file->getPathname())."<br />";
772
		  }
773
		}
774
	} catch ( Exception $e ) {
775
		$retVal[] = $MESSAGE['MEDIA_DIR_ACCESS_DENIED'];
776
	}
777

  
778
    $retVal = array_merge($retVal);
779
	return $retVal;
765
  $files = array();
766
  $files[] = $dir;
767
  foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir)) as $fileInfo){
768
   $files[] = $fileInfo->getPath();
769
  }
770
  $files = array_unique($files);
771
  foreach( $files as $file){
772
   $protect_file = rtrim(str_replace('\/\\', '/', $file), '/');
773
   $retVal[] = createFolderProtectFile($protect_file,false);
774
  }
775
 } catch ( Exception $e ) {
776
  $retVal[] = $MESSAGE['MEDIA_DIR_ACCESS_DENIED'];
777
 }
778
 return $retVal;
780 779
}
781 780

  
782 781
// Create a new file in the pages directory
branches/2.8.x/wb/modules/SecureFormSwitcher/upgrade.php
3 3
 *
4 4
 * @category        modules
5 5
 * @package         SecureFormSwitcher
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
6
 * @author          Luisehahne
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
......
18 17

  
19 18
// Must include code to stop this file being access directly
20 19
if(defined('WB_PATH') == false) { exit("Cannot access this file directly"); }
21
global $i;
22
// load module language file
23
$mod_path = (dirname(__FILE__));
24
require_once( $mod_path.'/language_load.php' );
25
$i = (!isset($i) ? 1 : $i);
26
print "<div style=\"margin:1em auto;font-size:1.1em;\">";
27
print "<h4>Step $i: Updating SecureForm Switcher</h4>\n";
28
$i++;
29
$OK   = "<span class=\"ok\">OK</span>";
30
$FAIL = "<span class=\"error\">FAILED</span>";
31
$target = $mod_path.'/files/SecureForm.mtab.php';
32
$dest = WB_PATH.'/framework/SecureForm.mtab.php';
33

  
34
if(is_writeable(WB_PATH.'/framework')) {
35
	if((copy($target,$dest) && change_mode($dest)) || file_exists($target)) {
36
		print "<br /><strong>Updating secure_form_module</strong> $OK<br />\n";
37
	} else {
38
		print "<br /><strong>Updating secure_form_module</strong> $FAIL<br />\n";
39
	}
40
}
41
print "</div>";
branches/2.8.x/wb/modules/edit_module_files.php
104 104
		<input type="hidden" name="edit_file" value="<?php echo $css_file; ?>" />
105 105
	  	<input type="hidden" name="action" value="save" />
106 106
		<textarea id="code_area" name="css_data" cols="100" rows="25" wrap="VIRTUAL" style="margin:2px;width:100%;">
107
		<?php echo htmlspecialchars($css_content); ?>
107
<?php echo htmlspecialchars($css_content); ?>
108 108
		</textarea>
109 109
  			<table cellpadding="0" cellspacing="0" border="0" width="100%">
110 110
  			<tr>
branches/2.8.x/wb/modules/output_filter/install.php
33 33

  
34 34
// add default values to the module table
35 35
$database->query("INSERT INTO ".TABLE_PREFIX
36
	."mod_output_filter (sys_rel,email_filter, mailto_filter, at_replacement, dot_replacement) VALUES ('1','1', '1', '(at)', '(dot)')");
36
	."mod_output_filter (sys_rel,email_filter, mailto_filter, at_replacement, dot_replacement) VALUES ('0','1', '1', '(at)', '(dot)')");
branches/2.8.x/wb/modules/news/rss.php
60 60
?>
61 61
		<language><?php echo strtolower(DEFAULT_LANGUAGE); ?></language>
62 62
		<copyright><?php $thedate = date('Y'); $websitetitle = WEBSITE_TITLE; echo "Copyright {$thedate}, {$websitetitle}"; ?></copyright>
63
		<managingEditor><?php echo SERVER_EMAIL; ?></managingEditor>
64
		<webMaster><?php echo SERVER_EMAIL; ?></webMaster>
63
		<managingEditor><?php echo 'info@wdsnet.de'; ?></managingEditor>
64
		<webMaster><?php echo 'info@wdsnet.de'; ?></webMaster>
65 65
		<category><?php echo WEBSITE_TITLE; ?></category>
66 66
		<generator>WebsiteBaker Content Management System</generator>
67 67
<?php
......
77 77
$result = $database->query($query);
78 78

  
79 79
//Generating the news items
80
while($item = $result->fetchRow()){ ?>
81
		<item>
82
			<title><![CDATA[<?php echo stripslashes($item["title"]); ?>]]></title>
83
			<description><![CDATA[<?php echo stripslashes($item["content_short"]); ?>]]></description>
84
			<guid><?php echo WB_URL.PAGES_DIRECTORY.$item["link"].PAGE_EXTENSION; ?></guid>
85
			<link><?php echo WB_URL.PAGES_DIRECTORY.$item["link"].PAGE_EXTENSION; ?></link>
86
		</item>
80
while($item = $result->fetchRow()){
81
	$description = stripslashes($item["content_short"]);
82
	// wb->preprocess() -- replace all [wblink123] with real, internal links
83
	$wb->preprocess($description);
84
?>
85
	<item>
86
		<title><![CDATA[<?php echo stripslashes($item["title"]); ?>]]></title>
87
		<description><![CDATA[<?php echo $description; ?>]]></description>
88
		<link><?php echo WB_URL.PAGES_DIRECTORY.$item["link"].PAGE_EXTENSION; ?></link>
89
		<pubDate><?PHP echo date("D, d M Y", $item["published_when"]); ?></pubDate>
90
		<guid><?php echo WB_URL.PAGES_DIRECTORY.$item["link"].PAGE_EXTENSION; ?></guid>
91
	</item>
87 92
<?php } ?>
88 93
	</channel>
89 94
</rss>

Also available in: Unified diff