Project

General

Profile

« Previous | Next » 

Revision 1988

Added by Dietmar about 11 years ago

! /upgrade-script.php, implement class AccessFile()
add messages for better overview

View differences:

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

  
14
19 Oct-2013 Build 1988 Dietmar Woellbrink (Luisehahne)
15
! /upgrade-script.php, implement class AccessFile()
16
  add messages for better overview
14 17
19 Oct-2013 Build 1987 Dietmar Woellbrink (Luisehahne)
15 18
! see Build 1986
16 19
  also implemented in frontend account
branches/2.8.x/wb/upgrade-script.php
489 489
	 *  - Adding field default_theme to settings table
490 490
	 */
491 491
	$aDebugMessage[] = '<div style="margin-left:2em;">';
492
	$aDebugMessage[] = "<br /><span><strong>Adding default_theme to settings table</strong></span>";
492
	$aDebugMessage[] = "<span><strong>Adding default_theme to table settings</strong></span>";
493 493
	// db_update_key_value('settings', 'default_theme', $DEFAULT_THEME);
494 494
	$cfg = array(
495 495
		'default_theme' => $DEFAULT_THEME
......
497 497
	$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
498 498
	$aDebugMessage[] = '</div>';
499 499

  
500
	if($bDebugModus) {
501
		echo implode(PHP_EOL,$aDebugMessage);
502
	}
500
	echo implode(PHP_EOL,$aDebugMessage);
501

  
503 502
	$aDebugMessage = array();
504 503
	echo'<h3>Step '.(++$stepID).': Updating core table included in package</h3>';
505 504
	/**********************************************************
......
511 510
	$cfg = array(
512 511
		'sec_anchor' => defined( 'SEC_ANCHOR' )&& (SEC_ANCHOR!='') ? SEC_ANCHOR : 'Sec'
513 512
	);
514
	$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
513
	$bLogStatus = (db_update_key_value( 'settings', $cfg ) ? true : false );
514
	$aDebugMessage[] = ( ($bLogStatus==true ) ? " $OK<br />" : " $FAIL!<br />");
515 515

  
516 516
	/**********************************************************
517 517
	 *  - Adding redirect timer to settings table
......
520 520
	$cfg = array(
521 521
		'redirect_timer' => defined('REDIRECT_TIMER')&& (REDIRECT_TIMER!='') ? REDIRECT_TIMER : '1500'
522 522
	);
523
	$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
523
	$bLogStatus = (db_update_key_value( 'settings', $cfg ) ? true : false );
524
	$aDebugMessage[] = ( ($bLogStatus==true ) ? " $OK<br />" : " $FAIL!<br />");
524 525

  
525 526
	/**********************************************************
526 527
	 *  - Adding default_time_formatr to settings table
......
529 530
	$cfg = array(
530 531
		'default_time_format' => defined('DEFAULT_TIME_FORMAT')&& (DEFAULT_TIME_FORMAT!='') ? DEFAULT_TIME_FORMAT : 'h:i A'
531 532
	);
532
	$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
533
	$bLogStatus = (db_update_key_value( 'settings', $cfg ) ? true : false );
534
	$aDebugMessage[] = ( ($bLogStatus==true ) ? " $OK<br />" : " $FAIL!<br />");
533 535

  
534 536
	/**********************************************************
535 537
	 *  - Adding rename_files_on_upload to settings table
......
543 545
		    'rename_files_on_upload' => 'ph.*?,cgi,pl,pm,exe,com,bat,pif,cmd,src,asp,aspx,js'
544 546
		);
545 547
	}
546
	$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
548
	$bLogStatus = (db_update_key_value( 'settings', $cfg ) ? true : false );
549
	$aDebugMessage[] = ( ($bLogStatus==true ) ? " $OK<br />" : " $FAIL!<br />");
547 550

  
548 551
	/**********************************************************
549 552
	 *  - Adding mediasettings to settings table
......
552 555
	$cfg = array(
553 556
		'mediasettings' => (defined('MEDIASETTINGS')&& (MEDIASETTINGS!='') ? MEDIASETTINGS : ''),
554 557
	);
558
	$bLogStatus = (db_update_key_value( 'settings', $cfg ) ? true : false );
559
	$aDebugMessage[] = ( ($bLogStatus==true ) ? " $OK<br />" : " $FAIL!<br />");
555 560

  
556
	$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
557

  
558 561
	/**********************************************************
559 562
	 *  - Adding fingerprint_with_ip_octets to settings table
560 563
	 */
......
563 566
		'fingerprint_with_ip_octets' => (defined('FINGERPRINT_WITH_IP_OCTETS') ? FINGERPRINT_WITH_IP_OCTETS : '2'),
564 567
		'secure_form_module' => (defined('SECURE_FORM_MODULE') ? SECURE_FORM_MODULE : '')
565 568
	);
