Project

General

Profile

« Previous | Next » 

Revision 1397

Added by Dietmar over 13 years ago

recoded rediect timer in print_success (tks to Chio)

View differences:

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

  
13 13
------------------------------------- 2.8.2 -------------------------------------
14
20 Jan-2011 Build 1397 Dietmar Woellbrink (Luisehahne)
15
! recoded rediect timer in print_success (tks to Chio)
16
19 Jan-2011 Build 1396 Werner von den Decken (DarkViper)
17
! remove header redirect and add a die message 
14 18
17 Jan-2011 Build 1395 Frank Heyne (FrankH)
15 19
# Security fix in admin/addons
16 20
16 Jan-2011 Build 1394 Dietmar Woellbrink (Luisehahne)
branches/2.8.x/wb/admin/start/index.php
1
<?php

2
/**

3
 *

4
 * @category        admin

5
 * @package         start

6
 * @author          WebsiteBaker Project

7
 * @copyright       2004-2009, Ryan Djurovich

8
 * @copyright       2009-2011, Website Baker Org. e.V.

9
 * @link			http://www.websitebaker2.org/

10
 * @license         http://www.gnu.org/licenses/gpl.html

11
 * @platform        WebsiteBaker 2.8.x

12
 * @requirements    PHP 5.2.2 and higher

13
 * @version         $Id$

14
 * @filesource		$HeadURL$

15
 * @lastmodified    $Date$

16
 *

17
*/

18

  
19
require('../../config.php');

20
require_once(WB_PATH.'/framework/class.admin.php');

21
$admin = new admin('Start','start');

22

  
23
// Setup template object

24
$template = new Template(THEME_PATH.'/templates');

25
$template->set_file('page', 'start.htt');

26
$template->set_block('page', 'main_block', 'main');

27

  
28
// Insert values into the template object

29
$template->set_var(array(

30
								'WELCOME_MESSAGE' => $MESSAGE['START']['WELCOME_MESSAGE'],

31
								'CURRENT_USER' => $MESSAGE['START']['CURRENT_USER'],

32
								'DISPLAY_NAME' => $admin->get_display_name(),

33
								'ADMIN_URL' => ADMIN_URL,

34
								'WB_URL' => WB_URL,

35
								'THEME_URL' => THEME_URL,

36
								'WB_VERSION' => WB_VERSION

37
								)

38
						);

39

  
40
// Insert permission values into the template object

41
if($admin->get_permission('pages') != true)

42
{

43
	$template->set_var('DISPLAY_PAGES', 'display:none;');

44
}

45
if($admin->get_permission('media') != true)

46
{

47
	$template->set_var('DISPLAY_MEDIA', 'display:none;');

48
}

49
if($admin->get_permission('addons') != true)

50
{

51
	$template->set_var('DISPLAY_ADDONS', 'display:none;');

52
}

53
if($admin->get_permission('access') != true)

54
{

55
	$template->set_var('DISPLAY_ACCESS', 'display:none;');

56
}

57
if($admin->get_permission('settings') != true)

58
{

59
	$template->set_var('DISPLAY_SETTINGS', 'display:none;');

60
}

61
if($admin->get_permission('admintools') != true)

62
{

63
	$template->set_var('DISPLAY_ADMINTOOLS', 'display:none;');

64
}

65

  
66
// Check if installation directory still exists

67
if(file_exists(WB_PATH.'/install/')) {

68
	// Check if user is part of Adminstrators group

69
	if(in_array(1, $admin->get_groups_id()))

70
    {

71
		$template->set_var('WARNING', $MESSAGE['START']['INSTALL_DIR_EXISTS']);

72
	} else {

73
		$template->set_var('DISPLAY_WARNING', 'display:none;');

74
	}

75
} else {

76
	$template->set_var('DISPLAY_WARNING', 'display:none;');

77
}

78

  
79
// Insert "Add-ons" section overview (pretty complex compared to normal)

80
$addons_overview = $TEXT['MANAGE'].' ';

81
$addons_count = 0;

82
if($admin->get_permission('modules') == true)

83
{

84
	$addons_overview .= '<a href="'.ADMIN_URL.'/modules/index.php">'.$MENU['MODULES'].'</a>';

85
	$addons_count = 1;

86
}

87
if($admin->get_permission('templates') == true)

88
{

89
	if($addons_count == 1) { $addons_overview .= ', '; }

90
	$addons_overview .= '<a href="'.ADMIN_URL.'/templates/index.php">'.$MENU['TEMPLATES'].'</a>';

91
	$addons_count = 1;

92
}

93
if($admin->get_permission('languages') == true)

94
{

95
	if($addons_count == 1) { $addons_overview .= ', '; }

96
	$addons_overview .= '<a href="'.ADMIN_URL.'/languages/index.php">'.$MENU['LANGUAGES'].'</a>';

97
}

