Project

General

Profile

« Previous | Next » 

Revision 1473

Added by Dietmar almost 13 years ago

found more backlinks to fix
remove not working ftan in frontend
fixed redirect in login procedure (Tks to mr-fan)
update droplet LoginBox, additional parameter $redirect
remove double config call in media (Tks to Testör)

View differences:

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

  
13 13
------------------------------------- 2.8.2 ------------------------------------
14
09 Jul-2011 Build 1473 Dietmar Woellbrink (Luisehahne)
15
# found more backlinks to fix
16
- remove not working ftan in frontend
17
# fixed redirect in login procedure (Tks to mr-fan)
18
! update droplet LoginBox, additional parameter $redirect
19
# remove double config call in media (Tks to Testör)
14 20
07 Jul-2011 Build 1472 Dietmar Woellbrink (Luisehahne)
15 21
# fixed version.php
16 22
07 Jul-2011 Build 1471 Dietmar Woellbrink (Luisehahne)
branches/2.8.x/wb/admin/groups/save.php
26 26

  
27 27
if (!$admin->checkFTAN())
28 28
{
29
	$admin->print_header();
29 30
	$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'],$js_back);
30 31
}
31 32
// After check print the header
......
62 63

  
63 64
// Print admin footer
64 65
$admin->print_footer();
65

  
66
?>
branches/2.8.x/wb/admin/groups/groups.php
46 46
/*  */
47 47
	if (!$admin->checkFTAN())
48 48
	{
49
		$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], ADMIN_URL);
49
		$admin->print_header();
50
		$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS']);
50 51
	}
51 52

  
52 53
	// Print header
......
194 195

  
195 196
// Print admin footer
196 197
$admin->print_footer();
197

  
198
?>
branches/2.8.x/wb/admin/groups/add.php
60 60

  
61 61
// Print admin footer
62 62
$admin->print_footer();
63

  
64
?>
branches/2.8.x/wb/admin/media/create.php
38 38
	exit(0);
