Project

General

Profile

« Previous | Next » 

Revision 1508

Added by Dietmar about 13 years ago

fixed print_error exit in frontend account

View differences:

branches/2.8.x/CHANGELOG
12 12

  
13 13
=============================== FEATURES FREEZE ================================
14 14
----------------------------------- Fixes 2.8.2 --------------------------------
15
07 Sep-2011 Build 1508 Dietmar Woellbrink (Luisehahne)
16
# fixed print_error exit in frontend account
15 17
06 Sep-2011 Build 1507 Dietmar Woellbrink (Luisehahne)
16 18
# fixed field_remove
17 19
26 Aug-2011 Build 1506 Werner v.d.Decken(DarkViper)
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');
55
if(!defined('REVISION')) define('REVISION', '1507');
55
if(!defined('REVISION')) define('REVISION', '1508');
branches/2.8.x/wb/account/login_form.php
21 21

  
22 22
$username_fieldname = 'username';
23 23
$password_fieldname = 'password';
24
	
24

  
25 25
if(defined('SMART_LOGIN') AND SMART_LOGIN == 'enabled') {
26 26
	// Generate username field name
27 27
	$username_fieldname = 'username_';
......
34 34
		$password_fieldname .= $temp[$i];
35 35
	}
36 36
}
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
$thisApp->redirect_url = $_SESSION['HTTP_REFERER'] = page_link($_SESSION['PAGE_LINK']);
42

  
37 43
?>
44
<div style="margin: 1em auto;">
45
	<button type="button" value="cancel" onClick="javascript: window.location = '<?php print $_SESSION['HTTP_REFERER'] ?>';"><?php print $TEXT['CANCEL'] ?></button>
46
</div>
38 47
<h1>&nbsp;Login</h1>
39 48
&nbsp;<?php echo $thisApp->message; ?>
40 49
<br />
......
43 52
<form action="<?php echo WB_URL.'/account/login.php'; ?>" method="post">
44 53
<p style="display:none;"><input type="hidden" name="username_fieldname" value="<?php echo $username_fieldname; ?>" /></p>
45 54
<p style="display:none;"><input type="hidden" name="password_fieldname" value="<?php echo $password_fieldname; ?>" /></p>
46
<p style="display:none;"><input type="hidden" name="url" value="<?php echo $thisApp->redirect_url;?>" /></p>
55
<p style="display:none;"><input type="hidden" name="redirect" value="<?php echo $thisApp->redirect_url;?>" /></p>
47 56

  
48 57
<table cellpadding="5" cellspacing="0" border="0" width="90%">
49 58
<tr>
branches/2.8.x/wb/account/preferences.php
28 28
	}
29 29
}
30 30

  
31
require_once(WB_PATH.'/framework/class.wb.php');
31
require_once(WB_PATH.'/framework/class.frontend.php');
32 32
$wb_inst = new wb();
33 33
if ($wb_inst->is_authenticated()==false) {
34 34
	header('Location: '.WB_URL.'/account/login.php');
35 35
	exit(0);
36 36
}
37 37

  
38
$page_id = !empty($_SESSION['PAGE_ID']) ? $_SESSION['PAGE_ID'] : 0;
39

  
38 40
// Required page details
39
$page_id = 0;
41
/* */
42
// $page_id = 0;
40 43
$page_description = '';
41 44
$page_keywords = '';
42
define('PAGE_ID', 0);
45
define('PAGE_ID', $page_id);
43 46
define('ROOT_PARENT', 0);
44 47
define('PARENT', 0);
45 48
define('LEVEL', 0);
49

  
46 50
define('PAGE_TITLE', $MENU['PREFERENCES']);
47 51
define('MENU_TITLE', $MENU['PREFERENCES']);
48 52
define('MODULE', '');
49 53
define('VISIBILITY', 'public');
50 54

  
51
// Set the page content include file
52
if(isset($_POST['current_password']) AND isset($_POST['new_password'])) {
53
	define('PAGE_CONTENT', WB_PATH.'/account/password.php');
54
} elseif(isset($_POST['current_password']) AND isset($_POST['email'])) {
55
	define('PAGE_CONTENT', WB_PATH.'/account/email.php');
56
} elseif(isset($_POST['display_name'])) {
57
	define('PAGE_CONTENT', WB_PATH.'/account/details.php');
58
} else {
59
	define('PAGE_CONTENT', WB_PATH.'/account/preferences_form.php');
60
}
61

  
55
define('PAGE_CONTENT', WB_PATH.'/account/preferences_form.php');
62 56
// Include the index (wrapper) file
63 57
require(WB_PATH.'/index.php');
branches/2.8.x/wb/account/password.php
19 19
// Must include code to stop this file being access directly
20 20
if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
21 21

  
22
// Get the values entered
23
$current_password = $_POST['current_password'];
24
$new_password = $_POST['new_password'];
25
$new_password2 = $_POST['new_password2'];
26

  
27
// Create a javascript back link
28
$js_back = WB_URL.'/account/preferences.php';
29
/*
30
if (!$wb->checkFTAN())
31
{
32
	$wb->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], $js_back, false);
33
	exit();
34
}
35
*/
22
// Get entered values
23
	$current_password = $wb->get_post('current_password');