98

  
99
// Insert "Access" section overview (pretty complex compared to normal)

100
$access_overview = $TEXT['MANAGE'].' ';

101
$access_count = 0;

102
if($admin->get_permission('users') == true) {

103
	$access_overview .= '<a href="'.ADMIN_URL.'/users/index.php">'.$MENU['USERS'].'</a>';

104
	$access_count = 1;

105
}

106
if($admin->get_permission('groups') == true) {

107
	if($access_count == 1) { $access_overview .= ', '; }

108
	$access_overview .= '<a href="'.ADMIN_URL.'/groups/index.php">'.$MENU['GROUPS'].'</a>';

109
	$access_count = 1;

110
}

111

  
112
// Insert section names and descriptions

113
$template->set_var(array(

114
								'PAGES' => $MENU['PAGES'],

115
								'MEDIA' => $MENU['MEDIA'],

116
								'ADDONS' => $MENU['ADDONS'],

117
								'ACCESS' => $MENU['ACCESS'],

118
								'PREFERENCES' => $MENU['PREFERENCES'],

119
								'SETTINGS' => $MENU['SETTINGS'],

120
								'ADMINTOOLS' => $MENU['ADMINTOOLS'],

121
								'HOME_OVERVIEW' => $OVERVIEW['START'],

122
								'PAGES_OVERVIEW' => $OVERVIEW['PAGES'],

123
								'MEDIA_OVERVIEW' => $OVERVIEW['MEDIA'],

124
								'ADDONS_OVERVIEW' => $addons_overview,

125
								'ACCESS_OVERVIEW' => $access_overview,

126
								'PREFERENCES_OVERVIEW' => $OVERVIEW['PREFERENCES'],

127
								'SETTINGS_OVERVIEW' => $OVERVIEW['SETTINGS'],

128
								'ADMINTOOLS_OVERVIEW' => $OVERVIEW['ADMINTOOLS']

129
								)

130
						);

131

  
132
// Parse template object

133
$template->parse('main', 'main_block', false);

134
$template->pparse('output', 'page');

135

  
136
// Print admin footer

137
$admin->print_footer();

138

  
1
<?php
2
/**
3
 *
4
 * @category        admin
5
 * @package         start
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2011, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 5.2.2 and higher
13
 * @version         $Id$
14
 * @filesource		$HeadURL$
15
 * @lastmodified    $Date$
16
 *
17
*/
18

  
19
require('../../config.php');
20
require_once(WB_PATH.'/framework/class.admin.php');
21
$admin = new admin('Start','start');
22

  
23
// Setup template object
24
$template = new Template(THEME_PATH.'/templates');
25
$template->set_file('page', 'start.htt');
26
$template->set_block('page', 'main_block', 'main');
27

  
28
// Insert values into the template object
29
$template->set_var(array(
30
								'WELCOME_MESSAGE' => $MESSAGE['START']['WELCOME_MESSAGE'],
31
								'CURRENT_USER' => $MESSAGE['START']['CURRENT_USER'],
32
								'DISPLAY_NAME' => $admin->get_display_name(),
33
								'ADMIN_URL' => ADMIN_URL,
34
								'WB_URL' => WB_URL,
35
								'THEME_URL' => THEME_URL,
36
								'WB_VERSION' => WB_VERSION
37
								)
38
						);
