Project

General

Profile

« Previous | Next » 

Revision 1920

Added by Dietmar about 11 years ago

! /modules/admin.php $sSectionIdPrefix
! /admin/media/upload.php change $database->query($sql) to $database->get_one($sql)
! /upgrade-script.php only systemadministartor can call the script
upgrade all dev-module inclding in package

View differences:

branches/2.8.x/CHANGELOG
12 12
===============================================================================
13 13

  
14 14

  
15
07 Jun-2013 Build 1920 Dietmar Woellbrink (Luisehahne)
16
! /modules/admin.php $sSectionIdPrefix
17
! /admin/media/upload.php change $database->query($sql) to $database->get_one($sql)
18
! /upgrade-script.php only systemadministartor can call the script
19
  upgrade all dev-module inclding in package
15 20
07 Jun-2013 Build 1919 Dietmar Woellbrink (Luisehahne)
16 21
! /modules/form/ beginning recoding
17 22
07 Jun-2013 Build 1918 Dietmar Woellbrink (Luisehahne)
branches/2.8.x/wb/upgrade-script.php
41 41
	require($config_file);
42 42

  
43 43
}
44
//require_once(WB_PATH.'/framework/class.admin.php');
45
if(!class_exists('admin', false)){ include(WB_PATH.'/framework/class.admin.php'); }
46
$admin = new admin('Addons', 'modules', false, false);
47

  
44 48
// solved wrong pages_directory value before creating access files
45 49
$sql  = 'SELECT `value` FROM `'.TABLE_PREFIX.'settings` '
46 50
      . 'WHERE `name`=\'pages_directory\'';
......
53 57
      . 'WHERE `name`=\'pages_directory\' ';
54 58
 WbDatabase::getInstance()->query($sql);
55 59
}
56
//require_once(WB_PATH.'/framework/class.admin.php');
57
if(!class_exists('admin', false)){ include(WB_PATH.'/framework/class.admin.php'); }
58 60
require_once(WB_PATH.'/framework/functions.php');
59 61
// require_once(WB_PATH.'/framework/Database.php');
60
$admin = new admin('Addons', 'modules', false, false);
61 62

  
62 63
$oldVersion  = 'Version '.WB_VERSION;
63 64
$oldVersion .= (defined('WB_SP') ? WB_SP : '');
......
320 321
<h1>WebsiteBaker Upgrade</h1>
321 322
<?php
322 323
	if( version_compare( WB_VERSION, '2.7', '<' )) {
323
		status_msg('<strong>Warning:</strong><br />It is not possible to upgrade from WebsiteBaker Versions before 2.7.<br />For upgrading to version '.VERSION.' you must upgrade first to v.2.7 at least!!!', 'warning', 'div');
324
		echo '<br /><br />';
324
		status_msg('<br />It is not possible to upgrade from WebsiteBaker Versions before 2.7.<br />For upgrading to version '.VERSION.' you must upgrade first to v.2.7 at least!!!', 'warning', 'div');
325 325
		echo "</div>
326 326
		</div>
327 327
		</div>
......
330 330
		";
331 331
		exit();
332 332
	}
333
if($admin->get_user_id()!=1){
334
	status_msg('<br /><h3>WebsiteBaker upgrading is not possible!<br />Before upgrading to Revision '.REVISION.' you have to login as System-Administrator!</h3>', 'warning', 'div');
335
        echo '<br /><br />';
336
// delete remember key of current user from database
337
//if (isset($_SESSION['USER_ID']) && isset($database)) {
338
//	$table = TABLE_PREFIX . 'users';
339
//	$sql = "UPDATE `$table` SET `remember_key` = '' WHERE `user_id` = '" . (int) $_SESSION['USER_ID'] . "'";
340
//	$database->query($sql);
341
//}
333 342

  
343
// delete remember key cookie if set
344
if (isset($_COOKIE['REMEMBER_KEY'])) {
345
	setcookie('REMEMBER_KEY', '', time() - 3600, '/');
346
}
347

  
348
// delete most critical session variables manually
349
$_SESSION['USER_ID'] = null;
350
$_SESSION['GROUP_ID'] = null;
351
$_SESSION['GROUPS_ID'] = null;
352
$_SESSION['USERNAME'] = null;
353
$_SESSION['PAGE_PERMISSIONS'] = null;
354
$_SESSION['SYSTEM_PERMISSIONS'] = null;
355
// overwrite session array
356
$_SESSION = array();
357
// delete session cookie if set
358
if (isset($_COOKIE[session_name()])) {
359
    setcookie(session_name(), '', time() - 42000, '/');
360
}
361
// delete the session itself
362
session_destroy();
363
status_msg('<br /><h3>After login as System-Adminstrator you have to start upgrade-script.php again!</h3>', 'info', 'div');
364
        echo '<br /><br />';
365
        if(defined('ADMIN_URL')) {
366
        	echo '<form action="'.ADMIN_URL.'/index.php" method="post">';
367
        	echo '&nbsp;<input name="backend_send" type="submit" value="Kick me to the Login" />';
368
        	echo '</form>';
369
        }
370
echo "<br /><br /></div>
371
	</div>
372
	</div>
373
	</body>
374
	</html>
375
	";
376
	exit();
377
}
378

  
334 379
?>
335 380
<p class="info">This script upgrades an existing WebsiteBaker <strong> <?php echo $oldRevision; ?></strong> installation to the <strong> <?php echo $newRevision ?> </strong>.<br />The upgrade script alters the existing WB database to reflect the changes introduced with WB 2.8.x</p>
336 381

  
......
409 454
	$aDebugMessage[] = "<br /><span><strong>Adding default_theme to settings table</strong></span>";