24
	$new_password = $wb->get_post('new_password');
25
	$new_password2 = $wb->get_post('new_password2');
36 26
// Get existing password
37
// $database = new database();
38
$query = "SELECT user_id FROM ".TABLE_PREFIX."users WHERE user_id = '".$wb->get_user_id()."' AND password = '".md5($current_password)."'";
39
$results = $database->query($query);
40

  
27
	$sql = "SELECT `user_id` FROM `".TABLE_PREFIX."users` WHERE `user_id` = ".$wb->get_user_id()." AND `password` = '".md5($current_password)."'";
28
	$rowset = $database->query($sql);
41 29
// Validate values
42
if($results->numRows() == 0) {
43
	$wb->print_error($MESSAGE['PREFERENCES']['CURRENT_PASSWORD_INCORRECT'], $js_back, false);
44
}
45

  
46
if(strlen($new_password) < 3) {
47
	$wb->print_error($MESSAGE['USERS']['PASSWORD_TOO_SHORT'], $js_back, false);
48
}
49
if($new_password != $new_password2) {
50
	$wb->print_error($MESSAGE['USERS']['PASSWORD_MISMATCH'], $js_back, false);
51
}
52

  
30
	if($rowset->numRows() == 0) {
31
		$error[] = $MESSAGE['PREFERENCES']['CURRENT_PASSWORD_INCORRECT'];
32
	}else {
33
		if(strlen($new_password) < 3) {
34
			$error[] = $MESSAGE['USERS']['PASSWORD_TOO_SHORT'];
35
		}else {
36
			if($new_password != $new_password2) {
37
				$error[] = $MESSAGE['USERS']['PASSWORD_MISMATCH'];
38
			}else {
53 39
// MD5 the password
54
$md5_password = md5($new_password);
55

  
40
				$md5_password = md5($new_password);
56 41
// Update the database
57
// $database = new database();
58
$query = "UPDATE ".TABLE_PREFIX."users SET password = '$md5_password' WHERE user_id = '".$wb->get_user_id()."'";
59
$database->query($query);
60
if($database->is_error()) {
61
	$wb->print_error($database->get_error, $js_back, false);
62
} else {
63
	$wb->print_success($MESSAGE['PREFERENCES']['PASSWORD_CHANGED']);
64
}
42
				$sql = "UPDATE `".TABLE_PREFIX."users` SET `password` = '".$md5_password."' WHERE `user_id` = ".$wb->get_user_id();
43
				$database->query($sql);
44
				if($database->is_error()) {
45
					$error[] = $database->get_error();
46
				} else {
47
					$success[] = $MESSAGE['PREFERENCES']['PASSWORD_CHANGED'];
48
				}
49
			}
50
		}
51
	}
branches/2.8.x/wb/account/signup.php
46 46
	$load_language = false;
47 47
}
48 48

  
49
require_once(WB_PATH.'/framework/class.frontend.php');
50
$wb_inst = new wb();
51
$page_id = !empty($_SESSION['PAGE_ID']) ? $_SESSION['PAGE_ID'] : 0;
49 52

  
50 53
// Required page details
51
$page_id = 0;
54
// $page_id = 0;
52 55
$page_description = '';
53 56
$page_keywords = '';
54
define('PAGE_ID', 0);
57
define('PAGE_ID', $page_id);
55 58
define('ROOT_PARENT', 0);
56 59
define('PARENT', 0);
57 60
define('LEVEL', 0);
......
72 75

  
73 76
// Include the index (wrapper) file
74 77
require(WB_PATH.'/index.php');
75

  
76
?>
branches/2.8.x/wb/account/login.php
29 29
	}
