Project

General

Profile

« Previous | Next » 

Revision 1883

Added by Dietmar over 11 years ago

! groups change languages class to translate class
! prepare upgrade-script for WB Version 2.8.4 (versioncompare)
! update Form modul to version 2.9.1

View differences:

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

  
14
07 Mar-2013 Build 1883 Dietmar Woellbrink (Luisehahne)
15
! groups change languages class to translate class
16
! prepare upgrade-script for WB Version 2.8.4 (versioncompare)
17
! update Form modul to version 2.9.1
14 18
06 Mar-2013 Build 1882 Werner v.d.Decken(DarkViper)
15 19
# protect magic setter to fix security issue in WbAdapter
16 20
05 Mar-2013 Build 1881 Dietmar Woellbrink (Luisehahne)
branches/2.8.x/wb/upgrade-script.php
85 85
$DEFAULT_THEME = 'wb_theme';
86 86

  
87 87
$stepID = 0;
88
$filesRemove = array();
88 89
$aFilesToRemove = array();
89 90
$dirRemove = array(
90 91
/*
......
103 104
			'[ADMIN]/preferences/password.php',
104 105
			'[ADMIN]/pages/settings2.php',
105 106
			'[ADMIN]/users/users.php',
107
			'[ADMIN]/groups/add.php',
108
			'[ADMIN]/groups/groups.php',
109
			'[ADMIN]/groups/save.php',
106 110
			'[ADMIN]/skel/themes/htt/groups.htt',
107 111

  
108 112
			'[FRAMEWORK]/class.msg_queue.php',
......
113 117
	$aFilesToRemove = array_merge($filesRemove['0']);
114 118

  
115 119
// deleting files below only from less 2.8.4 stable
116
if(version_compare(WB_REVISION, REVISION, '<='))
120
if(version_compare(WB_VERSION, '2.8.4', '<'))
117 121
{
118 122
	$filesRemove['1'] = array(
119 123

  
......
898 902
	echo '<strong>'.implode ('<br />',$msg).'</strong>';
899 903
    echo '</div>';
900 904

  
901
    /* *****************************************************************************
902
     * - check for deprecated / never needed files
903
     */
904
    if(sizeof($aFilesToRemove)) {
905
    	echo '<h3>Step '.(++$stepID).': Remove deprecated and old files</h3>';
906
    	$searches = array(
907
    		'[ADMIN]',
908
    		'[MEDIA]',
909
    		'[PAGES]',
910
    		'[FRAMEWORK]',
911
    		'[MODULES]',
912
    		'[TEMPLATE]'
913
    	);
914
    	$replacements = array(
915
    		'/'.substr(ADMIN_PATH, strlen(WB_PATH)+1),
916
    		MEDIA_DIRECTORY,
917
    		PAGES_DIRECTORY,
918
    		'/framework',
919
    		'/modules',
920
    		'/templates'
921
    	);
905
	/* *****************************************************************************
906
	 * - check for deprecated / never needed files
907
	 */
908
	$iLoaded = sizeof($aFilesToRemove);
909
	if($iLoaded) {
910
		echo '<h3>Step '.(++$stepID).': Remove deprecated and outdated files</h3>';
911
		$iFailed = 0;
912
		$iFound = 0;
913
		$searches = array(
914
			'[ADMIN]',
915
			'[MEDIA]',
916
			'[PAGES]',
917
			'[FRAMEWORK]',
918
			'[MODULES]',
919
			'[TEMPLATE]'
920
		);
921
		$replacements = array(
922
			'/'.substr(ADMIN_PATH, strlen(WB_PATH)+1),
923
			MEDIA_DIRECTORY,
924
			PAGES_DIRECTORY,
925
			'/framework',
926
			'/modules',
927
			'/templates'
928
		);
922 929

  
923 930
		$msg = '';
924
    	foreach( $aFilesToRemove as $file )
925
    	{
931
		echo '<div style="margin-left:2em;">';
932
		echo '<h4>Search '.$iLoaded.' deprecated and outdated files</h4>';
933
		foreach( $aFilesToRemove as $file )
934
		{
926 935
			$file = str_replace($searches, $replacements, $file);
927 936
			if( is_writable(WB_PATH.'/'.$file) ) {
937
				$iFound++;
928 938
				// try to unlink file
929 939
				if(!unlink(WB_PATH.$file)) {
930
					// save in err-list, if failed
940
					$iFailed++;
931 941
				}
932 942
			}
933
            if( is_readable(WB_PATH.'/'.$file) ) {
934
                $msg .= $file.'<br />';
935
            }
936
    	}
943
			if( is_readable(WB_PATH.'/'.$file) ) {
944
				// save in err-list, if failed
945
				$msg .= $file.'<br />';
946
			}
947
		}
948
		$iRemove = $iFound-$iFailed;
949
		echo '<strong>Remove '.$iRemove.' from '.$iFound.' founded</strong> ';
950
		echo ($iFailed == 0) ? $OK : $FAIL;
951
		echo '</div>';
937 952

  
938 953
		if($msg != '')
939 954
		{
......
956 971
    }
957 972

  
958 973

  
959
/**********************************************************
960
 * - check for deprecated / never needed files
961
 */
962
	if(sizeof($dirRemove)) {
963
		echo '<h3>Step  '.(++$stepID).': Remove deprecated and old folders</h3>';
974
	/**********************************************************
975
	 * - check for deprecated / never needed files
976
	 */
977
	$iLoaded = sizeof($dirRemove);
978
	if($iLoaded) {
979
		echo '<h3>Step  '.(++$stepID).': Remove deprecated and outdated folders</h3>';
980
		$iFailed = 0;
981
		$iFound = 0;
964 982
		$searches = array(
965 983
			'[ADMIN]',
966 984
			'[MEDIA]',
......
974 992
			'/templates',
975 993
		);
976 994
		$msg = '';
995
		echo '<div style="margin-left:2em;">';
996
		echo '<h4>Search '.$iLoaded.' deprecated and outdated folders</h4>';
977 997
		foreach( $dirRemove as $dir ) {
978 998
			$dir = str_replace($searches, $replacements, $dir);
979 999
			$dir = WB_PATH.'/'.$dir;
980 1000
			if( is_dir( $dir )) {
1001
				$iFound++;
981 1002
			// try to delete dir
982 1003
				if(!is_writable( $dir ) || !rm_full_dir($dir)) {
983 1004
				// save in err-list, if failed
984
                    if( is_readable(WB_PATH.'/'.$file) ) {
985
                    	$msg .= str_replace(WB_PATH,'',$dir).'<br />';
986
                    }
1005
					$iFailed++;
987 1006
				}
988 1007
			}
1008
			if( is_readable(WB_PATH.'/'.$dir) ) {
1009
				$msg .= str_replace(WB_PATH,'',$dir).'<br />';
1010
			}
989 1011
		}
1012
		
1013
		$iRemove = $iFound-$iFailed;
1014
		echo '<strong>Remove '.$iRemove.' from '.$iFound.' founded</strong> ';
1015
		echo ($iFailed == 0) ? $OK : $FAIL;
1016
		echo '</div>';
990 1017

  
991 1018
		if($msg != '') {
992 1019
			$msg = '<br /><br />Following directories are deprecated, outdated or a security risk and
......
1004 1031
			</html>";
1005 1032
			exit;
1006 1033
		}
1034

  
1035

  
1007 1036
	}
1008 1037

  
1009
    /**********************************************************
1010
     * upgrade modules if newer version is available
1011
     * $aModuleList list of proofed modules
1012
     */
1013
    $aModuleList = array('news','wysiwyg','form');
1038
	/**********************************************************
1039
	 * upgrade modules if newer version is available
1040
	 * $aModuleList list of proofed modules
1041
	 */
1042
	$aModuleList = array('news','wysiwyg','form');
1014 1043
	if(sizeof($aModuleList)) 
1015 1044
	{
1016 1045
	    echo '<h3>Step '.(++$stepID).': Upgrade proofed modules</h3>';
......
1019 1048
				$currModulVersion = get_modul_version ($sModul, false);
1020 1049
				$newModulVersion =  get_modul_version ($sModul, true);
1021 1050
				if((version_compare($currModulVersion, $newModulVersion) <= 0)) {
1022
	                echo '<div style="margin-left:2em;">';
1051
					echo '<div style="margin-left:2em;">';
1023 1052
					echo '<h4>'.'Upgrade module \''.$sModul.'\' version '.$newModulVersion.'</h4>';
1024 1053
					require(WB_PATH.'/modules/'.$sModul.'/upgrade.php');
1025
	                echo '</div>';
1054
					echo '</div>';
1026 1055
				}
1027 1056
			}
1028 1057
		}
1029 1058
	}
1030 1059

  
1031
    /**********************************************************
1032
     * Reformat/rebuild all existing moules access files
1033
     * $aModuleList list of modules
1034
     */
1035
    $aModuleList = array('bakery','topics','news');
1060
	/**********************************************************
1061
	 * Reformat/rebuild all existing moules access files
1062
	 * $aModuleList list of modules
1063
	 */
1064
	$aModuleList = array('bakery','topics','news');
1036 1065
	if(sizeof($aModuleList)) 
1037 1066
	{
1038 1067
		echo '<h3>Step '.(++$stepID).': Create/Reorg Accessfiles from modules</h3>';
......
1059 1088
 */
1060 1089

  
1061 1090
	echo '<h3>Step '.(++$stepID).' : Reload all addons database entry (no upgrade)</h3><br />';
1062
    echo '<div style="margin-left:2em;">';
1063
    $iFound = 0;
1064
    $iLoaded = 0;
1091
	echo '<div style="margin-left:2em;">';
1092
	$iFound = 0;
1093
	$iLoaded = 0;
1065 1094
	////delete modules
1066 1095
	//$database->query("DELETE FROM ".TABLE_PREFIX."addons WHERE type = 'module'");
1067 1096
	// Load all modules
......
1136 1165
	'wb_revision' => REVISION,
1137 1166
	'wb_sp' => SP
1138 1167
);
1139
echo '<br /><span><strong>Set database version number to '.VERSION.' '.SP.' '.' Revision ['.REVISION.'] : </strong></span>';
1168
echo '<br /><span><strong>Set WebsiteBaker version number to '.VERSION.' '.SP.' '.' Revision ['.REVISION.'] : </strong></span>';
1140 1169
echo (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
1141 1170
echo '</div>';
1142 1171

  
branches/2.8.x/wb/admin/groups/delete.inc.php
27 27
 */
28 28
	function delete_group($admin, $group_id = 0)
29 29
	{
30
		global $MESSAGE;
30
//		global $MESSAGE;
31 31
		$database = WbDatabase::getInstance();
32
		$mLang = Translate::getInstance();
32 33
	// first check form-tan
33 34
		if($admin->checkFTAN())
34 35
		{
......
42 43
				if($database->query($sql) != false)
43 44
				{
44 45
	// remove group from users groups_id
45
					msgQueue :: add($MESSAGE['GROUPS_DELETED'],true);
46
					msgQueue :: add($mLang->MESSAGE_GROUPS_DELETED,true);
46 47
					$sql = 'SELECT `user_id`, `groups_id`, `home_folder` FROM `'.TABLE_PREFIX.'users` WHERE user_id != 1';
47 48
					if(($res_users = $database->query($sql)) && ($res_users->numRows() > 0) )
48 49
					{
......
64 65
				                    $sql_info = mysql_info($database->db_handle);
65 66
									if(preg_match('/matched: *([1-9][0-9]*)/i', $sql_info) != 1)
66 67
									{
67
										msgQueue :: add($MESSAGE['RECORD_MODIFIED_FAILED']);
68
										msgQueue :: add($mLang->MESSAGE_RECORD_MODIFIED_FAILED );
68 69
									}
69 70
								} else {
70 71

  
......
75 76
                    }
76 77
					// $admin->print_success($msg);
77 78
				} else {
78
					msgQueue :: add($MESSAGE['RECORD_MODIFIED_FAILED']);
79
					msgQueue :: add($mLang->MESSAGE_RECORD_MODIFIED_FAILED );
79 80
				}
80 81
			}
81 82
		} else {
82
			msgQueue :: add($MESSAGE['GENERIC_SECURITY_OFFENSE']);
83
			msgQueue :: add($mLang->MESSAGE_GENERIC_SECURITY_OFFENSE );
83 84
		}
84 85
		$admin->print_header();
85 86
		return ;
branches/2.8.x/wb/admin/groups/groups_list.inc.php
25 25
 */
26 26
	function show_grouplist($admin)
27 27
	{
28
		global $TEXT, $MESSAGE, $MENU, $HEADING;
28
//		global $TEXT, $MESSAGE, $MENU, $HEADING;
29 29
		$database = WbDatabase::getInstance();
30
		$mLang = ModLanguage::getInstance();
30
		$mLang = Translate::getInstance();
31 31
// Create new template object for the modify/remove section
32 32
		$tpl = new Template(dirname($admin->correct_theme_source('groups_list.htt')),'keep');
33 33
		$tpl->set_file('page', 'groups_list.htt');
......
141 141
		$tpl->set_var(array(
142 142
				'TEXT_MODIFY'    => ($admin->get_permission('groups_modify') == true) ? $mLang->TEXT_MODIFY : $mLang->TEXT_VIEW,
143 143
				'TEXT_DELETE'    => $mLang->TEXT_DELETE,
144
				'CONFIRM_DELETE' => $MESSAGE['GROUPS_CONFIRM_DELETE']
144
				'CONFIRM_DELETE' => $mLang->MESSAGE_GROUPS_CONFIRM_DELETE
145 145
				));
146 146

  
147 147
	// Parse template object
branches/2.8.x/wb/admin/groups/groups_mask.inc.php
39 39
//		global $TEXT, $MESSAGE, $HEADING, $MENU;
40 40

  
41 41
		$database = WbDatabase::getInstance();
42
		$mLang = ModLanguage::getInstance();
42
		$mLang = Translate::getInstance();
43 43
//		$mLang->setLanguage(dirname(__FILE__).'/languages/', LANGUAGE, DEFAULT_LANGUAGE);
44 44
		include_once('upgradePermissions.php');
45 45
		include_once(WB_PATH.'/framework/functions.php');
branches/2.8.x/wb/admin/groups/save.inc.php
33 33
 */
34 34
	function save_group($admin, $group_id = 0)
35 35
	{
36
		global $TEXT, $MESSAGE, $HEADING, $MENU;
36
//		global $TEXT, $MESSAGE, $HEADING, $MENU;
37 37
		include_once('upgradePermissions.php');
38 38
		include_once(WB_PATH.'/framework/functions.php');
39 39
		$database = WbDatabase::getInstance();
40
		$mLang = Translate::getInstance();
40 41
	// check for valid group_id
41 42
		$sql = '';
42 43

  
......
65 66

  
66 67
			if($group_name == '')
67 68
			{
68
				msgQueue::add($MESSAGE['GROUPS_GROUP_NAME_BLANK']);
69
				msgQueue::add($mLang->MESSAGE_GROUPS_GROUP_NAME_BLANK );
69 70
			} elseif($group_name != '') {
70 71
		// check request vars and assign values to record
71 72
				if( $database->get_one($sql) != false )
72 73
				{
73
					msgQueue::add($MESSAGE['GROUPS_GROUP_NAME_EXISTS']);
74
					msgQueue::add($mLang->MESSAGE_GROUPS_GROUP_NAME_EXISTS );
74 75
				} else {
75 76
					if( $group_id == 0 )
76 77
					{
......
93 94
				$sql .= $where;
94 95
				if( $database->query($sql) )
95 96
				{
96
	                msgQueue::add($MESSAGE['GROUPS_SAVED'],true);
97
	                msgQueue::add($mLang->MESSAGE_GROUPS_SAVED ,true);
97 98
				} else {
98
					msgQueue::add($MESSAGE['RECORD_MODIFIED_FAILED']);
99
					msgQueue::add($mLang->MESSAGE_RECORD_MODIFIED_FAILED );
99 100
				}
100 101
			}
101 102
		} else {
branches/2.8.x/wb/admin/groups/index.php
20 20
	function admin_groups_index()
21 21
	{
22 22
		$database = WbDatabase::getInstance();
23
		$mLang = ModLanguage::getInstance();
24
		$mLang->setLanguage(dirname(__FILE__).'/languages/', LANGUAGE, DEFAULT_LANGUAGE);
23
//		$mLang = ModLanguage::getInstance();
24
//		$mLang->setLanguage(dirname(__FILE__).'/languages/', LANGUAGE, DEFAULT_LANGUAGE);
25
		$mLang = Translate::getinstance();
26
		$mLang->enableAddon('admin\groups');
25 27

  
26 28
		$mod_path = dirname(str_replace('\\', '/', __FILE__));
27 29
		$mod_name = basename($mod_path);
......
125 127
		}
126 128
		print $output;
127 129
		$admin->print_footer();
130
		$mLang->disableAddon();
128 131
	}
129 132
	// start dispatcher maintenance
130 133
	if(!defined('WB_PATH'))
131 134
	{
132
		require('../../config.php');
133
		require_once(WB_PATH.'/framework/class.admin.php');
135
		$config_file = realpath('../../config.php');
136
		if(file_exists($config_file) && !defined('WB_URL'))
137
		{
138
			require($config_file);
139
		}
134 140
	}
141
	if(!class_exists('admin', false)){ include(WB_PATH.'/framework/class.admin.php'); }
135 142
	admin_groups_index();
136 143
	exit;
137 144
// end of file
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', '1882');
54
if(!defined('REVISION')) define('REVISION', '1883');
55 55
if(!defined('SP')) define('SP', '');
branches/2.8.x/wb/modules/form/info.php
24 24
$module_directory = 'form';
25 25
$module_name = 'Form';
26 26
$module_function = 'page';
27
$module_version = '2.9.0';
28
$module_platform = '2.8.3';
27
$module_version = '2.9.1';
28
$module_platform = '2.8.4';
29 29
$module_author = 'Ryan Djurovich & Rudolph Lartey - additions John Maats - PCWacht, dev-team';
30 30
$module_license = 'GNU General Public License';
31 31
$module_description = 'This module allows you to create customised online forms, such as a feedback form. '.
branches/2.8.x/wb/modules/form/install.php
20 20
	require_once(dirname(dirname(dirname(__FILE__))).'/framework/globalExceptionHandler.php');
21 21
	throw new IllegalFileException();
22 22
} else {
23
	// Create tables
24

  
23
// Create tables
25 24
$database->SqlImport(dirname(__FILE__).'/sql/form284db.sql',TABLE_PREFIX,false);
26

  
27
// remove old version of search (deprecated)
28 25
}
branches/2.8.x/wb/modules/form/frontend.css
1
.frm-field_table { width :100%; vertical-align :middle; table-layout :auto; border-collapse :separate; border :none; }
2
.frm-field_table tbody { font-size : 100%; padding :0.4em 0.2em; }
3
.frm-field_table tbody td { border :none; }
4
.frm-field_table tbody td.field_heading,
5
.frm-field_table tbody td.frm-field_heading { border-bottom :2px solid #666666; color :#666666; font-weight :bold; padding-top :0.5em; }
1 6
.frm-required { color :#ff0000; }
2
.frm-field_title { font-size :12px; width :25%; vertical-align :top; white-space :nowrap; text-align :right; }
3
.field_heading,
4
.frm-field_heading { border-bottom: 1px ridge; font-weight: bold; }
5
.frm-textfield { font-size :12px; width :90%; }
6
.frm-textarea { font-size :12px; width :100%; height :100px; }
7
.frm-field_heading { font-size :12px; font-weight :bold; border-bottom-width :2px; border-bottom-style :solid; border-bottom-color :#666666; padding-top :10px; color :#666666; }
8
.frm-select { font-size :12px; width :50%; }
9
.frm-select option { font-size :12px; width :95%; }
10
.frm-field_checkbox { font-size :11px; cursor :pointer; width :30px; vertical-align :middle; }
11
.frm-checkbox_label { font-size :11px; cursor :pointer; width :auto; }
12
.frm-radio_label { font-size :11px; cursor :pointer; }
13
.frm-email { font-size :12px; width : 90%; }
7
.frm-field_title { width :25%; vertical-align :top; white-space :nowrap; text-align :right; }
8
.frm-textfield { width :90%; }
9
.frm-textarea { width :100%; height :100px; }
10
.frm-select { width :50%; }
11
.frm-select option { width :95%; }
12
.frm-field_checkbox { cursor :pointer; width :2em; vertical-align :middle; }
13
.frm-checkbox_label { cursor :pointer; vertical-align :middle; }
14
.frm-radio_label { cursor :pointer; }
15
.frm-email { width : 90%; }
14 16
/*** Don't remove the class nixhier, this is required for ASP ***/
15 17
.nixhier,
16 18
.frm-nixhier { display :none; }
......
18 20
.print-email { font-size :0.8em; color :#000; margin :10px auto; }	
19 21
.frm-warning { background :#ffeeee; border :0.2em #884444 solid; color :#e10000; margin-bottom :1em; padding :0.8em; font-size :1.2em; font-weight :bold; }
20 22
.frm-note { background :#eeffee; border :0.2em #448844 solid; color :#004400; margin-bottom :1em; padding :0.8em; font-size :1.2em; font-weight :bold; }
21
.previewPrintTop { text-align :right; font-size :0.9em; }
22
.previewPrintTop img { padding-left :16px; }
23
fieldset { border :none; }
24
.frm-thankyou { font-size :1em; }
25
.frm-tbody {  }		
23
.previewPrintTop { text-align :right; }
24
.previewPrintTop img { padding-left :1em; }
25
.frm-thankyou {  }
26
.frm-tbody {  }		
branches/2.8.x/wb/modules/form/add.php
24 24
}
25 25
/* -------------------------------------------------------- */
26 26

  
27
// load module language file
28
//$lang = (dirname(__FILE__)) . '/languages/' . LANGUAGE . '.php';
29
//require_once(!file_exists($lang) ? (dirname(__FILE__)) . '/languages/EN.php' : $lang );
30

  
31 27
// ------------------------------------
32 28
$table_name = TABLE_PREFIX.'mod_form_settings';
33 29
$field_name = 'perpage_submissions';
......
38 34
// ------------------------------------
39 35

  
40 36
// Insert an extra rows into the database
41
$header = '<table class="frm-field_table" cellpadding=\"2\" cellspacing=\"0\" border=\"0\" summary=\"form\">';
37
$header = '<table class="frm-field_table">';
42 38
$field_loop = '<tr>'.PHP_EOL.'<td class=\"frm-field_title\">{TITLE}{REQUIRED}:</td>'.PHP_EOL.'<td>{FIELD}</td>'.PHP_EOL.'</tr>';
43 39
$footer = '<tr>'.PHP_EOL.'<td>&nbsp;</td>'.PHP_EOL.'
44 40
<td>'.PHP_EOL.'

Also available in: Unified diff