410 455
	// db_update_key_value('settings', 'default_theme', $DEFAULT_THEME);
411 456
	$cfg = array(
412
		'default_theme' => defined('DEFAULT_THEME')&& (DEFAULT_THEME!='') ? DEFAULT_THEME : $DEFAULT_THEME
457
		'default_theme' => $DEFAULT_THEME
413 458
	);
414 459
	$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
415 460
	$aDebugMessage[] = '</div>';
......
426 471
	echo "<h4>Adding/updating entries on table settings</h4>";
427 472
	$aDebugMessage[] = "<span>Adding/updating sec_anchor to settings table</span>";
428 473
	$cfg = array(
429
		'sec_anchor' => defined('SEC_ANCHOR')&& (SEC_ANCHOR!='') ? SEC_ANCHOR : 'section_'
474
		'sec_anchor' => defined( 'SEC_ANCHOR' )&& (SEC_ANCHOR!='') ? SEC_ANCHOR : 'Sec'
430 475
	);
431 476
	$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
432 477

  
......
811 856
     */
812 857
    $sPagePath = (defined('PAGES_DIRECTORY') && (PAGES_DIRECTORY != '') ? PAGES_DIRECTORY : '');
813 858
    $msg = rebuild_all_accessfiles();
814

  
859
	$dir = (WB_PATH.PAGES_DIRECTORY);
860
//	$aDebugMessage = rebuildFolderProtectFile($dir);
815 861
	echo '<strong>'.implode ('<br />',$msg).'</strong>';
816 862
    echo '</div>';
817 863

  
......
953 999
	 * $aModuleList list of proofed modules
954 1000
	 */
955 1001
	$aModuleList = array(
956
	              'captcha_control','code','form','jsadmin',
957
	              'menu_link','news','output_filter','wrapper','wysiwyg');
1002
	              'captcha_control','code','droplets','form','jsadmin',
1003
	              'menu_link','news','output_filter','wrapper','wysiwyg','MultiLingual');
958 1004
	if(sizeof($aModuleList)) 
959 1005
	{
960 1006
		echo '<h3>Step '.(++$stepID).': Upgrade proofed modules</h3>';
branches/2.8.x/wb/admin/media/upload.php
69 69
// Get list of file types to which we're supposed to append 'txt'
70 70
$sql = 'SELECT `value` FROM  `'.TABLE_PREFIX. 'settings` '.
71 71
       'WHERE `name`=\'rename_files_on_upload\'';
72
if( ($file_extension_string = $database->get_one($sql))=='' ) {
73
//    $aResult = $oRes->fetchRow(MYSQL_ASSOC);
74
//    $file_extension_string = $aResult['value'];
72 75

  
73
if($oRes = $database->query($sql)) {
74
    $aResult = $oRes->fetchRow(MYSQL_ASSOC);
75
    $file_extension_string = $aResult['value'];
76 76
}
77 77

  
78 78
$file_extensions=explode(",",$file_extension_string);
branches/2.8.x/wb/admin/interface/version.php
51 51

  
52 52
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
53 53
if(!defined('VERSION')) define('VERSION', '2.8.3');
54
if(!defined('REVISION')) define('REVISION', '1919');
54
if(!defined('REVISION')) define('REVISION', '1920');
55 55
if(!defined('SP')) define('SP', '');
branches/2.8.x/wb/modules/admin.php
4 4
 * @category        backend
5 5
 * @package         modules
6 6
 * @author          WebsiteBaker Project
7
 * @copyright       2009-2012, WebsiteBaker Org. e.V.
8
 * @link			http://www.websitebaker2.org/
7
 * @copyright       2009-2013, WebsiteBaker Org. e.V.
8
 * @link            http://www.websitebaker.org/
9 9
 * @license         http://www.gnu.org/licenses/gpl.html
10 10
 * @platform        WebsiteBaker 2.8.x
11 11
 * @requirements    PHP 5.2.2 and higher
12 12
 * @version         $Id$
13
 * @filesource		$HeadURL$
13
 * @filesource      $HeadURL$
14 14
 * @lastmodified    $Date$
15 15
 *
16 16
 */
......
209 209
				$block_name = '#' . (int) $section['block'];
210 210
			}
211 211
		}
212
		$sec_anchor = '#'.(defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' )  ? SEC_ANCHOR.$section_id : 'section_'.$section_id );
213
		//print '<div class="section-info" ><b>' . $TEXT['BLOCK'] . ': </b>' . $block_name;
214
		print '<div class="section-info" '.$sec_anchor.' ><b>' . $TEXT['BLOCK'] . ': </b>' . $block_name;
212
		$sSectionIdPrefix = (defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' )  ? SEC_ANCHOR : 'Sec' );
213
		print '<div class="section-info" id="'.$sSectionIdPrefix.$section_id.'" ><b>' . $TEXT['BLOCK'] . ': </b>' . $block_name;
215 214
		print '<b>  Modul: </b>' . $section['module']." ";
216 215
		print '<b>  ID: </b>' . $section_id."</div>\n";
217 216
//	}

Also available in: Unified diff