30 30
}
31 31

  
32
require_once(WB_PATH.'/framework/class.frontend.php');
33
$wb_inst = new wb();
34
$page_id = !empty($_SESSION['PAGE_ID']) ? $_SESSION['PAGE_ID'] : 0;
35

  
32 36
// Required page details
33
$page_id = 0;
37
// $page_id = 0;
34 38
$page_description = '';
35 39
$page_keywords = '';
36
define('PAGE_ID', 0);
40
define('PAGE_ID', $page_id);
37 41
define('ROOT_PARENT', 0);
38 42
define('PARENT', 0);
39 43
define('LEVEL', 0);
......
76 80

  
77 81
// Include the index (wrapper) file
78 82
require(WB_PATH.'/index.php');
79

  
branches/2.8.x/wb/account/languages/EN.php
1
<?php
2
/**
3
  Module developed for the Open Source Content Management System Website Baker (http://websitebaker.org)
4
  Copyright (C) 2008, ISTeam, Werner von der Decken
5
  Contact me: wkl(at)isteam.de, http://isteam.de
6

  
7
  This module is free software. You can redistribute it and/or modify it
8
  under the terms of the GNU General Public License  - version 2 or later,
9
  as published by the Free Software Foundation: http://www.gnu.org/licenses/gpl.html.
10

  
11
  This module is distributed in the hope that it will be useful,
12
  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
  GNU General Public License for more details.
15

  
16
 -----------------------------------------------------------------------------------------
17
  ENGLISH LANGUAGE FILE FOR THE PREFERENCES MODULE
18
 -----------------------------------------------------------------------------------------
19
	UPDATE HISTORY:
20
	Werner von der Decken; 17.05.2008
21
	 + initial release of the English language file
22
 -----------------------------------------------------------------------------------------
23
**/
24
// array for all language dependen text outputs in the front- and backend
25
// Note: stick to the naming convention: $MOD_MODULE_DIRECTORY
26
$MOD_PREFERENCE = array(
27
	'PLEASE_SELECT' => 'please select',
28
	'DETAILS_SAVED'	=> 'details successfully saved',
29
	'SAVE_SETTINGS' => 'save details',
30
	'SAVE_EMAIL'    => 'save email',
31
	'SAVE_PASSWORD' => 'save password',
32
);
33

  
34
?>
0 35

  
branches/2.8.x/wb/account/languages/DE.php
1
<?php
2
/**
3
  Module developed for the Open Source Content Management System Website Baker (http://websitebaker.org)
4
  Copyright (C) 2008, ISTeam, Werner von der Decken
5
  Contact me: wkl(at)isteam.de, http://isteam.de
6

  
7
  This module is free software. You can redistribute it and/or modify it
8
  under the terms of the GNU General Public License  - version 2 or later,
9
  as published by the Free Software Foundation: http://www.gnu.org/licenses/gpl.html.
10

  
11
  This module is distributed in the hope that it will be useful,
12
  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
  GNU General Public License for more details.
15

  
16
 -----------------------------------------------------------------------------------------
17
  DEUTSCHE SPRACHDATEI F?R DAS PREFERENCES MODUL
18
 -----------------------------------------------------------------------------------------
19
	UPDATE HISTORY:
20
	Werner von der Decken; 17.05.2008
21
	 + erstes release der Deutschen Sprachdatei
22
 -----------------------------------------------------------------------------------------
23
**/
24

  
25
// Array f?r alle sprachabh?ngigen Textausgaben im Front- und Backend
26
// Hinweis: Verwende nachfolgende Namenskonvention f?r die Sprachausgabe des Moduls: $MOD_MODULE_DIRECTORY
27
$MOD_PREFERENCE = array(
28
	'PLEASE_SELECT' => 'bitte w&auml;hlen',
29
	'DETAILS_SAVED'	=> 'allgemeine Einstellungen ge&auml;ndert',
30
	'SAVE_SETTINGS' => 'Einstellungen speichern',
31
	'SAVE_EMAIL' => 'Email speichern',
32
	'SAVE_PASSWORD' => 'Passwort speichern',
33
);
34
?>
0 35

  
branches/2.8.x/wb/account/preferences_form.php
16 16
 *
17 17
 */
18 18

  
19
// Must include code to stop this file being access directly
20
if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
19
// prevent this file from being accesses directly
20
if(defined('WB_PATH') == false) {	exit("Cannot access this file directly"); }
21 21

  
22
?>
22
	if($wb->is_authenticated() === false) {
23
// User needs to login first
24
		header("Location: ".WB_URL."/account/login.php?redirect=".$wb->link);
25
		exit(0);
26
	}
23 27

  
24
<h2>&nbsp;<?php print $HEADING['MY_SETTINGS']; ?></h2>
28
$_SESSION['PAGE_LINK'] = get_page_link( $_SESSION['PAGE_ID'] );
29
$_SESSION['HTTP_REFERER'] = page_link($_SESSION['PAGE_LINK']);
25 30

  
26
<form name="user" action="<?php print WB_URL.'/account/preferences.php'; ?>" method="post" style="margin-bottom: 5px;">
27
<input type="hidden" name="user_id" value="{USER_ID}" />
28
<table cellpadding="5" cellspacing="0" border="0" width="97%">
29
<tr>
30
	<td width="140"><?php print $TEXT['DISPLAY_NAME']; ?>:</td>