569
	$bLogStatus = (db_update_key_value( 'settings', $cfg ) ? true : false );
570
	$aDebugMessage[] = ( ($bLogStatus==true ) ? " $OK<br />" : " $FAIL!<br />");
566 571

  
567
	$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
568

  
569 572
	/**********************************************************
570 573
	 *  - Adding page_icon_dir to settings table
571 574
	 */
......
573 576
	$cfg = array(
574 577
		'page_icon_dir' => (defined('PAGE_ICON_DIR')&& (PAGE_ICON_DIR!='') ? PAGE_ICON_DIR : '/templates/*/title_images'),
575 578
	);
576

  
577
	$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
579
	$bLogStatus = (db_update_key_value( 'settings', $cfg ) ? true : false );
580
	$aDebugMessage[] = ( ($bLogStatus==true ) ? " $OK<br />" : " $FAIL!<br />");
578 581
	/**********************************************************
579 582
	 *  - Adding page_extended to settings table
580 583
	 */
......
582 585
	$cfg = array(
583 586
		'page_extendet' => (defined('PAGE_EXTENDET') ? PAGE_EXTENDET : 'true'),
584 587
	);
588
	$bLogStatus = (db_update_key_value( 'settings', $cfg ) ? true : false );
589
	$aDebugMessage[] = ( ($bLogStatus==true ) ? " $OK<br />" : " $FAIL!<br />");
585 590

  
586
	$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
587

  
588 591
	/**********************************************************
589 592
	 *  - Adding wbmail_signature to settings table
590 593
	 */
......
592 595
	$cfg = array(
593 596
		'wbmail_signature' => (defined('WBMAIL_SIGNATURE')&& (WBMAIL_SIGNATURE!='') ? WBMAIL_SIGNATURE : '')
594 597
	);
598
	$bLogStatus = (db_update_key_value( 'settings', $cfg ) ? true : false );
599
	$aDebugMessage[] = ( ($bLogStatus==true ) ? " $OK<br />" : " $FAIL!<br />");
595 600

  
596
	$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
597

  
598 601
	/**********************************************************
599 602
	 *  - Adding confirmed_registration to settings table
600 603
	 */
......
602 605
	$cfg = array(
603 606
		'confirmed_registration' => (defined('CONFIRMED_REGISTRATION') ? CONFIRMED_REGISTRATION : '0')
604 607
	);
608
	$bLogStatus = (db_update_key_value( 'settings', $cfg ) ? true : false );
609
	$aDebugMessage[] = ( ($bLogStatus==true ) ? " $OK<br />" : " $FAIL!<br />");
605 610

  
606
	$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
607

  
608 611
	/**********************************************************
609 612
	 *  - Adding dev_infos to settings table
610 613
	 */
......
612 615
	$cfg = array(
613 616
		'dev_infos' => (defined('DEV_INFOS') ? DEV_INFOS : 'false')
614 617
	);
618
	$bLogStatus = (db_update_key_value( 'settings', $cfg ) ? true : false );
619
	$aDebugMessage[] = ( ($bLogStatus==true ) ? " $OK<br />" : " $FAIL!<br />");
615 620

  
616
    $aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
617

  
618 621
	/**********************************************************
619 622
	 *  - Adding server_timezone to settings table
620 623
	 */
......
622 625
	$cfg = array(
623 626
		'server_timezone' => (defined('SERVER_TIMEZONE') ? SERVER_TIMEZONE : 'UTC')
624 627
	);
628
	$bLogStatus = (db_update_key_value( 'settings', $cfg ) ? true : false );
629
	$aDebugMessage[] = ( ($bLogStatus==true ) ? " $OK<br />" : " $FAIL!<br />");
