Project

General

Profile

« Previous | Next » 

Revision 1728

Added by Dietmar about 12 years ago

! change redirect logic for registered pages

View differences:

branches/2.8.x/CHANGELOG
13 13

  
14 14

  
15 15

  
16
30 Aug-2012 Build 1728 Dietmar Woellbrink (Luisehahne)
17
! change redirect logic for registered pages
16 18
30 Aug-2012 Build 1727 Dietmar Woellbrink (Luisehahne)
17 19
# fixed upgrading group systempermission by upgrading WebsiteBaker
18 20
! set svn properties /media/upload.php
branches/2.8.x/wb/admin/skel/themes/htt/login.htt
1
<!-- BEGIN main_block -->
2
<!-- BEGIN message_block -->
3
{MESSAGE_VALUE}
4
<!-- END message_block -->
5

  
6
<hr />
7
<form class="login-box" action="{ACTION_URL}" method="post">
8
	<input type="hidden" name="action" value="login" />
9
	<input type="hidden" name="username_fieldname" value="{USER_FIELDNAME}" />
10
	<input type="hidden" name="password_fieldname" value="{PASSWORD_FIELDNAME}" />
11
	<input type="hidden" name="redirect" value="{REDIRECT_URL}" />
12

  
13
<table summary="" style="width: 60%; font-size: 1em;">
14
		<tr>
15
			<td height="10" colspan="2" style="text-align: center;"><h1>{TEXT_LOGIN}</h1></td>
16
		</tr>
17
		<tr>
18
			<td height="40" style="text-align: center;" colspan="2">
19
			<strong style="text-align: center;">{THISAPP_MESSAGE_VALUE}</strong>
20
			</td>
21
		</tr>
22
<tr>
23
	<td style="width:100px">{TEXT_USERNAME}:</td>
24
	<td class="value_input">
25
		<input type="text" name="{USER_FIELDNAME}" maxlength="30" style="width:220px;"/>
26
    	<script type="text/javascript">
27
    	// document.login.{USER_FIELDNAME}.focus();
28
    	var ref= document.getElementById("{USER_FIELDNAME}");
29
    	if (ref) ref.focus();
30
    	</script>
31
	</td>
32
</tr>
33
<tr>
34
	<td style="width:100px">{TEXT_PASSWORD}:</td>
35
	<td class="value_input">
36
		<input type="password" name="{PASSWORD_FIELDNAME}" maxlength="30" style="width:220px;"/>
37
	</td>
38
</tr>
39
<!-- BEGIN show_smart_login_block -->
40
<tr>
41
	<td>&nbsp;</td>
42
	<td>
43
		<input type="checkbox" name="remember" id="remember" value="true"/>
44
		<label for="remember">{TEXT_REMEMBER_ME}</label>
45
	</td>
46
</tr>
47
<!-- END show_smart_login_block -->
48
<tr>
49
	<td colspan="2" style="text-align: center;">
50
		<input type="submit" name="submit" value="{TEXT_LOGIN}" style="padding: 3px;"  />
51
		<input type="reset" name="reset" value="{TEXT_RESET}" style="padding: 3px;"  />
52
	<button type="button" value="cancel" onclick="javascript:window.location = '{WB_URL}/';" style="padding: 3px;" >{TEXT_CANCEL}</button>
53
	</td>
54
</tr>
55
<tr>
56
	<td colspan="2" style="text-align: center;">
57
	<p class="link"><a href="{FORGOT_URL}">{TEXT_FORGOTTEN_DETAILS}</a></p>
58
	</td>
59
</tr>
60
</table>
61
</form>
62
<!-- END main_block -->
0 63

  
branches/2.8.x/wb/admin/skel/themes/htt/forgot.htt
1
<!-- BEGIN main_block -->
2
<!-- BEGIN message_block -->
3
{MESSAGE_VALUE}
4
<!-- END message_block -->
5

  
6
<hr />
7
<form class="forgot-box" action="{ACTION_URL}" method="post">
8
	<input type="hidden" name="action" value="forgot" />
9
	<input type="hidden" name="url" value="{URL}" />