31
	<td class="value_input">
32
		<input type="text" name="display_name" style="width: 380px;" maxlength="255" value="<?php print $wb->get_display_name(); ?>" />
33
	</td>
34
</tr>
35
<tr>
36
	<td><?php print $TEXT['LANGUAGE']; ?>:</td>
37
	<td>
38
		<select name="language" style="width: 380px;">
39
		<?php
40
		/**
41
		 *
42
		 *	Getting the languages from the database. (addons)
43
		 *	It's a little bit corious, but the language-shortform is
44
		 *	storred in the field "directory" ...
45
		 *
46
		 */
47
		$query  = 'SELECT * FROM `'.TABLE_PREFIX.'addons` ';
48
		$query .= 'WHERE `type` = \'language\' ORDER BY `directory`';
49
		$result = $database->query($query);
50
		if ($result) {
51
			$options_html = "";
52
			while($data = $result->fetchRow()) {
53
				$sel = ($data['directory'] == LANGUAGE) ? " selected=\"selected\" " : "";
54
				// $options_html .= "<option value=\"".$data['directory']."\" ".$sel.">".$data['name']." (".$data['directory'].")</option>\n";
55
				$options_html .= "<option value=\"".$data['directory']."\" ".$sel." style=\"background: url(".THEME_URL.'/images/flags/'.strtolower($data['directory']).".png) no-repeat center left; padding-left: 20px;\">".$data['name']." (".$data['directory'].")</option>\n";
56
			}
57
			echo $options_html;
58
		}
59
		?>
60
		</select>
61
	</td>
62
</tr>
63
<tr>
64
	<td><?php print $TEXT['TIMEZONE']; ?>:</td>
65
	<td>
66
		<select name="timezone" style="width: 380px;">
67
			<option value="-20"><?php print $TEXT['PLEASE_SELECT']; ?>...</option>
68
			<?php
69
				// Insert default timezone values
70
				require_once(ADMIN_PATH.'/interface/timezones.php');
71
				$test_time = $wb->get_timezone();
72
				$options_html = "";
73
				foreach($TIMEZONES as $hour_offset => $title) {
74
					$sel = ($test_time == $hour_offset*60*60) ? " selected=\"selected\" " : ""; 
75
					$options_html .= "<option value=\"".$hour_offset."\" ".$sel.">".$title."</option>\n";
76
				}
77
				print $options_html;
78
?>
31
// load module default language file (EN)
32
	require_once(WB_PATH .'/account/languages/EN.php');
33
// check for user defined language file, load it and override EN-Settings with
34
	if(file_exists(WB_PATH .'/account/languages/' .LANGUAGE .'.php')) {
35
		require_once(WB_PATH .'/account/languages/' .LANGUAGE .'.php');
36
	}
37
	require_once(WB_PATH.'/framework/functions-utf8.php');
38
	echo '<style type="text/css">';
39
	include(WB_PATH .'/account/frontend.css');
40
	echo "\n</style>\n";
41
	$user_time = true;
42
	require(ADMIN_PATH.'/interface/timezones.php');
43
	require(ADMIN_PATH.'/interface/date_formats.php');
44
	require(ADMIN_PATH.'/interface/time_formats.php');
45
	$error = array();
46
	$success = array();
47
	$template = new Template(WB_PATH .'/account','remove');
79 48

  
80
		</select>
81
	</td>
82
</tr>
83
<tr>
84
	<td><?php print $TEXT['DATE_FORMAT']; ?>:</td>
85
	<td>
86
		<select name="date_format" style="width: 98%;">
87
			<option value=""><?php print $TEXT['PLEASE_SELECT']; ?>...</option>
88
			<?php
89
			// Insert date format list
90
			$user_time = true;
91
			require_once(ADMIN_PATH.'/interface/date_formats.php');
92
			foreach($DATE_FORMATS AS $format => $title) {
93
				$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
94
				if($format != 'system_default') {
95
					$value = $format;
96
				} else {
97
					$value = '';
98
				}
99
				if(DATE_FORMAT == $format AND !isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) {
100
					$selected = ' selected="selected"';
101
				} elseif($format == 'system_default' AND isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) {
102
					$selected = ' selected="selected"';
103
				} else {
104
					$selected = '';
105
				}
106
				print '<option value="'.$value.'"'.$selected.'>'.$title.'</option>'."\n";
107
			}