625 630

  
626
    $aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
627

  
628 631
	/**********************************************************
629
	 *  - Adding password settings to settings table
632
	 *  - Adding password settings to table settings
630 633
	 */
631 634
	$aDebugMessage[] = "<span>Adding/updating password settings to settings table</span>";
632 635
	$cfg = array();
......
634 637
	$cfg['password_hash_type'] = (defined('PASSWORD_HASH_TYPES') ? PASSWORD_HASH_TYPES : 'false');
635 638
	$cfg['password_length'] = (defined('PASSWORD_LENGTH') ? PASSWORD_LENGTH : '10');
636 639
	$cfg['password_use_types'] = (defined('PASSWORD_USE_TYPES') ? PASSWORD_USE_TYPES : (int)0xFFFF);
637
    $aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
640
	$bLogStatus = (db_update_key_value( 'settings', $cfg ) ? true : false );
641
	$aDebugMessage[] = ( ($bLogStatus==true ) ? " $OK<br />" : " $FAIL!<br />");
638 642

  
639 643
if($bDebugModus) {
640 644
    echo implode(PHP_EOL,$aDebugMessage);
641
}
645
} else {
646
        echo '<strong>Successfully upgraded</strong>'." $OK<br />";	   
647
	}
642 648
echo '</div>';
643 649

  
644 650
$aDebugMessage = array();
......
752 758

  
753 759
	if($bDebugModus) {
754 760
		echo implode(PHP_EOL,$aDebugMessage);
761
	} else {
762
        echo '<strong>Successfully upgraded</strong>'." $OK<br />";	   
755 763
	}
756 764

  
757 765
	$aDebugMessage = array();
......
775 783

  
776 784
	if($bDebugModus) {
777 785
		echo implode(PHP_EOL,$aDebugMessage);
786
	} else {
787
        echo '<strong>Successfully upgraded</strong>'." $OK<br />";	   
778 788
	}
779 789
	echo '</div>';
780 790
}
......
809 819

  
810 820
	if($bDebugModus) {
811 821
		echo implode(PHP_EOL,$aDebugMessage);
822
	} else {
823
        echo '<strong>Successfully upgraded</strong>'." $OK<br />";	   
812 824
	}
813 825
	echo '</div>';
814 826
	$aDebugMessage = array();
......
830 842

  
831 843
	if($bDebugModus) {
832 844
	    echo implode(PHP_EOL,$aDebugMessage);
845
	} else {
846
        echo '<strong>Successfully upgraded</strong>'." $OK<br />";	   
833 847
	}
834 848
	echo '</div>';
835 849

  
......
880 894
}
881 895

  
882 896
$aDebugMessage = array();
883
echo '<h3>Step '.(++$stepID).': Updating access and protected files in folders</h3>';
897
echo '<h3>Step '.(++$stepID).': Updating access files in folders</h3>';
884 898

  
885 899
echo '<div style="margin-left:2em;">';
886 900
	/**********************************************************
887 901
	* upgrade media directory index protect files
888 902
	*/
889
	echo '<h4>Upgrade media directory '.MEDIA_DIRECTORY.'/ index.php protect files</h4>';
890
	$aDebugMessage = rebuildFolderProtectFile();
891
	if( sizeof( $aDebugMessage ) ){
892
		echo '<span><strong>Upgrade '.sizeof( $aDebugMessage ).' directory '.MEDIA_DIRECTORY.'/ protect files</strong></span>'." $OK<br />";
893
	} else {
894
		echo '<span><strong>Upgrade directory '.MEDIA_DIRECTORY.'/ protect files</strong></span>'." $FAIL!<br />";
895
		echo implode ('<br />',$aDebugMessage);
896
	}
897

  
898
    $aDebugMessage = array();
903
//	echo '<h4>Upgrade media directory '.MEDIA_DIRECTORY.'/ index.php protect files</h4>';
904
//	$aDebugMessage = rebuildFolderProtectFile();
905
//	if( sizeof( $aDebugMessage ) ){
906
//		echo '<span><strong>Upgrade '.sizeof( $aDebugMessage ).' directory '.MEDIA_DIRECTORY.'/ protect files</strong></span>'." $OK<br />";
907
//	} else {
908
//		echo '<span><strong>Upgrade directory '.MEDIA_DIRECTORY.'/ protect files</strong></span>'." $FAIL!<br />";
909
//		echo implode ('<br />',$aDebugMessage);
910
//	}
911
//
912
//    $aDebugMessage = array();
899 913
    /**********************************************************
900 914
     * upgrade pages directory index access files
901 915
     */