10

  
11
<table summary="" style="width: 60%; font-size: 1em;">
12
<tr>
13
	<td height="10" colspan="2" style="text-align: center;"><h1>{MENU_FORGOT}</h1></td>
14
</tr>
15
<tr>
16
	<td height="40" style="text-align: center;" colspan="2">
17
	<strong style="text-align: center;">{THISAPP_MESSAGE_VALUE}</strong>
18
	</td>
19
</tr>
20
		<tr>
21
			<td height="10" colspan="2">&nbsp;</td>
22
		</tr>
23
<tr>
24
	<td style="width:100px">{TEXT_EMAIL}:</td>
25
	<td class="value_input">
26
		<input type="text" name="email" maxlength="255" style="width:220px;"/>
27
	</td>
28
</tr>
29
		<tr>
30
			<td height="10" colspan="2">&nbsp;</td>
31
		</tr>
32
<tr>
33
	<td colspan="2" style="text-align: center;">
34
		<input type="submit" name="submit" value="{TEXT_SEND_DETAILS}" style="padding: 3px;"  />
35
		<input type="reset" name="reset" value="{TEXT_RESET}" style="padding: 3px;"  />
36
	<button type="button" value="cancel" onclick="javascript:window.location = '{WB_URL}/';" style="padding: 3px;" >{TEXT_CANCEL}</button>
37
	</td>
38
</tr>
39
<tr>
40
	<td colspan="2" style="text-align: center;">
41
	<p class="link"><a href="{LOGIN_URL}">{TEXT_NEED_TO_LOGIN}</a></p>
42
	</td>
43
</tr>
44
</table>
45
</form>
46
<!-- END main_block -->
0 47

  
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', '1727');
54
if(!defined('REVISION')) define('REVISION', '1728');
55 55
if(!defined('SP')) define('SP', '');
branches/2.8.x/wb/account/login_form.php
42 42

  
43 43
$thisApp->redirect_url = (isset($thisApp->redirect_url) && ($thisApp->redirect_url!='')  ? $thisApp->redirect_url : $_SESSION['HTTP_REFERER'] );
44 44

  
45
//print '<pre style="text-align: left;"><strong>function '.__FUNCTION__.'( '.''.' );</strong>  basename: '.basename(__FILE__).'  line: '.__LINE__.' -> <br />';
46
//print_r( $thisApp->redirect_url ); print '</pre>';
47

  
45 48
// set template file and assign module and template block
46 49
	$oTpl = new Template(dirname(__FILE__).'/htt','keep');
47 50
	$oTpl->set_file('page', 'login.htt');
branches/2.8.x/wb/account/forgot.php
3 3
 *
4 4
 * @category        frontend
5 5
 * @package         account
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2011, Website Baker Org. e.V.
6
 * @author          Ryan Djurovich,WebsiteBaker Project
7
 * @copyright       2009-2012, WebsiteBaker Org. e.V.
9 8
 * @link			http://www.websitebaker2.org/
10 9
 * @license         http://www.gnu.org/licenses/gpl.html
11 10
 * @platform        WebsiteBaker 2.8.x
branches/2.8.x/wb/account/login.php
53 53
// Create new login app
54 54
$requestMethod = '_'.strtoupper($_SERVER['REQUEST_METHOD']);
55 55
$redirect  = strip_tags(isset(${$requestMethod}['redirect']) ? ${$requestMethod}['redirect'] : '');
56
$redirect = ((isset($_SERVER['HTTP_REFERER']) && empty($redirect)) ?  $_SERVER['HTTP_REFERER'] : $redirect);
56
//$redirect = ( (empty($redirect)) ?  $_SERVER['HTTP_REFERER'] : $redirect);
57 57
$_SESSION['HTTP_REFERER'] = str_replace(WB_URL,'',$redirect);
58 58

  
59 59
$loginUrl  = WB_URL.'/account/login.php';
60 60
$loginUrl .= (!empty($redirect) ? '?redirect=' .$_SESSION['HTTP_REFERER'] : '');
61 61

  
62
//print '<pre style="text-align: left;"><strong>function '.__FUNCTION__.'( '.''.' );</strong>  basename: '.basename(__FILE__).'  line: '.__LINE__.' -> <br />';
63
//print_r( $redirect ); print '</pre>';
64

  
62 65
$ThemeUrl  = WB_URL.$wb->correct_theme_source('warning.html');
63 66
// Setup template object, parse vars to it, then parse it
64 67
$ThemePath = realpath(WB_PATH.$wb->correct_theme_source('loginBox.htt'));
branches/2.8.x/wb/account/htt/login.htt
49 49
	<td colspan="2" style="text-align: center;">