108
			?>
109
		</select>
110
	</td>
111
</tr>
112
<tr>
113
	<td><?php print $TEXT['TIME_FORMAT']; ?>:</td>
114
	<td>
115
		<select name="time_format" style="width: 98%;">
116
			<option value=""><?php print $TEXT['PLEASE_SELECT']; ?>...</option>
117
			<?php
118
			// Insert time format list
119
			$user_time = true;
120
			require_once(ADMIN_PATH.'/interface/time_formats.php');
121
			foreach($TIME_FORMATS AS $format => $title)
122
            {
123
				$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
124
                $value = ($format != 'system_default') ? $format : '';
49
	switch($wb->get_post('action')):
50
		case 'details':
51
			require_once(WB_PATH .'/account/details.php');
52
			break;
53
		case 'email':
54
			require_once(WB_PATH .'/account/email.php');
125 55

  
126
                $selected = ((TIME_FORMAT == $format AND ! isset($_SESSION['USE_DEFAULT_TIME_FORMAT']))
127
                    OR ($format == 'system_default' AND isset($_SESSION['USE_DEFAULT_TIME_FORMAT'])))
128
                	? ' selected="selected"' : '';
56
			break;
57
		case 'password':
58
			require_once(WB_PATH .'/account/password.php');
59
			break;
60
		default:
61
			// do nothing
62
	endswitch; // switch
129 63

  
130
				print '<option value="'.$value.'"'.$selected.'>'.$title.'</option>';
64
// show template
65
	$template->set_file('page', 'template.html');
66
	$template->set_block('page', 'main_block', 'main');
67
// get existing values from database
68
	$sql = "SELECT display_name,email FROM ".TABLE_PREFIX."users WHERE user_id = '".$wb->get_user_id()."'";
69
	$rowset = $database->query($sql);
70
	if($database->is_error()) $error[] = $database->get_error();
71
	$row = $rowset->fetchRow();
72
// insert values into form
73
	$template->set_var('DISPLAY_NAME', $row['display_name']);
74
	$template->set_var('EMAIL', $row['email']);
75

  
76
// Insert language values
77
	$template->set_block('main_block', 'language_list_block', 'language_list');
78
	$sql = "SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language' order by name";
79
	$rowset = $database->query($sql);
80
	if($rowset->numRows() > 0) {
81
		while($row = $rowset->fetchRow()) {
82
			$l_codes[$row['name']] = $row['directory'];
83
			$l_names[$row['name']] = entities_to_7bit($row['name']); // sorting-problem workaround
84
		}
85
		asort($l_names);
86
		foreach($l_names as $l_name=>$v) {
87
			// Insert code and name
88
			$template->set_var(array( 'CODE' => $l_codes[$l_name], 'NAME' => $l_name ));
89
		// Check if it is selected
90
			if(LANGUAGE == $l_codes[$l_name]) {
91
				$template->set_var('SELECTED', ' selected="selected"');
92
			} else {
93
				$template->set_var('SELECTED', '');
131 94
			}
132
			?>
133
		</select>
134
	</td>
135
</tr>
136
<tr>
137
	<td>&nbsp;</td>
138
	<td>
139
		<input type="submit" name="submit" value="<?php print $TEXT['SAVE']; ?>" />
140
		<input type="reset" name="reset" value="<?php print $TEXT['RESET']; ?>" />
141
	</td>
142
</tr>
143
</table>
95
			$template->parse('language_list', 'language_list_block', true);
96
		}
97
	}
144 98

  
145
</form>
99
// Insert default timezone values
100
	$template->set_block('main_block', 'timezone_list_block', 'timezone_list');
101
	foreach($TIMEZONES AS $hour_offset => $title) {
102
		$template->set_var('VALUE', $hour_offset);
103
		$template->set_var('NAME', $title);
104
		if($wb->get_timezone() == $hour_offset*3600) {
105
			$template->set_var('SELECTED', 'selected="selected"');
106
		} else {
107
			$template->set_var('SELECTED', '');
108
		}
109
		$template->parse('timezone_list', 'timezone_list_block', true);
110
	}
146 111

  
147
<h2>&nbsp;<?php print $HEADING['MY_EMAIL']; ?></h2>
112
// Insert date format list
113
	$template->set_block('main_block', 'date_format_list_block', 'date_format_list');
114
	foreach($DATE_FORMATS AS $format => $title) {
115
		$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
116
		if($format != 'system_default') {
117
			$template->set_var('VALUE', $format);
118
		} else {
119
			$template->set_var('VALUE', '');
120
		}
121
		$template->set_var('NAME', $title);
122
		if(DATE_FORMAT == $format AND !isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) {
123
			$template->set_var('SELECTED', 'selected="selected"');
124
		} elseif($format == 'system_default' AND isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) {
125
			$template->set_var('SELECTED', 'selected="selected"');
126
		} else {
127
			$template->set_var('SELECTED', '');
128
		}
129
		$template->parse('date_format_list', 'date_format_list_block', true);
130
	}
148 131

  
149
<form name="email" action="<?php print WB_URL.'/account/preferences.php'; ?>" method="post" style="margin-bottom: 5px;">
150
<input type="hidden" name="user_id" value="{USER_ID}" />
151
<table cellpadding="5" cellspacing="0" border="0" width="97%">
152
<tr>
153
	<td width="140"><?php print $TEXT['CURRENT_PASSWORD']; ?>:</td>
154
	<td>
155
		<input type="password" name="current_password" style="width: 380px;" />
156
	</td>
157
</tr>
158
<tr>
159
	<td><?php print $TEXT['EMAIL']; ?>:</td>
160
	<td class="value_input">
161
		<input type="text" name="email" style="width: 380px;" maxlength="255" value="<?php print $wb->get_email(); ?>" />
162
	</td>
163
</tr>
164
<tr>
165
	<td>&nbsp;</td>
166
	<td>
167
		<input type="submit" name="submit" value="<?php print $TEXT['SAVE']; ?>" />
168
		<input type="reset" name="reset" value="<?php print $TEXT['RESET']; ?>" />
169
	</td>
170
</tr>
171
</table>
132
// Insert time format list
133
	$template->set_block('main_block', 'time_format_list_block', 'time_format_list');
134
	foreach($TIME_FORMATS AS $format => $title) {
135
		$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
136
		if($format != 'system_default') {
137
			$template->set_var('VALUE', $format);
138
		} else {
139
			$template->set_var('VALUE', '');
140
		}
141
		$template->set_var('NAME', $title);
142
		if(TIME_FORMAT == $format AND !isset($_SESSION['USE_DEFAULT_TIME_FORMAT'])) {
143
			$template->set_var('SELECTED', 'selected="selected"');
144
		} elseif($format == 'system_default' AND isset($_SESSION['USE_DEFAULT_TIME_FORMAT'])) {
145
			$template->set_var('SELECTED', 'selected="selected"');
146
		} else {
147
			$template->set_var('SELECTED', '');
148
		}
149
		$template->parse('time_format_list', 'time_format_list_block', true);
150
	}
151
// Insert language headings
152
	$template->set_var(array(
153
								'HEADING_MY_SETTINGS' => $HEADING['MY_SETTINGS'],
154
								'HEADING_MY_EMAIL'    => $HEADING['MY_EMAIL'],
155
								'HEADING_MY_PASSWORD' => $HEADING['MY_PASSWORD']
156
								)
157
						);
158
// Insert language text and messages
159
	$template->set_var(array(
160
								'HTTP_REFERER' => $_SESSION['HTTP_REFERER'],
161
								'TEXT_SAVE'	=> $TEXT['SAVE'],
162
								'TEXT_RESET' => $TEXT['RESET'],
163
								'TEXT_CANCEL' => $TEXT['CANCEL'],
164
								'TEXT_DISPLAY_NAME'	=> $TEXT['DISPLAY_NAME'],
165
								'TEXT_EMAIL' => $TEXT['EMAIL'],
166
								'TEXT_LANGUAGE' => $TEXT['LANGUAGE'],
167
								'TEXT_TIMEZONE' => $TEXT['TIMEZONE'],
168
								'TEXT_DATE_FORMAT' => $TEXT['DATE_FORMAT'],
169
								'TEXT_TIME_FORMAT' => $TEXT['TIME_FORMAT'],
170
								'TEXT_CURRENT_PASSWORD' => $TEXT['CURRENT_PASSWORD'],
171
								'TEXT_NEW_PASSWORD' => $TEXT['NEW_PASSWORD'],
172
								'TEXT_RETYPE_NEW_PASSWORD' => $TEXT['RETYPE_NEW_PASSWORD']
173
								)
174
						);
172 175

  
173
</form>
176
// Insert module releated language text and messages
177
	$template->set_var(array(
178
								'MOD_PREFERENCE_PLEASE_SELECT'	=> $MOD_PREFERENCE['PLEASE_SELECT'],
179
								'MOD_PREFERENCE_SAVE_SETTINGS'	=> $MOD_PREFERENCE['SAVE_SETTINGS'],
180
								'MOD_PREFERENCE_SAVE_EMAIL'			=> $MOD_PREFERENCE['SAVE_EMAIL'],
181
								'MOD_PREFERENCE_SAVE_PASSWORD'	=> $MOD_PREFERENCE['SAVE_PASSWORD'],
182
								)
183
						);
184
// Insert error and/or success messages
185
	$template->set_block('main_block', 'error_block', 'error_list');
186
	if(sizeof($error)>0){
187
		foreach($error AS $value){
188
			$template->set_var('ERROR_VALUE', $value);
189
			$template->parse('error_list', 'error_block', true);
190
		}
191
	}
174 192

  
175

  
176
<h2>&nbsp;<?php print $HEADING['MY_PASSWORD']; ?></h2>
177

  
178
<form name="user" action="<?php print WB_URL.'/account/preferences.php'; ?>" method="post">
179
<input type="hidden" name="user_id" value="{USER_ID}" />
180
<table cellpadding="5" cellspacing="0" border="0" width="97%">
181
<tr>
182
	<td width="140"><?php print $TEXT['CURRENT_PASSWORD']; ?>:</td>
183
	<td>
184
		<input type="password" name="current_password" style="width: 380px;" />
185
	</td>
186
</tr>
187
<tr>
188
	<td><?php print $TEXT['NEW_PASSWORD']; ?>:</td>
189
	<td>
190
		<input type="password" name="new_password" style="width: 380px;" />
191
	</td>
192
</tr>
193
<tr>
194
	<td><?php print $TEXT['RETYPE_NEW_PASSWORD']; ?>:</td>
195
	<td>
196
		<input type="password" name="new_password2" style="width: 380px;" />
197
	</td>
198
</tr>
199
<tr>
200
	<td>&nbsp;</td>
201
	<td>
202
		<input type="submit" name="submit" value="<?php print $TEXT['SAVE']; ?>" />
203
		<input type="reset" name="reset" value="<?php print $TEXT['RESET']; ?>" />
204
	</td>
205
</tr>
206
</table>
207

  
208
</form>
193
	$template->set_block('main_block', 'success_block', 'success_list');
194
	if(sizeof($success)!=0){
195
		foreach($success AS $value){
196
			$template->set_var('SUCCESS_VALUE', $value);
197
			$template->parse('success_list', 'success_block', true);
198
		}
199
	}
200
// Parse template for preferences form
201
	$template->parse('main', 'main_block', false);
202
	$template->pparse('output', 'page');
branches/2.8.x/wb/account/signup2.php
19 19
// Must include code to stop this file being access directly
20 20
if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
21 21

  
22
require_once(WB_PATH.'/framework/class.wb.php');
22
// require_once(WB_PATH.'/framework/class.wb.php');
23 23
$wb = new wb('Start', 'start', false, false);
24 24

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

  
25 28
// Create new database object
26 29
// $database = new database();
27 30

  
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

  
24 27
?>
25

  
28
<div style="margin: 1em auto;">
29
	<button type="button" value="cancel" onClick="javascript: window.location = '<?php print $_SESSION['HTTP_REFERER'] ?>';"><?php print $TEXT['CANCEL'] ?></button>
30
</div>
26 31
<h1>&nbsp;<?php echo $TEXT['SIGNUP']; ?></h1>
27 32

  
28 33
<form name="user" action="<?php echo WB_URL.'/account/signup.php'; ?>" method="post">
branches/2.8.x/wb/account/template.html
1
<!-- begin settings_modify.html -->
2
<!-- BEGIN main_block -->
3
<!-- BEGIN success_block -->
4
<p class="mod_preferences_success">
5
	{SUCCESS_VALUE}
6
</p>
7
<!-- END success_block -->
8
<!-- BEGIN error_block -->
9
<p class="mod_preferences_error">
10
	{ERROR_VALUE}
11
</p>
12
<!-- END error_block -->
13
<div style="margin: 1em auto;">
14
	<button type="button" value="cancel" onClick="javascript: window.location = '{HTTP_REFERER}';">{TEXT_CANCEL}</button>
15
</div>
16
<hr />
17
<form name="details" action="" method="post">
18
	<h3>{HEADING_MY_SETTINGS}</h3>
19
	<table cellpadding="5" cellspacing="0" border="0" width="100%">
20
		<tr>
21
			<td width="160">{TEXT_DISPLAY_NAME}:</td>
22
			<td>
23
				<input type="text" name="display_name" value="{DISPLAY_NAME}" style="width: 98%;" readonly="readonly" />
24
			</td>
25
		</tr>
26
		<tr>
27
			<td>{TEXT_LANGUAGE}:</td>
28
			<td>
29
				<select name="language" style="width: 98%;">
30
<!-- BEGIN language_list_block -->
31
					<option value="{CODE}"{SELECTED}>{NAME} ({CODE})</option>
32
<!-- END language_list_block -->
33
				</select>
34
			</td>
35
		</tr>
36
		<tr>
37
			<td>{TEXT_TIMEZONE}:</td>
38
			<td>
39
				<select name="timezone" style="width: 98%;">
40
					<option value="-20">{MOD_PREFERENCE_PLEASE_SELECT}</option>
41
<!-- BEGIN timezone_list_block -->
42
					<option value="{VALUE}" {SELECTED}>{NAME}</option>
43
<!-- END timezone_list_block -->
44
				</select>
45
			</td>
46
		</tr>
47
		<tr>
48
			<td>{TEXT_DATE_FORMAT}:</td>
49
			<td>
50
				<select name="date_format" style="width: 98%;">
51
					<option value="">{MOD_PREFERENCE_PLEASE_SELECT}</option>
52
<!-- BEGIN date_format_list_block -->
53
					<option value="{VALUE}" {SELECTED}>{NAME}</option>
54
<!-- END date_format_list_block -->
55
				</select>
56
			</td>
57
		</tr>
58
		<tr>
59
			<td>{TEXT_TIME_FORMAT}:</td>
60
			<td>
61
				<select name="time_format" style="width: 98%;">
62
					<option value="">{MOD_PREFERENCE_PLEASE_SELECT}</option>
63
<!-- BEGIN time_format_list_block -->
64
					<option value="{VALUE}" {SELECTED}>{NAME}</option>
65
<!-- END time_format_list_block -->
66
				</select>
67
			</td>
68
		</tr>
69
		<tr>
70
			<td>&nbsp;</td>
71
			<td>
72
				<button type="reset" name="reset" value="reset">{TEXT_RESET}</button>
73
				<button type="submit" name="action" value="details">{MOD_PREFERENCE_SAVE_SETTINGS}</button>
74
			</td>
75
		</tr>
76
	</table>
77
</form>
78
<hr />
79
<form name="email" action="" method="post">
80
	<h3>{HEADING_MY_EMAIL}</h3>
81
	<table cellpadding="5" cellspacing="0" border="0" width="100%">
82
		<tr>
83
			<td>{TEXT_EMAIL}:</td>
84
			<td>
85
				<input type="text" name="email" value="{EMAIL}" style="width: 98%;" />
86
			</td>
87
		</tr>
88
		<tr>
89
			<td width="160">{TEXT_CURRENT_PASSWORD}:</td>
90
			<td>
91
				<input type="password" name="current_password" style="width: 98%;" />
92
			</td>
93
		</tr>
94
		<tr>
95
			<td>&nbsp;</td>
96
			<td>
97
				<button type="reset" name="reset" value="reset">{TEXT_RESET}</button>
98
				<button type="submit" name="action" value="email">{MOD_PREFERENCE_SAVE_EMAIL}</button>
99
			</td>
100
		</tr>
101
	</table>
102
</form>
103
<hr />
104
<form name="password" action="" method="post">
105
	<h3>{HEADING_MY_PASSWORD}</h3>
106
	<table cellpadding="5" cellspacing="0" border="0" width="100%">
107
		<tr>
108
			<td width="160">{TEXT_CURRENT_PASSWORD}:</td>
109
			<td>
110
				<input type="password" name="current_password" style="width: 98%;" />
111
			</td>
112
		</tr>
113
		<tr>
114
			<td width="160">{TEXT_NEW_PASSWORD}:</td>
115
			<td>
116
				<input type="password" name="new_password" style="width: 98%;" />
117
			</td>
118
		</tr>
119
		<tr>
120
			<td width="160">{TEXT_RETYPE_NEW_PASSWORD}:</td>
121
			<td>
122
				<input type="password" name="new_password2" style="width: 98%;" />
123
			</td>
124
		</tr>
125
		<tr>
126
			<td>&nbsp;</td>
127
			<td>
128
				<button type="reset" name="reset" value="reset">{TEXT_RESET}</button>
129
				<button type="submit" name="action" value="password">{MOD_PREFERENCE_SAVE_PASSWORD}</button>
130
			</td>
131
		</tr>
132
	</table>
133
</form>
134
<div style="margin: 1em auto;">
135
	<button type="button" value="cancel" onClick="javascript: window.location = '{HTTP_REFERER}';">{TEXT_CANCEL}</button>
136
</div>
137
<!-- END main_block -->
138
<!-- end settings_modify.html -->
0 139

  

Also available in: Unified diff