39 39
}
40 40

  
41
// Print admin header
42
require('../../config.php');
43 41
require_once(WB_PATH.'/framework/class.admin.php');
44 42
// suppress to print the header, so no new FTAN will be set
45 43
$admin = new admin('Media', 'media_create', false);
branches/2.8.x/wb/admin/media/parameters.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"); }
21

  
19 22
function __unserialize($sObject) {  // found in php manual :-)
20 23
	$__ret =preg_replace('!s:(\d+):"(.*?)";!e', "'s:'.strlen('$2').':\"$2\";'", $sObject );
21 24
	return unserialize($__ret);
branches/2.8.x/wb/admin/pages/sections_save.php
32 32
// suppress to print the header, so no new FTAN will be set
33 33
$admin = new admin('Pages', 'pages_modify',false);
34 34

  
35
// Get page id
36
if(!isset($_GET['page_id']) || !is_numeric($_GET['page_id'])) {
37
	header("Location: index.php");
38
	exit(0);
39
} else {
40
	$page_id = (int)$_GET['page_id'];
41
}
42

  
35 43
if (!$admin->checkFTAN())
36 44
{
37 45
	$admin->print_header();
......
39 47
}
40 48
// After check print the header
41 49
$admin->print_header();
42

  
43
// Get page id
44
if(!isset($_GET['page_id']) || !is_numeric($_GET['page_id'])) {
45
	header("Location: index.php");
46
	exit(0);
47
} else {
48
	$page_id = $_GET['page_id'];
49
}
50 50
/*
51 51
if( (!($page_id = $admin->checkIDKEY('page_id', 0, $_SERVER['REQUEST_METHOD']))) )
52 52
{
branches/2.8.x/wb/admin/pages/add.php
26 26
	$admin->print_header();
27 27
	$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS']);
28 28
}
29
// After check print the header
30
$admin->print_header();
31 29

  
32 30
// Include the WB functions file
33 31
require_once(WB_PATH.'/framework/functions.php');
......
49 47
$admin_groups[] = 1;
50 48
$viewing_groups[] = 1;
51 49

  
50
// After check print the header
51
$admin->print_header();
52 52
// check parent page permissions:
53 53
if ($parent!=0) {
54 54
	if (!$admin->get_page_permission($parent,'admin'))
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.RC7');
55
if(!defined('REVISION')) define('REVISION', '1472');
55
if(!defined('REVISION')) define('REVISION', '1473');
56 56

  
57 57
?>
branches/2.8.x/wb/account/logout.php
1
<?php
2
/**
3
 *
4
 * @category        frontend
5
 * @package         account
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

  
21
if(isset($_COOKIE['REMEMBER_KEY'])) {
22
	setcookie('REMEMBER_KEY', '', time()-3600, '/');
23
}
24

  
25
$_SESSION['USER_ID'] = null;
26
$_SESSION['GROUP_ID'] = null;
27
$_SESSION['GROUPS_ID'] = null;
28
$_SESSION['USERNAME'] = null;
29
$_SESSION['PAGE_PERMISSIONS'] = null;
30
$_SESSION['SYSTEM_PERMISSIONS'] = null;
31
$_SESSION = array();
32
session_unset();
33
unset($_COOKIE[session_name()]);
34
session_destroy();
35

  
36
if(INTRO_PAGE) {
37
	header('Location: '.WB_URL.PAGES_DIRECTORY.'/index.php');
38
} else {
39
	header('Location: '.WB_URL.'/index.php');
40
}
41

  
42
?>
1
<?php
2
/**
3
 *
4
 * @category        frontend
5
 * @package         account
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

  
21
if(isset($_COOKIE['REMEMBER_KEY'])) {
22
	setcookie('REMEMBER_KEY', '', time()-3600, '/');
23
}
24

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

  
27
$_SESSION['USER_ID'] = null;
28
$_SESSION['GROUP_ID'] = null;
29
$_SESSION['GROUPS_ID'] = null;
30
$_SESSION['USERNAME'] = null;
31
$_SESSION['PAGE_PERMISSIONS'] = null;
32
$_SESSION['SYSTEM_PERMISSIONS'] = null;
33
$_SESSION = array();
34
session_unset();
35
unset($_COOKIE[session_name()]);
36
session_destroy();
37

  
38
if(INTRO_PAGE) {
39
	header('Location: '.WB_URL.PAGES_DIRECTORY.'/index.php');
40
} else {
41
	header('Location: '.$redirect);
42
}
43

  
branches/2.8.x/wb/account/login_form.php
43 43
<form action="<?php echo WB_URL.'/account/login.php'; ?>" method="post">
44 44
<p style="display:none;"><input type="hidden" name="username_fieldname" value="<?php echo $username_fieldname; ?>" /></p>
45 45
<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="redirect" value="<?php echo $thisApp->redirect_url;?>" /></p>
46
<p style="display:none;"><input type="hidden" name="url" value="<?php echo $thisApp->redirect_url;?>" /></p>
47 47

  
48 48
<table cellpadding="5" cellspacing="0" border="0" width="90%">
49 49
<tr>
branches/2.8.x/wb/account/preferences.php
1
<?php
2
/**
3
 *
4
 * @category        frontend
5
 * @package         account
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_once('../config.php');
20

  
21
if(!FRONTEND_LOGIN) {
22
	if(INTRO_PAGE) {
23
		header('Location: '.WB_URL.PAGES_DIRECTORY.'/index.php');
24
		exit(0);
25
	} else {
26
		header('Location: '.WB_URL.'/index.php');
27
		exit(0);
28
	}
29
}
30

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

  
38
// Required page details
39
$page_id = 0;
40
$page_description = '';
41
$page_keywords = '';
42
define('PAGE_ID', 0);
43
define('ROOT_PARENT', 0);
44
define('PARENT', 0);
45
define('LEVEL', 0);
46
define('PAGE_TITLE', $MENU['PREFERENCES']);
47
define('MENU_TITLE', $MENU['PREFERENCES']);
48
define('MODULE', '');
49
define('VISIBILITY', 'public');
50

  
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

  
62
// Include the index (wrapper) file
63
require(WB_PATH.'/index.php');
64

  
65
?>
1
<?php
2
/**
3
 *
4
 * @category        frontend
5
 * @package         account
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_once('../config.php');
20

  
21
if(!FRONTEND_LOGIN) {
22
	if(INTRO_PAGE) {
23
		header('Location: '.WB_URL.PAGES_DIRECTORY.'/index.php');
24
		exit(0);
25
	} else {
26
		header('Location: '.WB_URL.'/index.php');
27
		exit(0);
28
	}
29
}
30

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

  
38
// Required page details
39
$page_id = 0;
40
$page_description = '';
41
$page_keywords = '';
42
define('PAGE_ID', 0);
43
define('ROOT_PARENT', 0);
44
define('PARENT', 0);
45
define('LEVEL', 0);
46
define('PAGE_TITLE', $MENU['PREFERENCES']);
47
define('MENU_TITLE', $MENU['PREFERENCES']);
48
define('MODULE', '');
49
define('VISIBILITY', 'public');
50

  
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

  
62
// Include the index (wrapper) file
63
require(WB_PATH.'/index.php');
branches/2.8.x/wb/account/password.php
26 26

  
27 27
// Create a javascript back link
28 28
$js_back = WB_URL.'/account/preferences.php';
29

  
29
/*
30 30
if (!$wb->checkFTAN())
31 31
{
32 32
	$wb->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], $js_back, false);
33 33
	exit();
34 34
}
35

  
35
*/
36 36
// Get existing password
37 37
// $database = new database();
38 38
$query = "SELECT user_id FROM ".TABLE_PREFIX."users WHERE user_id = '".$wb->get_user_id()."' AND password = '".md5($current_password)."'";
......
62 62
} else {
63 63
	$wb->print_success($MESSAGE['PREFERENCES']['PASSWORD_CHANGED']);
64 64
}
65

  
66
?>
branches/2.8.x/wb/account/preferences_form.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
$ftan = $wb->getFTAN();
23 22
?>
24 23

  
25 24
<h2>&nbsp;<?php print $HEADING['MY_SETTINGS']; ?></h2>
26 25

  
27 26
<form name="user" action="<?php print WB_URL.'/account/preferences.php'; ?>" method="post" style="margin-bottom: 5px;">
28 27
<input type="hidden" name="user_id" value="{USER_ID}" />
29
<?php echo $ftan; ?>
30 28
<table cellpadding="5" cellspacing="0" border="0" width="97%">
31 29
<tr>
32 30
	<td width="140"><?php print $TEXT['DISPLAY_NAME']; ?>:</td>
......
150 148

  
151 149
<form name="email" action="<?php print WB_URL.'/account/preferences.php'; ?>" method="post" style="margin-bottom: 5px;">
152 150
<input type="hidden" name="user_id" value="{USER_ID}" />
153
<?php echo $ftan; ?>
154 151
<table cellpadding="5" cellspacing="0" border="0" width="97%">
155 152
<tr>
156 153
	<td width="140"><?php print $TEXT['CURRENT_PASSWORD']; ?>:</td>
......
180 177

  
181 178
<form name="user" action="<?php print WB_URL.'/account/preferences.php'; ?>" method="post">
182 179
<input type="hidden" name="user_id" value="{USER_ID}" />
183
<?php echo $ftan; ?>
184 180
<table cellpadding="5" cellspacing="0" border="0" width="97%">
185 181
<tr>
186 182
	<td width="140"><?php print $TEXT['CURRENT_PASSWORD']; ?>:</td>
branches/2.8.x/wb/account/details.php
21 21

  
22 22
// Create a javascript back link
23 23
$js_back = WB_URL.'/account/preferences.php';
24

  
24
/*
25 25
if (!$wb->checkFTAN())
26 26
{
27 27
	$wb->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], $js_back);
28 28
	exit();
29 29
}
30

  
30
*/
31 31
// Get and sanitize entered values
32 32
$display_name = $wb->add_slashes(strip_tags($wb->get_post('display_name')));
33 33
$language = strtoupper($wb->get_post('language'));
......
87 87
		if(isset($_SESSION['TIMEZONE'])) { unset($_SESSION['TIMEZONE']); }
88 88
	}