50 50
		<input type="submit" name="submit" value="{TEXT_LOGIN}" style="padding: 3px;"  />
51 51
		<input type="reset" name="reset" value="{TEXT_RESET}" style="padding: 3px;"  />
52
	<button type="button" value="cancel" onclick="javascript:window.location = '{HTTP_REFERER}';" style="padding: 3px;" >{TEXT_CANCEL}</button>
52
	<button type="button" value="cancel" onclick="javascript:window.location = '{WB_URL}/';" style="padding: 3px;" >{TEXT_CANCEL}</button>
53 53
	</td>
54 54
</tr>
55 55
<tr>
branches/2.8.x/wb/account/htt/forgot.htt
33 33
	<td colspan="2" style="text-align: center;">
34 34
		<input type="submit" name="submit" value="{TEXT_SEND_DETAILS}" style="padding: 3px;"  />
35 35
		<input type="reset" name="reset" value="{TEXT_RESET}" style="padding: 3px;"  />
36
	<button type="button" value="cancel" onclick="javascript:window.location = '{HTTP_REFERER}';" style="padding: 3px;" >{TEXT_CANCEL}</button>
36
	<button type="button" value="cancel" onclick="javascript:window.location = '{WB_URL}/';" style="padding: 3px;" >{TEXT_CANCEL}</button>
37 37
	</td>
38 38
</tr>
39 39
<tr>
branches/2.8.x/wb/account/forgot_form.php
26 26
// Check if the user has already submitted the form, otherwise show it
27 27
$message = $MESSAGE['FORGOT_PASS_NO_DATA'];
28 28
$errMsg ='';
29

  
29 30
$redirect_url = (isset($redirect_url) && ($redirect_url!='')  ? $redirect_url : $_SESSION['HTTP_REFERER'] );
31

  
32
//print '<pre style="text-align: left;"><strong>function '.__FUNCTION__.'( '.''.' );</strong>  basename: '.basename(__FILE__).'  line: '.__LINE__.' -> <br />';
33
//print_r( $redirect_url ); print '</pre>';
34

  
30 35
if(isset($_POST['email']) && $_POST['email'] != "" )
31 36
{
32 37
	$email = strip_tags($_POST['email']);
......
123 128
		'ACTION_URL' => WB_URL.'/account/forgot.php',
124 129
		'LOGIN_URL' => WB_URL.'/account/login.php',
125 130
		'REDIRECT_URL' => $redirect_url,
131
		'URL' => $redirect_url,
126 132
		'WB_URL' => WB_URL,
127 133
		'THEME_URL' => THEME_URL,
128 134
		'HTTP_REFERER' => $_SESSION['HTTP_REFERER'],
branches/2.8.x/wb/framework/class.frontend.php
190 190
			// Page keywords
191 191
			$this->page_keywords=$this->page['keywords'];
192 192
			// Page link
193

  
194
            $bCanRedirect = ($this->visibility == 'registered' || $this->visibility == 'privat');
195

  
193 196
			$this->link=$this->page_link($this->page['link']);
197

  
194 198
			$_SESSION['PAGE_ID'] = $this->page_id;
195
            $bCanRedirect = ($this->visibility == 'registered' || $this->visibility == 'privat');
199

  
196 200
			$_SESSION['HTTP_REFERER'] = $bCanRedirect != true ? $this->link : WB_URL;
201
            $_SESSION['HTTP_REFERER'] = !$this->is_authenticated() ? $this->link : $_SESSION['HTTP_REFERER'];
197 202

  
198 203
		// End code to set details as either variables of constants
199 204
		}

Also available in: Unified diff