Project

General

Profile

« Previous | Next » 

Revision 1599

Added by Dietmar over 12 years ago

update all used files with redirect_url to $_SESSION['HTTP_REFERER']

View differences:

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

  
13 13
=========================== add small Features 2.8.2 ==========================
14
06 Feb-2012 Build 1599 Dietmar Woellbrink (Luisehahne)
15
! update all used files with redirect_url to $_SESSION['HTTP_REFERER']
14 16
06 Feb-2012 Build 1598 Dietmar Woellbrink (Luisehahne)
15 17
# fixed undefined fragment index in initialize.php 
16 18
! add $_SESSION['HTTP_REFERER'] storing active pagelink if page_id != 0
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.2');
54
if(!defined('REVISION')) define('REVISION', '1598');
54
if(!defined('REVISION')) define('REVISION', '1599');
55 55
if(!defined('SP')) define('SP', 'SP2');
branches/2.8.x/wb/account/login_form.php
35 35
	}
36 36
}
37 37

  
38
$page_id = !empty($_SESSION['PAGE_ID']) ? $_SESSION['PAGE_ID'] : 0;
39
$_SESSION['PAGE_LINK'] = get_page_link( $page_id );
40
if(!file_exists($_SESSION['PAGE_LINK'])) {$_SESSION['PAGE_LINK'] = WB_URL.'/'; }
41
$_SESSION['HTTP_REFERER'] = $_SESSION['PAGE_LINK'];
42
$thisApp->redirect_url = (isset($thisApp->redirect_url) ? $thisApp->redirect_url : $_SESSION['PAGE_LINK'])
38
$thisApp->redirect_url = (isset($thisApp->redirect_url) && ($thisApp->redirect_url!='')  ? $thisApp->redirect_url : $_SESSION['HTTP_REFERER'] );
43 39
?>
44 40
<div style="margin: 1em auto;">
45 41
	<button type="button" value="cancel" onClick="javascript: window.location = '<?php print $_SESSION['HTTP_REFERER'] ?>';"><?php print $TEXT['CANCEL'] ?></button>
branches/2.8.x/wb/account/signup.php
47 47
	$load_language = false;
48 48
}
49 49

  
50
$page_id = !empty($_SESSION['PAGE_ID']) ? $_SESSION['PAGE_ID'] : 0;
50
$page_id = (isset($_SESSION['PAGE_ID']) && ($_SESSION['PAGE_ID']!='') ? $_SESSION['PAGE_ID'] : 0);
51 51

  
52 52
// Required page details
53 53
// $page_id = 0;
branches/2.8.x/wb/account/logout.php
22 22
	setcookie('REMEMBER_KEY', '', time()-3600, '/');
23 23
}
24 24

  
25
$redirect = ((isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] != '') ?  $_SERVER['HTTP_REFERER'] : WB_URL.'/index.php');
25
$redirect = ((isset($_SESSION['HTTP_REFERER']) && $_SESSION['HTTP_REFERER'] != '') ?  $_SESSION['HTTP_REFERER'] : WB_URL.'/index.php');
26 26

  
27 27
$_SESSION['USER_ID'] = null;
28 28
$_SESSION['GROUP_ID'] = null;
branches/2.8.x/wb/account/forgot_form.php
18 18
// Must include code to stop this file being access directly
19 19
if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
20 20
// Check if the user has already submitted the form, otherwise show it
21
$message = $MESSAGE['FORGOT_PASS_NO_DATA'];
22
$errMsg ='';
21 23
if(isset($_POST['email']) && $_POST['email'] != "" )
22 24
{
23 25
	$email = strip_tags($_POST['email']);
26
	if($admin->validate_email($email) == false)
27
    {
28
		$errMsg = $MESSAGE['USERS_INVALID_EMAIL'];
29
		$email = '';
30
	} else {
24 31
// Check if the email exists in the database
25 32
	$sql  = 'SELECT `user_id`,`username`,`display_name`,`email`,`last_reset`,`password` '.
26 33
	        'FROM `'.TABLE_PREFIX.'users` '.
......
32 39
		// Check if the password has been reset in the last 2 hours
33 40
			if( (time() - (int)$results_array['last_reset']) < (2 * 3600) ) {
34 41
			// Tell the user that their password cannot be reset more than once per hour
35
				$message = $MESSAGE['FORGOT_PASS']['ALREADY_RESET'];
42
				$errMsg = $MESSAGE['FORGOT_PASS_ALREADY_RESET'];
36 43
			} else {
37 44
				require_once(WB_PATH.'/framework/PasswordHash.php');
38 45
				$pwh = new PasswordHash(0, true);
......
61 68
						       'SET `password`=\''.$old_pass.'\' '.
62 69
						       'WHERE `user_id`='.(int)$results_array['user_id'];
63 70
						$database->query($sql);
64
						$message = $MESSAGE['FORGOT_PASS_CANNOT_EMAIL'];
71
						$errMsg = $MESSAGE['FORGOT_PASS_CANNOT_EMAIL'];
65 72
					}
66 73
				}else { // Error updating database
67
					$message = $MESSAGE['RECORD_MODIFIED_FAILED'];
74
					$errMsg = $MESSAGE['RECORD_MODIFIED_FAILED'];
68 75
					if(DEBUG) {
69 76
						$message .= '<br />'.$database->get_error();
70 77
						$message .= '<br />'.$sql;
......
72 79
				}
73 80
			}
74 81
		}else { // no record found - Email doesn't exist, so tell the user
75
			$message = $MESSAGE['FORGOT_PASS_EMAIL_NOT_FOUND'];
82
			$errMsg = $MESSAGE['FORGOT_PASS_EMAIL_NOT_FOUND'];
76 83
		}
77 84
	} else { // Query failed
78
		$message = 'SystemError:: Database query failed!';
85
		$errMsg = 'SystemError:: Database query failed!';
79 86
		if(DEBUG) {
80
			$message .= '<br />'.$database->get_error();
81
			$message .= '<br />'.$sql;
87
			$errMsg .= '<br />'.$database->get_error();
88
			$errMsg .= '<br />'.$sql;
82 89
		}
83 90
	}
91
	}
84 92
} else {
85 93
	$email = '';
86 94
}
87 95

  
88
if(isset($message) && $message != '') {
89
	$message = $MESSAGE['FORGOT_PASS']['NO_DATA'];
90
	$message_color = 'FF0000';
96
if( ($errMsg=='') && ($message != '')) {
97
	// $message = $MESSAGE['FORGOT_PASS_NO_DATA'];
98
	$message_color = '000000';
91 99
} else {
92
	$message = $MESSAGE['FORGOT_PASS_NO_DATA'];
93
	$message_color = '000000';
100
	$message = $errMsg;
101
	$message_color = 'ff0000';
94 102
}
95

  
96
$page_id = (!empty($_SESSION['PAGE_ID']) ? $_SESSION['PAGE_ID'] : 0);
97
$_SESSION['PAGE_LINK'] = get_page_link( $page_id );
98
$_SESSION['HTTP_REFERER'] = (($_SESSION['PAGE_LINK']!='') ? page_link($_SESSION['PAGE_LINK']) : WB_URL);
99

  
100 103
?>
101 104
<div style="margin: 1em auto;">
102 105
	<button type="button" value="cancel" onClick="javascript: window.location = '<?php print $_SESSION['HTTP_REFERER'] ?>';"><?php print $TEXT['CANCEL'] ?></button>
......
107 110
		<table cellpadding="5" cellspacing="0" border="0" align="center" width="500">
108 111
		<tr>
109 112
			<td height="40" align="center" style="color: #<?php echo $message_color; ?>;" colspan="2">
110
			<?php echo $message; ?>
113
			<strong><?php echo $message; ?></strong>
111 114
			</td>
112 115
		</tr>
113 116
<?php if(!isset($display_form) OR $display_form != false) { ?>
branches/2.8.x/wb/account/preferences_form.php
25 25
		exit(0);
26 26
	}
27 27

  
28
$_SESSION['PAGE_LINK'] = get_page_link( $_SESSION['PAGE_ID'] );
29
$_SESSION['HTTP_REFERER'] = page_link($_SESSION['PAGE_LINK']);
30

  
31 28
// load module default language file (EN)
32 29
	require_once(WB_PATH .'/account/languages/EN.php');
33 30
// check for user defined language file, load it and override EN-Settings with
branches/2.8.x/wb/account/details.php
41 41
		$_SESSION['DISPLAY_NAME'] = $display_name;
42 42
		$_SESSION['LANGUAGE'] = $language;
43 43
		$_SESSION['TIMEZONE'] = $timezone;
44
		$_SESSION['HTTP_REFERER'] = (($_SESSION['LANGUAGE']== LANGUAGE) ? $_SESSION['HTTP_REFERER'] : WB_URL);
44 45
// Update date format
45 46
		if($date_format != '') {
46 47
			$_SESSION['DATE_FORMAT'] = $date_format;
branches/2.8.x/wb/account/signup2.php
22 22
// require_once(WB_PATH.'/framework/class.wb.php');
23 23
$wb = new wb('Start', 'start', false, false);
24 24

  
25
$page_id = (!empty($_SESSION['PAGE_ID']) ? $_SESSION['PAGE_ID'] : 0);
26
$_SESSION['PAGE_LINK'] = get_page_link( $page_id );
27
$_SESSION['HTTP_REFERER'] = (($_SESSION['PAGE_LINK']!='') ? page_link($_SESSION['PAGE_LINK']) : WB_URL);
28

  
29 25
// Get details entered
30 26
$groups_id = FRONTEND_SIGNUP;
31 27
$active = 1;
......
123 119
	$mail_message = str_replace($search, $replace, $MESSAGE['SIGNUP2']['BODY_LOGIN_INFO']);
124 120

  
125 121
	// Try sending the email
126
	if($wb->mail(SERVER_EMAIL,$mail_to,$mail_subject,$mail_message)) { 
122
	if($wb->mail(SERVER_EMAIL,$mail_to,$mail_subject,$mail_message)) {
127 123
		$display_form = false;
128 124
		$wb->print_success($MESSAGE['FORGOT_PASS']['PASSWORD_RESET'], WB_URL.'/account/login.php' );
129 125
	} else {
branches/2.8.x/wb/account/signup_form.php
21 21

  
22 22
require_once(WB_PATH.'/include/captcha/captcha.php');
23 23

  
24
$_SESSION['PAGE_LINK'] = get_page_link( $_SESSION['PAGE_ID'] );
25
$_SESSION['HTTP_REFERER'] = page_link($_SESSION['PAGE_LINK']);
26

  
27 24
?>
28 25
<div style="margin: 1em auto;">
29 26
	<button type="button" value="cancel" onClick="javascript: window.location = '<?php print $_SESSION['HTTP_REFERER'] ?>';"><?php print $TEXT['CANCEL'] ?></button>
......
50 47
	<?php }
51 48
	?>
52 49
    </div>
53
<table cellpadding="5" cellspacing="0" border="0" width="90%">
50
<table summary="" cellpadding="5" cellspacing="0" border="0" width="90%">
54 51
<tr>
55 52
	<td width="180"><?php echo $TEXT['USERNAME']; ?>:</td>
56 53
	<td class="value_input">
branches/2.8.x/wb/account/template.html
16 16
<hr />
17 17
<form name="details" action="" method="post">
18 18
	<h3>{HEADING_MY_SETTINGS}</h3>
19
	<table cellpadding="5" cellspacing="0" border="0" width="100%">
19
	<table summary="" cellpadding="5" cellspacing="0" border="0" width="100%">
20 20
		<tr>
21 21
			<td width="160">{TEXT_DISPLAY_NAME}:</td>
22 22
			<td>
......
78 78
<hr />
79 79
<form name="email" action="" method="post">
80 80
	<h3>{HEADING_MY_EMAIL}</h3>
81
	<table cellpadding="5" cellspacing="0" border="0" width="100%">
81
	<table summary="" cellpadding="5" cellspacing="0" border="0" width="100%">
82 82
		<tr>
83 83
			<td>{TEXT_EMAIL}:</td>
84 84
			<td>
......
103 103
<hr />
104 104
<form name="password" action="" method="post">
105 105
	<h3>{HEADING_MY_PASSWORD}</h3>
106
	<table cellpadding="5" cellspacing="0" border="0" width="100%">
106
	<table summary="" cellpadding="5" cellspacing="0" border="0" width="100%">
107 107
		<tr>
108 108
			<td width="160">{TEXT_CURRENT_PASSWORD}:</td>
109 109
			<td>
branches/2.8.x/wb/templates/allcss/index.php
83 83
		show_menu2(0,SM2_ROOT,SM2_CURR+1,SM2_TRIM,'<li><span class="menu-default">[ac][menu_title]</a></span>','</li>','<ul>','</ul>');
84 84
		// CODE FOR WEBSITE BAKER FRONTEND LOGIN
85 85
		if (FRONTEND_LOGIN == 'enabled' && VISIBILITY != 'private' && $wb->get_session('USER_ID') == '') {
86
			$redirect_url = ((isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] != '') ? $_SERVER['HTTP_REFERER'] : WB_URL );
87
			$redirect_url = (isset($thisApp->redirect_url) ? $thisApp->redirect_url : $redirect_url );?>
86
			$redirect_url = ((isset($_SESSION['HTTP_REFERER']) && $_SESSION['HTTP_REFERER'] != '') ? $_SESSION['HTTP_REFERER'] : WB_URL );
87
			$redirect_url = (isset($thisApp->redirect_url) ? $thisApp->redirect_url : $redirect_url );
88 88
			<!-- login form -->
89 89
			<br />
90 90
			<form name="login" id="login" action="<?php echo LOGIN_URL; ?>" method="post">
branches/2.8.x/wb/templates/round/index.php
55 55

  
56 56
<body>
57 57

  
58
<table cellpadding="0" cellspacing="0" border="0" align="center" class="main" width="750">
58
<table summary="" cellpadding="0" cellspacing="0" border="0" align="center" class="main" width="750">
59 59
<tr>
60 60
	<td colspan="2" class="header" height="80">
61 61
		<a href="<?php echo WB_URL; ?>">
62
			<img src="<?php echo TEMPLATE_DIR; ?>/images/banner.jpg" border="0" width="750" height="80" alt="<?php 
62
			<img src="<?php echo TEMPLATE_DIR; ?>/images/banner.jpg" border="0" width="750" height="80" alt="<?php
63 63
			page_title('', '[WEBSITE_TITLE]'); ?>" />
64 64
		</a>
65 65
	</td>
......
70 70
	if(SHOW_MENU) {
71 71
	?>	
72 72
	<td style="padding: 10px; background-color: #FFF;" valign="top">
73
		<table cellpadding="0" cellspacing="0" border="0" width="150" align="center" class="menu">
73
		<table summary="" cellpadding="0" cellspacing="0" border="0" width="150" align="center" class="menu">
74 74
		<tr>
75 75
			<td class="border">
76 76
				<img src="<?php echo TEMPLATE_DIR; ?>/images/menu_top.gif" border="0" alt="" />
......
94 94
		<form name="search" action="<?php echo WB_URL; ?>/search/index.php" method="get">
95 95
			<input type="hidden" name="referrer" value="<?php
96 96
				echo defined('REFERRER_ID') ? REFERRER_ID : PAGE_ID; ?>" />
97
			<table cellpadding="0" cellspacing="0" border="0" width="150" align="center" style="margin-top: 10px;">
97
			<table summary="" cellpadding="0" cellspacing="0" border="0" width="150" align="center" style="margin-top: 10px;">
98 98
				<tr>
99 99
					<td class="border">
100 100
						<img src="<?php echo TEMPLATE_DIR; ?>/images/menu_top.gif" border="0" alt="" />
......
121 121
		
122 122
<?php
123 123
		if(FRONTEND_LOGIN AND !$wb->is_authenticated() AND VISIBILITY != 'private' ) {
124
			$redirect_url = ((isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] != '') ? $_SERVER['HTTP_REFERER'] : WB_URL );
124
			$redirect_url = ((isset($_SESSION['HTTP_REFERER']) && $_SESSION['HTTP_REFERER'] != '') ? $_SESSION['HTTP_REFERER'] : WB_URL );
125 125
			$redirect_url = (isset($thisApp->redirect_url) ? $thisApp->redirect_url : $redirect_url );
126 126
?>
127 127
		<form name="login" action="<?php echo LOGIN_URL; ?>" method="post">
128 128
			<input type="hidden" name="redirect" value="<?php echo $redirect_url;?>" /></p>
129
			<table cellpadding="0" cellspacing="0" border="0" width="150" align="center" style="margin-top: 10px;">
129
			<table summary="" cellpadding="0" cellspacing="0" border="0" width="150" align="center" style="margin-top: 10px;">
130 130
			<tr>
131 131
				<td class="border">
132 132
					<img src="<?php echo TEMPLATE_DIR; ?>/images/menu_top.gif" border="0" alt="" />
......
184 184
		?>
185 185
		<form name="logout" action="<?php echo LOGOUT_URL; ?>" method="post">
186 186
			
187
			<table cellpadding="0" cellspacing="0" border="0" width="150" align="center" style="margin-top: 10px;">
187
			<table summary="" cellpadding="0" cellspacing="0" border="0" width="150" align="center" style="margin-top: 10px;">
188 188
			<tr>
189 189
				<td class="border">
190 190
					<img src="<?php echo TEMPLATE_DIR; ?>/images/menu_top.gif" border="0" alt="" />
branches/2.8.x/wb/modules/droplets/example/LoginBox.php
68 68
	}
69 69

  
70 70
// Get redirect
71
	$redirect_url = '';
72
   	$redirect_url = isset($redirect)&&($redirect!='') ? '<input type="hidden" name="url" value="'.$redirect.'" />'."\n" : $redirect_url;
73
	$redirect_url = (isset($_SERVER['HTTP_REFERER']) && ($redirect_url=='') ?  '<input type="hidden" name="url" value="'.$_SERVER['HTTP_REFERER'].'" />'."\n"  : $redirect_url );
71
	$redirect_url = ((isset($_SESSION['HTTP_REFERER']) && $_SESSION['HTTP_REFERER'] != '') ? $_SESSION['HTTP_REFERER'] : WB_URL );
72
   	$redirect_url = (isset($redirect) && ($redirect!='') ? $redirect : $redirect_url);
74 73

  
75 74
	if ( ( FRONTEND_LOGIN == 'enabled') &&
76 75
		    ( VISIBILITY != 'private') &&
77 76
		        ( $wb->get_session('USER_ID') == '')  )
78 77
	{
79 78
		$return_value .= '<form action="'.LOGIN_URL.'" method="post">'."\n";
80
		$return_value .= $redirect_url."\n";
79
		$return_value .= '<input type="hidden" name="url" value="'.$redirect_url.'" />'."\n";
81 80
    	$return_value .= '<fieldset>'."\n";
82 81
		$return_value .= '<h1>'.$TEXT['LOGIN'].'</h1>'."\n";
83 82
		$return_value .= '<label for="username">'.$TEXT['USERNAME'].':</label>'."\n";

Also available in: Unified diff