39

  
40
// Insert permission values into the template object
41
if($admin->get_permission('pages') != true)
42
{
43
	$template->set_var('DISPLAY_PAGES', 'display:none;');
44
}
45
if($admin->get_permission('media') != true)
46
{
47
	$template->set_var('DISPLAY_MEDIA', 'display:none;');
48
}
49
if($admin->get_permission('addons') != true)
50
{
51
	$template->set_var('DISPLAY_ADDONS', 'display:none;');
52
}
53
if($admin->get_permission('access') != true)
54
{
55
	$template->set_var('DISPLAY_ACCESS', 'display:none;');
56
}
57
if($admin->get_permission('settings') != true)
58
{
59
	$template->set_var('DISPLAY_SETTINGS', 'display:none;');
60
}
61
if($admin->get_permission('admintools') != true)
62
{
63
	$template->set_var('DISPLAY_ADMINTOOLS', 'display:none;');
64
}
65

  
66
// Check if installation directory still exists
67
if(file_exists(WB_PATH.'/install/')) {
68
	// Check if user is part of Adminstrators group
69
	if(in_array(1, $admin->get_groups_id()))
70
    {
71
		$template->set_var('WARNING', $MESSAGE['START']['INSTALL_DIR_EXISTS'].'<br />'.'upgrade-script.php '.$TEXT['DELETE']);
72
	} else {
73
		$template->set_var('DISPLAY_WARNING', 'display:none;');
74
	}
75
} else {
76
	$template->set_var('DISPLAY_WARNING', 'display:none;');
77
}
78

  
79
// Insert "Add-ons" section overview (pretty complex compared to normal)
80
$addons_overview = $TEXT['MANAGE'].' ';
81
$addons_count = 0;
82
if($admin->get_permission('modules') == true)
83
{
84
	$addons_overview .= '<a href="'.ADMIN_URL.'/modules/index.php">'.$MENU['MODULES'].'</a>';
85
	$addons_count = 1;
86
}
87
if($admin->get_permission('templates') == true)
88
{
89
	if($addons_count == 1) { $addons_overview .= ', '; }
90
	$addons_overview .= '<a href="'.ADMIN_URL.'/templates/index.php">'.$MENU['TEMPLATES'].'</a>';
91
	$addons_count = 1;
92
}
93
if($admin->get_permission('languages') == true)
94
{
95
	if($addons_count == 1) { $addons_overview .= ', '; }
96
	$addons_overview .= '<a href="'.ADMIN_URL.'/languages/index.php">'.$MENU['LANGUAGES'].'</a>';
97
}
98

  
99
// Insert "Access" section overview (pretty complex compared to normal)
100
$access_overview = $TEXT['MANAGE'].' ';
101
$access_count = 0;
102
if($admin->get_permission('users') == true) {
103
	$access_overview .= '<a href="'.ADMIN_URL.'/users/index.php">'.$MENU['USERS'].'</a>';
104
	$access_count = 1;
105
}
106
if($admin->get_permission('groups') == true) {
107
	if($access_count == 1) { $access_overview .= ', '; }
108
	$access_overview .= '<a href="'.ADMIN_URL.'/groups/index.php">'.$MENU['GROUPS'].'</a>';
109
	$access_count = 1;
110
}
111

  
112
// Insert section names and descriptions
113
$template->set_var(array(
114
								'PAGES' => $MENU['PAGES'],
115
								'MEDIA' => $MENU['MEDIA'],
116
								'ADDONS' => $MENU['ADDONS'],
117
								'ACCESS' => $MENU['ACCESS'],
118
								'PREFERENCES' => $MENU['PREFERENCES'],
119
								'SETTINGS' => $MENU['SETTINGS'],
120
								'ADMINTOOLS' => $MENU['ADMINTOOLS'],
121
								'HOME_OVERVIEW' => $OVERVIEW['START'],
122
								'PAGES_OVERVIEW' => $OVERVIEW['PAGES'],
123
								'MEDIA_OVERVIEW' => $OVERVIEW['MEDIA'],
124
								'ADDONS_OVERVIEW' => $addons_overview,
125
								'ACCESS_OVERVIEW' => $access_overview,
126
								'PREFERENCES_OVERVIEW' => $OVERVIEW['PREFERENCES'],
127
								'SETTINGS_OVERVIEW' => $OVERVIEW['SETTINGS'],
128
								'ADMINTOOLS_OVERVIEW' => $OVERVIEW['ADMINTOOLS']
129
								)
130
						);
131

  
132
// Parse template object
133
$template->parse('main', 'main_block', false);
134
$template->pparse('output', 'page');
135

  
136
// Print admin footer
137
$admin->print_footer();
138

  
139 139
?>
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.RC5');
55
if(!defined('REVISION')) define('REVISION', '1395');
55
if(!defined('REVISION')) define('REVISION', '1397');
56 56

  
57 57
?>
branches/2.8.x/wb/framework/class.wb.php
352 352
	function print_success( $message, $redirect = 'index.php' ) {
353 353
	    global $TEXT;
354 354
	    // fetch redirect timer for sucess messages from settings table
355
	    $redirect_timer = ((defined( 'REDIRECT_TIMER' )) && (REDIRECT_TIMER >= 1500)) ? REDIRECT_TIMER : 0;
355
	    $redirect_timer = ((defined( 'REDIRECT_TIMER' )) && (REDIRECT_TIMER <= 10000)) ? REDIRECT_TIMER : 0;
356 356
	    // add template variables
357 357
	    $tpl = new Template( THEME_PATH.'/templates' );
358 358
	    $tpl->set_file( 'page', 'success.htt' );
......
363 363
	    $tpl->set_var( 'REDIRECT_TIMER', $redirect_timer );
364 364
	    $tpl->set_var( 'NEXT', $TEXT['NEXT'] );
365 365
	    $tpl->set_var( 'BACK', $TEXT['BACK'] );
366
	    if ($redirect_timer == 0) {
366
	    if ($redirect_timer == -1) {
367 367
	        $tpl->set_block( 'show_redirect', '' );
368 368
	    }
369 369
	    else {

Also available in: Unified diff