902
	echo '<h4>Upgrade pages directory '.PAGES_DIRECTORY.'/  protect and access files</h4>';
916
	echo '<h4>Upgrade pages directory '.PAGES_DIRECTORY.'/  access files</h4>';
903 917

  
904 918
    /**********************************************************
905 919
     *  - Reformat/rebuild all existing access files
906 920
     */
907
//    $sPagePath = (defined('PAGES_DIRECTORY') && (PAGES_DIRECTORY != '') ? PAGES_DIRECTORY : '');
908
//	$sPageDir = str_replace('\\','/',WB_PATH.$sPagePath);
909
//	$aProtectedFiles = array(
910
//           $sPageDir.'/intro.php',
911
//           $sPageDir.'/intro/intro.php',
912
//    );
913 921
    $msg = rebuild_all_accessfiles($bDebugModus);
914
//	$aDebugMessage = rebuildFolderProtectFile($dir);
915 922
	echo '<strong>'.implode ('<br />',$msg).'</strong>';
916 923
    echo '</div>';
917 924

  
......
1052 1059
	 * upgrade modules if newer version is available
1053 1060
	 * $aModuleList list of proofed modules
1054 1061
	 */
1055
	$aModuleList = array(
1062
	$aProofedModuleList = array(
1056 1063
	              'captcha_control','code','droplets','form','jsadmin',
1057 1064
	              'menu_link','news','output_filter','wrapper','wysiwyg','MultiLingual');
1058
	if(sizeof($aModuleList)) 
1065
	if(sizeof($aProofedModuleList)) 
1059 1066
	{
1060 1067
		echo '<h3>Step '.(++$stepID).': Upgrade proofed modules</h3>';
1061
		foreach($aModuleList as $sModul) {
1068
		foreach($aProofedModuleList as $sModul) {
1062 1069
			if(file_exists(WB_PATH.'/modules/'.$sModul.'/upgrade.php')) {
1063 1070
				$currModulVersion = get_modul_version ($sModul, false);
1064 1071
				$newModulVersion =  get_modul_version ($sModul, true);
......
1086 1093
			if(class_exists($sModulReorg)) {
1087 1094
				$sModulVersion =  get_modul_version ($sModul, true);
1088 1095
				echo '<div style="margin-left:2em;">';
1089
				echo '<h4>'.'Create/Reorg Accesfiles for module \''.$sModul.'\' version '.$sModulVersion.'</h4>';
1090
				$oReorg = new $sModulReorg();
1096
				echo '<h4>'.'Create/Reorg Accessfiles for module \''.$sModul.'\' version '.$sModulVersion.'</h4>';
1097
				$oReorg = new $sModulReorg($sModulReorg::LOG_EXTENDED);
1091 1098
				$aReturnMsg = $oReorg->execute(); // show details
1092
				if(is_array($aReturnMsg)) {
1093
					foreach($aReturnMsg as $title) {
1094
					echo '<strong>'.$title.'</strong><br />';
1095
					}
1096
				}
1099
                $aReport = $oReorg->getReport();
1100
                unset($oReorg);
1101
                if($bDebugModus) {
1102
                    foreach($aReport['Failed'] as $sValue) {
1103
                        echo $sValue.'<br />';
1104
                    }
1105
                    foreach($aReport['Success'] as $sValue) {
1106
                        echo $sValue.'<br />';
1107
                    }
1108
    			}
1109
//				echo '<strong>'.$aReport['FilesDeleted'].' Files successful deleted</strong><br />';
1110
				echo '<strong>Number of new formated access files: '.$aReport['FilesCreated'].'</strong><br />';
1111

  
1097 1112
				echo '</div>';
1098 1113
			}
1099 1114
		}
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', '1987');
54
if(!defined('REVISION')) define('REVISION', '1988');
55 55
if(!defined('SP')) define('SP', '');

Also available in: Unified diff