89 89
}
90

  
91
?>
branches/2.8.x/wb/account/email.php
25 25

  
26 26
// Create a javascript back link
27 27
$js_back = WB_URL.'/account/preferences.php';
28

  
28
/*
29 29
if (!$wb->checkFTAN())
30 30
{
31 31
	$wb->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], $js_back, false);
32 32
	exit();
33 33
}
34

  
34
*/
35 35
// Get existing password
36 36
// $database = new database();
37 37
$query = "SELECT user_id FROM ".TABLE_PREFIX."users WHERE user_id = '".$wb->get_user_id()."' AND password = '".md5($current_password)."'";
......
58 58
	$wb->print_success($MESSAGE['PREFERENCES']['EMAIL_UPDATED']);
59 59
	$_SESSION['EMAIL'] = $email;
60 60
}
61

  
62
?>
branches/2.8.x/wb/account/signup2.php
1
<?php
2
/**
3
 *
4
 * @category        frontend
5
 * @package         account
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
// Must include code to stop this file being access directly
20
if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
21

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

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

  
28
// Get details entered
29
$groups_id = FRONTEND_SIGNUP;
30
$active = 1;
31
$username = strtolower(strip_tags($wb->get_post_escaped('username')));
32
$display_name = strip_tags($wb->get_post_escaped('display_name'));
33
$email = $wb->get_post('email');
34

  
35
// Create a javascript back link
36
$js_back = WB_URL.'/account/signup.php';
37

  
38
if (!$wb->checkFTAN())
39
{
40
	$wb->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], $js_back, false);
41
	exit();
42
}
43

  
44
// Check values
45
if($groups_id == "") {
46
	$wb->print_error($MESSAGE['USERS']['NO_GROUP'], $js_back, false);
47
}
48
if(!preg_match('/^[a-z]{1}[a-z0-9_-]{2,}$/i', $username)) {
49
	$wb->print_error( $MESSAGE['USERS_NAME_INVALID_CHARS'].' / '.
50
	                  $MESSAGE['USERS_USERNAME_TOO_SHORT'], $js_back);
51
}
52
if($email != "") {
53
	if($wb->validate_email($email) == false) {
54
		$wb->print_error($MESSAGE['USERS']['INVALID_EMAIL'], $js_back, false);
55
	}
56
} else {
57
	$wb->print_error($MESSAGE['SIGNUP']['NO_EMAIL'], $js_back, false);
58
}
59

  
60
$email = $wb->add_slashes($email);
61

  
62
// Captcha
63
if(ENABLED_CAPTCHA) {
64
	if(isset($_POST['captcha']) AND $_POST['captcha'] != ''){
65
		// Check for a mismatch
66
		if(!isset($_POST['captcha']) OR !isset($_SESSION['captcha']) OR $_POST['captcha'] != $_SESSION['captcha']) {
67
			$wb->print_error($MESSAGE['MOD_FORM']['INCORRECT_CAPTCHA'], $js_back, false);
68
		}
69
	} else {
70
		$wb->print_error($MESSAGE['MOD_FORM']['INCORRECT_CAPTCHA'], $js_back, false);
71
	}
72
}
73
if(isset($_SESSION['captcha'])) { unset($_SESSION['captcha']); }
74

  
75
// Generate a random password then update the database with it
76
$new_pass = '';
77
$salt = "abchefghjkmnpqrstuvwxyz0123456789";
78
srand((double)microtime()*1000000);
79
$i = 0;
80
while ($i <= 7) {
81
	$num = rand() % 33;
82
	$tmp = substr($salt, $num, 1);
83
	$new_pass = $new_pass . $tmp;
84
	$i++;
85
}
86
$md5_password = md5($new_pass);
87

  
88
// Check if username already exists
89
$results = $database->query("SELECT user_id FROM ".TABLE_PREFIX."users WHERE username = '$username'");
90
if($results->numRows() > 0) {
91
	$wb->print_error($MESSAGE['USERS']['USERNAME_TAKEN'], $js_back, false);
92
}
93

  
94
// Check if the email already exists
95
$results = $database->query("SELECT user_id FROM ".TABLE_PREFIX."users WHERE email = '".$wb->add_slashes($email)."'");
96
if($results->numRows() > 0) {
97
	if(isset($MESSAGE['USERS']['EMAIL_TAKEN'])) {
98
		$wb->print_error($MESSAGE['USERS']['EMAIL_TAKEN'], $js_back, false);
99
	} else {
100
		$wb->print_error($MESSAGE['USERS']['INVALID_EMAIL'], $js_back, false);
101
	}
102
}
103

  
104
// MD5 supplied password
105
$md5_password = md5($new_pass);
106

  
107
// Inser the user into the database
108
$query = "INSERT INTO ".TABLE_PREFIX."users (group_id,groups_id,active,username,password,display_name,email) VALUES ('$groups_id', '$groups_id', '$active', '$username','$md5_password','$display_name','$email')";
109
$database->query($query);
110

  
111
if($database->is_error()) {
112
	// Error updating database
113
	$message = $database->get_error();
114
} else {
115
	// Setup email to send
116
	$mail_to = $email;
117
	$mail_subject = $MESSAGE['SIGNUP2']['SUBJECT_LOGIN_INFO'];
118

  
119
	// Replace placeholders from language variable with values
120
	$search = array('{LOGIN_DISPLAY_NAME}', '{LOGIN_WEBSITE_TITLE}', '{LOGIN_NAME}', '{LOGIN_PASSWORD}');
121
	$replace = array($display_name, WEBSITE_TITLE, $username, $new_pass); 
122
	$mail_message = str_replace($search, $replace, $MESSAGE['SIGNUP2']['BODY_LOGIN_INFO']);
123

  
124
	// Try sending the email
125
	if($wb->mail(SERVER_EMAIL,$mail_to,$mail_subject,$mail_message)) { 
126
		$display_form = false;
127
		$wb->print_success($MESSAGE['FORGOT_PASS']['PASSWORD_RESET'], WB_URL.'/account/login.php' );
128
	} else {
129
		$database->query("DELETE FROM ".TABLE_PREFIX."users WHERE username = '$username'");
130
		$wb->print_error($MESSAGE['FORGOT_PASS']['CANNOT_EMAIL'], $js_back, false);
131
	}
132
}
133

  
134
?>
1
<?php
2
/**
3
 *
4
 * @category        frontend
5
 * @package         account
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
// Must include code to stop this file being access directly
20
if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
21

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

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

  
28
// Get details entered
29
$groups_id = FRONTEND_SIGNUP;
30
$active = 1;
31
$username = strtolower(strip_tags($wb->get_post_escaped('username')));
32
$display_name = strip_tags($wb->get_post_escaped('display_name'));
33
$email = $wb->get_post('email');
34

  
35
// Create a javascript back link
36
$js_back = WB_URL.'/account/signup.php';
37
/*
38
if (!$wb->checkFTAN())
39
{
40
	$wb->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], $js_back, false);
41
	exit();
42
}
43
*/
44
// Check values
45
if($groups_id == "") {
46
	$wb->print_error($MESSAGE['USERS']['NO_GROUP'], $js_back, false);
47
}
48
if(!preg_match('/^[a-z]{1}[a-z0-9_-]{2,}$/i', $username)) {
49
	$wb->print_error( $MESSAGE['USERS_NAME_INVALID_CHARS'].' / '.
50
	                  $MESSAGE['USERS_USERNAME_TOO_SHORT'], $js_back);
51
}
52
if($email != "") {
53
	if($wb->validate_email($email) == false) {
54
		$wb->print_error($MESSAGE['USERS']['INVALID_EMAIL'], $js_back, false);
55
	}
56
} else {
57
	$wb->print_error($MESSAGE['SIGNUP']['NO_EMAIL'], $js_back, false);
58
}
59

  
60
$email = $wb->add_slashes($email);
61

  
62
// Captcha
63
if(ENABLED_CAPTCHA) {
64
	if(isset($_POST['captcha']) AND $_POST['captcha'] != ''){
65
		// Check for a mismatch
66
		if(!isset($_POST['captcha']) OR !isset($_SESSION['captcha']) OR $_POST['captcha'] != $_SESSION['captcha']) {
67
			$wb->print_error($MESSAGE['MOD_FORM']['INCORRECT_CAPTCHA'], $js_back, false);
68
		}
69
	} else {
70
		$wb->print_error($MESSAGE['MOD_FORM']['INCORRECT_CAPTCHA'], $js_back, false);
71
	}
72
}
73
if(isset($_SESSION['captcha'])) { unset($_SESSION['captcha']); }
74

  
75
// Generate a random password then update the database with it
76
$new_pass = '';
77
$salt = "abchefghjkmnpqrstuvwxyz0123456789";
78
srand((double)microtime()*1000000);
79
$i = 0;
80
while ($i <= 7) {
81
	$num = rand() % 33;
82
	$tmp = substr($salt, $num, 1);
83
	$new_pass = $new_pass . $tmp;
84
	$i++;
85
}
86
$md5_password = md5($new_pass);
87

  
88
// Check if username already exists
89
$results = $database->query("SELECT user_id FROM ".TABLE_PREFIX."users WHERE username = '$username'");
90
if($results->numRows() > 0) {
91
	$wb->print_error($MESSAGE['USERS']['USERNAME_TAKEN'], $js_back, false);
92
}
93

  
94
// Check if the email already exists
95
$results = $database->query("SELECT user_id FROM ".TABLE_PREFIX."users WHERE email = '".$wb->add_slashes($email)."'");
96
if($results->numRows() > 0) {
97
	if(isset($MESSAGE['USERS']['EMAIL_TAKEN'])) {
98
		$wb->print_error($MESSAGE['USERS']['EMAIL_TAKEN'], $js_back, false);
99
	} else {
100
		$wb->print_error($MESSAGE['USERS']['INVALID_EMAIL'], $js_back, false);
101
	}
102
}
103

  
104
// MD5 supplied password
105
$md5_password = md5($new_pass);
106

  
107
// Inser the user into the database
108
$query = "INSERT INTO ".TABLE_PREFIX."users (group_id,groups_id,active,username,password,display_name,email) VALUES ('$groups_id', '$groups_id', '$active', '$username','$md5_password','$display_name','$email')";
109
$database->query($query);
110

  
111
if($database->is_error()) {
112
	// Error updating database
113
	$message = $database->get_error();
114
} else {
115
	// Setup email to send
116
	$mail_to = $email;
117
	$mail_subject = $MESSAGE['SIGNUP2']['SUBJECT_LOGIN_INFO'];
118

  
119
	// Replace placeholders from language variable with values
120
	$search = array('{LOGIN_DISPLAY_NAME}', '{LOGIN_WEBSITE_TITLE}', '{LOGIN_NAME}', '{LOGIN_PASSWORD}');
121
	$replace = array($display_name, WEBSITE_TITLE, $username, $new_pass); 
122
	$mail_message = str_replace($search, $replace, $MESSAGE['SIGNUP2']['BODY_LOGIN_INFO']);
123

  
124
	// Try sending the email
125
	if($wb->mail(SERVER_EMAIL,$mail_to,$mail_subject,$mail_message)) { 
126
		$display_form = false;
127
		$wb->print_success($MESSAGE['FORGOT_PASS']['PASSWORD_RESET'], WB_URL.'/account/login.php' );
128
	} else {
129
		$database->query("DELETE FROM ".TABLE_PREFIX."users WHERE username = '$username'");
130
		$wb->print_error($MESSAGE['FORGOT_PASS']['CANNOT_EMAIL'], $js_back, false);
131
	}
132
}
133

  
branches/2.8.x/wb/account/login.php
1
<?php
2
/**
3
 *
4
 * @category        frontend
5
 * @package         account
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_once("../config.php");
20

  
21
// Make sure the login is enabled
22
if(!FRONTEND_LOGIN) {
23
	if(INTRO_PAGE) {
24
		header('Location: '.WB_URL.PAGES_DIRECTORY.'/index.php');
25
		exit(0);
26
	} else {
27
		header('Location: '.WB_URL.'/index.php');
28
		exit(0);
29
	}
30
}
31

  
32
// Required page details
33
$page_id = 0;
34
$page_description = '';
35
$page_keywords = '';
36
define('PAGE_ID', 0);
37
define('ROOT_PARENT', 0);
38
define('PARENT', 0);
39
define('LEVEL', 0);
40
define('PAGE_TITLE', $TEXT['PLEASE_LOGIN']);
41
define('MENU_TITLE', $TEXT['PLEASE_LOGIN']);
42
define('VISIBILITY', 'public');
43
// Set the page content include file
44
define('PAGE_CONTENT', WB_PATH.'/account/login_form.php');
45

  
46
require_once(WB_PATH.'/framework/class.login.php');
47

  
48
// Create new login app
49
$redirect = strip_tags((isset($_POST['redirect'])) ? $_POST['redirect'] : '');
50
$thisApp = new Login(
51
							array(
52
									"MAX_ATTEMPS" => "3",
53
									"WARNING_URL" => THEME_URL."/templates/warning.html",
54
									"USERNAME_FIELDNAME" => 'username',
55
									"PASSWORD_FIELDNAME" => 'password',
56
									"REMEMBER_ME_OPTION" => SMART_LOGIN,
57
									"MIN_USERNAME_LEN" => "2",
58
									"MIN_PASSWORD_LEN" => "2",
59
									"MAX_USERNAME_LEN" => "30",
60
									"MAX_PASSWORD_LEN" => "30",
61
									"LOGIN_URL" => WB_URL."/account/login.php?redirect=" .$redirect,
62
									"DEFAULT_URL" => WB_URL.PAGES_DIRECTORY."/index.php",
63
									"TEMPLATE_DIR" => THEME_PATH."/templates",
64
									"TEMPLATE_FILE" => "login.htt",
65
									"FRONTEND" => true,
66
									"FORGOTTEN_DETAILS_APP" => WB_URL."/account/forgot.php",
67
									"USERS_TABLE" => TABLE_PREFIX."users",
68
									"GROUPS_TABLE" => TABLE_PREFIX."groups",
69
									"REDIRECT_URL" => $redirect
70
							)
71
					);
72

  
73
// Set extra outsider var
74
$globals[] = 'thisApp';
75

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

  
79

  
80
?>
1
<?php
2
/**
3
 *
4
 * @category        frontend
5
 * @package         account
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_once("../config.php");
20

  
21
// Make sure the login is enabled
22
if(!FRONTEND_LOGIN) {
23
	if(INTRO_PAGE) {
24
		header('Location: '.WB_URL.PAGES_DIRECTORY.'/index.php');
25
		exit(0);
26
	} else {
27
		header('Location: '.WB_URL.'/index.php');
28
		exit(0);
29
	}
30
}
31

  
32
// Required page details
33
$page_id = 0;
34
$page_description = '';
35
$page_keywords = '';
36
define('PAGE_ID', 0);
37
define('ROOT_PARENT', 0);
38
define('PARENT', 0);
39
define('LEVEL', 0);
40
define('PAGE_TITLE', $TEXT['PLEASE_LOGIN']);
41
define('MENU_TITLE', $TEXT['PLEASE_LOGIN']);
42
define('VISIBILITY', 'public');
43
// Set the page content include file
44
define('PAGE_CONTENT', WB_PATH.'/account/login_form.php');
45

  
46
require_once(WB_PATH.'/framework/class.login.php');
47

  
48
// Create new login app
49
$requestMethod = '_'.strtoupper($_SERVER['REQUEST_METHOD']);
50
$redirect = strip_tags(isset(${$requestMethod}['redirect']) ? ${$requestMethod}['redirect'] : '');
51
$thisApp = new Login(
52
				array(
53
						"MAX_ATTEMPS" => "3",
54
						"WARNING_URL" => THEME_URL."/templates/warning.html",
55
						"USERNAME_FIELDNAME" => 'username',
56
						"PASSWORD_FIELDNAME" => 'password',
57
						"REMEMBER_ME_OPTION" => SMART_LOGIN,
58
						"MIN_USERNAME_LEN" => "2",
59
						"MIN_PASSWORD_LEN" => "2",
60
						"MAX_USERNAME_LEN" => "30",
61
						"MAX_PASSWORD_LEN" => "30",
62
						"LOGIN_URL" => WB_URL."/account/login.php?redirect=" .$redirect,
63
						"DEFAULT_URL" => WB_URL.PAGES_DIRECTORY."/index.php",
64
						"TEMPLATE_DIR" => THEME_PATH."/templates",
65
						"TEMPLATE_FILE" => "login.htt",
66
						"FRONTEND" => true,
67
						"FORGOTTEN_DETAILS_APP" => WB_URL."/account/forgot.php",
68
						"USERS_TABLE" => TABLE_PREFIX."users",
69
						"GROUPS_TABLE" => TABLE_PREFIX."groups",
70
						"REDIRECT_URL" => $redirect
71
				)
72
		);
73

  
74
// Set extra outsider var
75
$globals[] = 'thisApp';
76

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

  
branches/2.8.x/wb/templates/wb_theme/theme.css
120 120
.row_0 { background-color: transparent; }
121 121
.row_1 { background-color: #ccddee; }
122 122

  
123
div.content_box { margin :0em auto; }
124
div.content_box form { width: 98%; }
125

  
123 126
#language,
124 127
#timezone,
125 128
#date_format,
......
135 138
#submit,
136 139
#reset { max-width: 100px; }
137 140

  
138
 div#username { height: 17px; width:402px; background-color: #e9e9e9; min-width:250px; border: 0px groove #6799c4; text-align: left; font-weight:bold; margin:0;} 
141
 div#username { height: 17px; width:118%; background-color: #e9e9e9; min-width:250px; border: 0px groove #6799c4; text-align: left; font-weight:bold; margin:0;} 
139 142
.save_section { margin: 20px auto 5px auto; }
140 143

  
141 144
#language,
......
147 150
#email,
148 151
#new_password_1,
149 152
#new_password_2,
150
#current_password {width:640px;}
153
#current_password {width:118%;}
151 154

  
152 155
.section-info { margin : 1.5em 0; }
153 156

  
branches/2.8.x/wb/templates/wb_theme/templates/preferences.htt
1
<!-- BEGIN main_block -->
2
<h2>{HEADING_MY_SETTINGS}</h2>
3
<div class="content_box">
4
	<form name="{FORM_NAME}" id="{FORM_NAME}" action="{ACTION_URL}" method="post">
5
		{FTAN}
6
			<div class="subcolumns">
7
				<div class="c25l">
8
					<label>{TEXT_USERNAME}:</label><br />
9
				</div>
10
				<div class="c60l">
11
					<div id="username">{USERNAME}</div><br />
12
				</div>
13
			</div>
14
			<div class="subcolumns">
15
				<div class="c25l">
16
					<label>{TEXT_DISPLAY_NAME}:</label><br />
17
				</div>
18
				<div class="c60l">
19
					<input type="text" id="display_name" name="display_name" value="{DISPLAY_NAME}" /><br />
20
				</div>
21
			</div>
22
			<div class="subcolumns">
23
				<div class="c25l">
24
					<label>{TEXT_LANGUAGE}:</label><br />
25
				</div>
26
				<div class="c60l">
27
				<select name="language" id="language">
28
					<!-- BEGIN language_list_block -->
29
						<option value="{CODE}"{SELECTED} style="background: url({FLAG}.png) no-repeat center left; padding-left: 20px;">{NAME} ({CODE})</option>
30
					<!-- END language_list_block -->
31
					</select>
32
				</div>
33
			</div>
34
			<div class="subcolumns">
35
				<div class="c25l">
36
					<label>{TEXT_TIMEZONE}:</label><br />
37
				</div>
38
				<div class="c60l">
39
					<select name="timezone" id="timezone">
40
						<!-- BEGIN timezone_list_block -->
41
							<option value="{VALUE}"{SELECTED}>{NAME}</option>
42
						<!-- END timezone_list_block -->
43
					</select>
44
				</div>
45
			</div>
46
			<div class="subcolumns">
47
				<div class="c25l">
48
					<label>{TEXT_DATE_FORMAT}:</label><br />
49
				</div>
50
				<div class="c60l">
51
					<select name="date_format" id="date_format">
52
						<!-- BEGIN date_format_list_block -->
53
							<option value="{VALUE}"{SELECTED}>{NAME}</option>
54
						<!-- END date_format_list_block -->
55
					</select>
56
				</div>
57
			</div>
58
			<div class="subcolumns">
59
				<div class="c25l">
60
					<label>{TEXT_TIME_FORMAT}:</label><br />
61
				</div>
62
				<div class="c60l">
63
					<select name="time_format" id="time_format">
64
						<!-- BEGIN time_format_list_block -->
65
							<option value="{VALUE}"{SELECTED}>{NAME}</option>
66
						<!-- END time_format_list_block -->
67
					</select>
68
				</div>
69
			</div>
70

  
71
			<div class="subcolumns">
72
				<div class="c25l">
73
					<label>{TEXT_EMAIL}:</label><br />
74
				</div>
75
				<div class="c60l">
76
					<input type="text" id="email" name="email" value="{EMAIL}" /><br />
77
				</div>
78
			</div>
79
			<div class="subcolumns">
80
				<div class="c25l">
81
					<label>{TEXT_NEW_PASSWORD}:</label><br />
82
				</div>
83
				<div class="c60l">
84
					<input type="password" id="new_password_1" name="new_password_1" value="{EMPTY_STRING}" /><br />
85
				</div>
86
			</div>
87
			<div class="subcolumns">
88
				<div class="c25l">
89
					<label>{TEXT_RETYPE_NEW_PASSWORD}:</label><br />
90
				</div>
91
				<div class="c60l">
92
					<input type="password" id="new_password_2" name="new_password_2" value="{EMPTY_STRING}" /><br />
93
				</div>
94
			</div>
95
			<div class="subcolumns">
96
				<div class="c25l">
97
					<label>{TEXT_NEED_CURRENT_PASSWORD}:</label><br />
98
				</div>
99
				<div class="c60l">
100
					<input type="password" id="current_password" name="current_password" value="{EMPTY_STRING}" /><br />
101
				</div>
102
			</div>
103
			<div class="subcolumns save_section">
104
				<div class="c25l">
105
					<input type="submit" id="submit" name="submit" value="{TEXT_SAVE}" />
106
					<input type="reset" id="reset" name="reset" value="{TEXT_RESET}" />
107
				</div>
108
				<div class="c25l">
109
				</div>
110
			</div>
111
	</form>
112
</div>
113

  
114
<!-- END main_block -->
1
<!-- BEGIN main_block -->
2
<h2>{HEADING_MY_SETTINGS}</h2>
3
<div class="content_box">
4
	<form name="{FORM_NAME}" id="{FORM_NAME}" action="{ACTION_URL}" method="post">
5
		{FTAN}
6
			<div class="subcolumns">
7
				<div class="c25l">
8
					<label>{TEXT_USERNAME}:</label><br />
9
				</div>
10
				<div class="c60l">
11
					<div id="username">{USERNAME}</div><br />
12
				</div>
13
			</div>
14
			<div class="subcolumns">
15
				<div class="c25l">
16
					<label>{TEXT_DISPLAY_NAME}:</label><br />
17
				</div>
18
				<div class="c60l">
19
					<input type="text" id="display_name" name="display_name" value="{DISPLAY_NAME}" /><br />
20
				</div>
21
			</div>
22
			<div class="subcolumns">
23
				<div class="c25l">
24
					<label>{TEXT_LANGUAGE}:</label><br />
25
				</div>
26
				<div class="c60l">
27
				<select name="language" id="language">
28
					<!-- BEGIN language_list_block -->
29
						<option value="{CODE}"{SELECTED} style="background: url({FLAG}.png) no-repeat center left; padding-left: 20px;">{NAME} ({CODE})</option>
30
					<!-- END language_list_block -->
31
					</select>
32
				</div>
33
			</div>
34
			<div class="subcolumns">
35
				<div class="c25l">
36
					<label>{TEXT_TIMEZONE}:</label><br />
37
				</div>
38
				<div class="c60l">
39
					<select name="timezone" id="timezone">
40
						<!-- BEGIN timezone_list_block -->
41
							<option value="{VALUE}"{SELECTED}>{NAME}</option>
42
						<!-- END timezone_list_block -->
43
					</select>
44
				</div>
45
			</div>
46
			<div class="subcolumns">
47
				<div class="c25l">
48
					<label>{TEXT_DATE_FORMAT}:</label><br />
49
				</div>
50
				<div class="c60l">
51
					<select name="date_format" id="date_format">
52
						<!-- BEGIN date_format_list_block -->
53
							<option value="{VALUE}"{SELECTED}>{NAME}</option>
54
						<!-- END date_format_list_block -->
55
					</select>
56
				</div>
57
			</div>
58
			<div class="subcolumns">
59
				<div class="c25l">
60
					<label>{TEXT_TIME_FORMAT}:</label><br />
61
				</div>
62
				<div class="c60l">
63
					<select name="time_format" id="time_format">
64
						<!-- BEGIN time_format_list_block -->
65
							<option value="{VALUE}"{SELECTED}>{NAME}</option>
66
						<!-- END time_format_list_block -->
67
					</select>
68
				</div>
69
			</div>
70

  
71
			<div class="subcolumns">
72
				<div class="c25l">
73
					<label>{TEXT_EMAIL}:</label><br />
74
				</div>
75
				<div class="c60l">
76
					<input type="text" id="email" name="email" value="{EMAIL}" /><br />
77
				</div>
78
			</div>
79
			<div class="subcolumns">
80
				<div class="c25l">
81
					<label>{TEXT_NEW_PASSWORD}:</label><br />
82
				</div>
83
				<div class="c60l">
84
					<input type="password" id="new_password_1" name="new_password_1" value="{EMPTY_STRING}" /><br />
85
				</div>
86
			</div>
87
			<div class="subcolumns">
88
				<div class="c25l">
89
					<label>{TEXT_RETYPE_NEW_PASSWORD}:</label><br />
90
				</div>
91
				<div class="c60l">
92
					<input type="password" id="new_password_2" name="new_password_2" value="{EMPTY_STRING}" /><br />
93
				</div>
94
			</div>
95
			<hr />
96
			<div class="subcolumns">
97
				<div class="c25l">
98
					<label>{TEXT_NEED_CURRENT_PASSWORD}:</label><br />
99
				</div>
100
				<div class="c60l">
101
					<input type="password" id="current_password" name="current_password" value="{EMPTY_STRING}" /><br />
102
				</div>
103
			</div>
104
			<div class="subcolumns save_section">
105
				<div class="c60l">
106
					<input type="submit" id="submit" name="submit" value="{TEXT_SAVE}" />
107
					<input type="reset" id="reset" name="reset" value="{TEXT_RESET}" />
108
				</div>
109
				<div class="c25l">&nbsp;</div>
110
			</div>
111
	</form>
112
</div>
113

  
114
<!-- END main_block -->
branches/2.8.x/wb/templates/argos_theme/theme.css
162 162
.row_0 {background-color:transparent;}
163 163
.row_1 {background-color:#ccddee;}
164 164

  
165
div.content_box { margin :0em auto; }
166
div.content_box form { width: 98%; }
167

  
165 168
#language,
166 169
#timezone,
167 170
#date_format,
......
171 174
#email,
172 175
#new_password_1,
173 176
#new_password_2,
174
#current_password {width:640px;}
177
#current_password {width:118%;}
175 178

  
176 179
#submit,
177 180
#reset {max-width:100px;}
178 181

  
179
div#username {height:17px;width:640px;text-align:left;font-weight:bold;margin:0;} 
182
div#username {height:17px;width:118%;text-align:left;font-weight:bold;margin:0;} 
180 183
.save_section {margin:20px auto 5px auto;}
181 184
.section-info { margin : 1.5em 0; }
182 185

  
branches/2.8.x/wb/templates/argos_theme/templates/preferences.htt
1
<!-- BEGIN main_block -->
2
<h2>{HEADING_MY_SETTINGS}</h2>
3
<div class="content_box">
4
	<form name="{FORM_NAME}" id="{FORM_NAME}" action="{ACTION_URL}" method="post">
5
		{FTAN}
6
			<div class="subcolumns">
7
				<div class="c25l">
8
					<label>{TEXT_USERNAME}:</label><br />
9
				</div>
10
				<div class="c60l">
11
					<div id="username">{USERNAME}</div><br />
12
				</div>
13
			</div>
14
			<div class="subcolumns">
15
				<div class="c25l">
16
					<label>{TEXT_DISPLAY_NAME}:</label><br />
17
				</div>
18
				<div class="c60l">
19
					<input type="text" id="display_name" name="display_name" value="{DISPLAY_NAME}" /><br />
20
				</div>
21
			</div>
22
			<div class="subcolumns">
23
				<div class="c25l">
24
					<label>{TEXT_LANGUAGE}:</label><br />
25
				</div>
26
				<div class="c60l">
27
				<select name="language" id="language">
28
					<!-- BEGIN language_list_block -->
29
						<option value="{CODE}"{SELECTED} style="background: url({FLAG}.png) no-repeat center left; padding-left: 20px;">{NAME} ({CODE})</option>
30
					<!-- END language_list_block -->
31
					</select>
32
				</div>
33
			</div>
34
			<div class="subcolumns">
35
				<div class="c25l">
36
					<label>{TEXT_TIMEZONE}:</label><br />
37
				</div>
38
				<div class="c60l">
39
					<select name="timezone" id="timezone">
40
						<!-- BEGIN timezone_list_block -->
41
							<option value="{VALUE}"{SELECTED}>{NAME}</option>
42
						<!-- END timezone_list_block -->
43
					</select>
44
				</div>
45
			</div>
46
			<div class="subcolumns">
47
				<div class="c25l">
48
					<label>{TEXT_DATE_FORMAT}:</label><br />
49
				</div>
50
				<div class="c60l">
51
					<select name="date_format" id="date_format">
52
						<!-- BEGIN date_format_list_block -->
53
							<option value="{VALUE}"{SELECTED}>{NAME}</option>
54
						<!-- END date_format_list_block -->
55
					</select>
56
				</div>
57
			</div>
58
			<div class="subcolumns">
59
				<div class="c25l">
60
					<label>{TEXT_TIME_FORMAT}:</label><br />
61
				</div>
62
				<div class="c60l">
63
					<select name="time_format" id="time_format">
64
						<!-- BEGIN time_format_list_block -->
65
							<option value="{VALUE}"{SELECTED}>{NAME}</option>
66
						<!-- END time_format_list_block -->
67
					</select>
68
				</div>
69
			</div>
70

  
71
			<div class="subcolumns">
72
				<div class="c25l">
73
					<label>{TEXT_EMAIL}:</label><br />
74
				</div>
75
				<div class="c60l">
76
					<input type="text" id="email" name="email" value="{EMAIL}" /><br />
77
				</div>
78
			</div>
79
			<div class="subcolumns">
80
				<div class="c25l">
81
					<label>{TEXT_NEW_PASSWORD}:</label><br />
82
				</div>
83
				<div class="c60l">
84
					<input type="password" id="new_password_1" name="new_password_1" value="{EMPTY_STRING}" /><br />
85
				</div>
86
			</div>
87
			<div class="subcolumns">
88
				<div class="c25l">
89
					<label>{TEXT_RETYPE_NEW_PASSWORD}:</label><br />
90
				</div>
91
				<div class="c60l">
92
					<input type="password" id="new_password_2" name="new_password_2" value="{EMPTY_STRING}" /><br />
93
				</div>
94
			</div>
95
			<div class="subcolumns">
96
				<div class="c25l">
97
					<label>{TEXT_NEED_CURRENT_PASSWORD}:</label><br />
98
				</div>
99
				<div class="c60l">
100
					<input type="password" id="current_password" name="current_password" value="{EMPTY_STRING}" /><br />
101
				</div>
102
			</div>
103
			<div class="subcolumns save_section">
104
				<div class="c25l">
105
					<input type="submit" id="submit" name="submit" value="{TEXT_SAVE}" />
106
					<input type="reset" id="reset" name="reset" value="{TEXT_RESET}" />
107
				</div>
108
				<div class="c25l">
109
				</div>
110
			</div>
111
	</form>
112
</div>
113

  
114
<!-- END main_block -->
1
<!-- BEGIN main_block -->
2
<h2>{HEADING_MY_SETTINGS}</h2>
3
<div class="content_box">
4
	<form name="{FORM_NAME}" id="{FORM_NAME}" action="{ACTION_URL}" method="post">
5
		{FTAN}
6
			<div class="subcolumns">
7
				<div class="c25l">
8
					<label>{TEXT_USERNAME}:</label><br />
9
				</div>
10
				<div class="c60l">
11
					<div id="username">{USERNAME}</div><br />
12
				</div>
13
			</div>
14
			<div class="subcolumns">
15
				<div class="c25l">
16
					<label>{TEXT_DISPLAY_NAME}:</label><br />
17
				</div>
18
				<div class="c60l">
19
					<input type="text" id="display_name" name="display_name" value="{DISPLAY_NAME}" /><br />
20
				</div>
21
			</div>
22
			<div class="subcolumns">
23
				<div class="c25l">
24
					<label>{TEXT_LANGUAGE}:</label><br />
25
				</div>
26
				<div class="c60l">
27
				<select name="language" id="language">
28
					<!-- BEGIN language_list_block -->
29
						<option value="{CODE}"{SELECTED} style="background: url({FLAG}.png) no-repeat center left; padding-left: 20px;">{NAME} ({CODE})</option>
30
					<!-- END language_list_block -->
31
					</select>
32
				</div>
33
			</div>
34
			<div class="subcolumns">
35
				<div class="c25l">
36
					<label>{TEXT_TIMEZONE}:</label><br />
37
				</div>
38
				<div class="c60l">
39
					<select name="timezone" id="timezone">
40
						<!-- BEGIN timezone_list_block -->
41
							<option value="{VALUE}"{SELECTED}>{NAME}</option>
42
						<!-- END timezone_list_block -->
43
					</select>
44
				</div>
45
			</div>
46
			<div class="subcolumns">
47
				<div class="c25l">
48
					<label>{TEXT_DATE_FORMAT}:</label><br />
49
				</div>
50
				<div class="c60l">
51
					<select name="date_format" id="date_format">
52
						<!-- BEGIN date_format_list_block -->
53
							<option value="{VALUE}"{SELECTED}>{NAME}</option>
54
						<!-- END date_format_list_block -->
55
					</select>
56
				</div>
57
			</div>
58
			<div class="subcolumns">
59
				<div class="c25l">
60
					<label>{TEXT_TIME_FORMAT}:</label><br />
61
				</div>
62
				<div class="c60l">
63
					<select name="time_format" id="time_format">
64
						<!-- BEGIN time_format_list_block -->
65
							<option value="{VALUE}"{SELECTED}>{NAME}</option>
66
						<!-- END time_format_list_block -->
67
					</select>
68
				</div>
69
			</div>
70

  
71
			<div class="subcolumns">
72
				<div class="c25l">
73
					<label>{TEXT_EMAIL}:</label><br />
74
				</div>
75
				<div class="c60l">
76
					<input type="text" id="email" name="email" value="{EMAIL}" /><br />
77
				</div>
78
			</div>
79
			<div class="subcolumns">
80
				<div class="c25l">
81
					<label>{TEXT_NEW_PASSWORD}:</label><br />
82
				</div>
83
				<div class="c60l">
84
					<input type="password" id="new_password_1" name="new_password_1" value="{EMPTY_STRING}" /><br />
85
				</div>
86
			</div>
87
			<div class="subcolumns">
88
				<div class="c25l">
89
					<label>{TEXT_RETYPE_NEW_PASSWORD}:</label><br />
90
				</div>
91
				<div class="c60l">
92
					<input type="password" id="new_password_2" name="new_password_2" value="{EMPTY_STRING}" /><br />
93
				</div>
94
			</div>
95
			<hr />
96
			<div class="subcolumns">
97
				<div class="c25l">
98
					<label>{TEXT_NEED_CURRENT_PASSWORD}:</label><br />
99
				</div>
100
				<div class="c60l">
101
					<input type="password" id="current_password" name="current_password" value="{EMPTY_STRING}" /><br />
102
				</div>
103
			</div>
104
			<div class="subcolumns save_section">
105
				<div class="c60l">
106
					<input type="submit" id="submit" name="submit" value="{TEXT_SAVE}" />
107
					<input type="reset" id="reset" name="reset" value="{TEXT_RESET}" />
108
				</div>
109
				<div class="c25l">&nbsp;</div>
110
			</div>
111
	</form>
112
</div>
113

  
114
<!-- END main_block -->
branches/2.8.x/wb/modules/menu_link/save.php
23 23
$update_when_modified = true;
24 24
// Include WB admin wrapper script
25 25
require(WB_PATH.'/modules/admin.php');
26
$backlink = ADMIN_URL.'/pages/modify.php?page_id='.(int)$page_id;
26 27
if (!$admin->checkFTAN())
27 28
{
28 29
	$admin->print_header();
29
	$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'] );
30
	$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'],$backlink );
30 31
}
31 32
$admin->print_header();
32 33

  
......
51 52
if($database->is_error()) {
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff