Project

General

Profile

« Previous | Next » 

Revision 1527

Added by Dietmar almost 13 years ago

fix redirect login

View differences:

branches/2.8.x/CHANGELOG
13 13
=========================== add small Features 2.8.2 ==========================
14 14

  
15 15
----------------------------------- Fixes 2.8.2 --------------------------------
16
20 Nov-2011 Build 1527 Dietmar Woellbrink (Luisehahne)
17
# fix redirect login
16 18
20 Nov-2011 Build 1526 Dietmar Woellbrink (Luisehahne)
17 19
# typofix in BG and RU
18 20
15 Nov-2011 Build 1525 Dietmar Woellbrink (Luisehahne)
branches/2.8.x/wb/account/login_form.php
38 38
$page_id = !empty($_SESSION['PAGE_ID']) ? $_SESSION['PAGE_ID'] : 0;
39 39
$_SESSION['PAGE_LINK'] = get_page_link( $page_id );
40 40
if(!file_exists($_SESSION['PAGE_LINK'])) {$_SESSION['PAGE_LINK'] = WB_URL.'/'; }
41
$thisApp->redirect_url = $_SESSION['HTTP_REFERER'] = page_link($_SESSION['PAGE_LINK']);
42

  
41
$_SESSION['HTTP_REFERER'] = $_SESSION['PAGE_LINK'];
42
$thisApp->redirect_url = (isset($thisApp->redirect_url) ? $thisApp->redirect_url : $_SESSION['PAGE_LINK'])
43 43
?>
44 44
<div style="margin: 1em auto;">
45 45
	<button type="button" value="cancel" onClick="javascript: window.location = '<?php print $_SESSION['HTTP_REFERER'] ?>';"><?php print $TEXT['CANCEL'] ?></button>
......
49 49
<br />
50 50
<br />
51 51

  
52
<form action="<?php echo WB_URL.'/account/login.php'; ?>" method="post">
53
<p style="display:none;"><input type="hidden" name="username_fieldname" value="<?php echo $username_fieldname; ?>" /></p>
54
<p style="display:none;"><input type="hidden" name="password_fieldname" value="<?php echo $password_fieldname; ?>" /></p>
55
<p style="display:none;"><input type="hidden" name="redirect" value="<?php echo $thisApp->redirect_url;?>" /></p>
52
<form class="login-box" action="<?php echo WB_URL.'/account/login.php'; ?>" method="post">
53
<input type="hidden" name="username_fieldname" value="<?php echo $username_fieldname; ?>" />
54
<input type="hidden" name="password_fieldname" value="<?php echo $password_fieldname; ?>" />
55
<input type="hidden" name="redirect" value="<?php echo $thisApp->redirect_url;?>" />
56 56

  
57 57
<table cellpadding="5" cellspacing="0" border="0" width="90%">
58 58
<tr>
branches/2.8.x/wb/modules/droplets/example/LoginBox.php
2 2
//:Use: [[LoginBox?redirect=url]]
3 3
//:Absolute or relative url possible
4 4
//:Remember to enable frontend login in your website settings.
5
 
5

  
6 6
	global $wb,$page_id,$TEXT, $MENU, $HEADING;
7 7

  
8 8
	$return_value = '<div class="login-box">'."\n";
......
69 69

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

  
75 75
	if ( ( FRONTEND_LOGIN == 'enabled') &&
76 76
		    ( VISIBILITY != 'private') &&

Also available in: Unified diff