Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1346)
+++ branches/2.8.x/CHANGELOG	(revision 1347)
@@ -11,6 +11,9 @@
 ! = Update/Change
 
 ------------------------------------- 2.8.1 -------------------------------------
+23 Nov-2010 Dietmar Woellbrink (Luisehahne)
+# fix Droplet LoginBox fronend_signup (tks to Maverik)
+# fix save user e-mail,
 12-May-2010 Dietmar Woellbrink (Luisehahne)
 #	Ticket #999 wrong sql statement in admin/pages/index.php (Tks to Lucutus)
 12-May-2010 Dietmar Woellbrink (Luisehahne)
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1346)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1347)
@@ -1,57 +1,57 @@
-<?php
-/*
- * 						About WebsiteBaker
- *
- * Website Baker is a PHP-based Content Management System (CMS)
- * designed with one goal in mind: to enable its users to produce websites
- * with ease.
- *
- * 						LICENSE INFORMATION
- *
- * WebsiteBaker is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * WebsiteBaker is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * 				WebsiteBaker Extra Information
- *
- * This file is where the WB release version is stored.
- *
- */
-/**
- *
- * @category     	admin
- * @package      	interface
- * @author          WebsiteBaker Project
- * @copyright       2004-2009, Ryan Djurovich
- * @copyright       2009-2010, Website Baker Org. e.V.
- * @link			http://www.websitebaker2.org/
- * @license         http://www.gnu.org/licenses/gpl.html
- * @platform        WebsiteBaker 2.8.x
- * @requirements    PHP 4.3.4 and higher
- * @revision     	$Revision$
- * @version      	$Id$
- * @filesource		$HeadURL$
- * @lastmodified    $Date$
- * 
- */
-
-if(!defined('WB_URL')) {
-	header('Location: ../index.php');
-	exit(0);
-}
-
-// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
-if(!defined('VERSION')) define('VERSION', '2.8.x');
-if(!defined('REVISION')) define('REVISION', '1346');
-
+<?php
+/*
+ * 						About WebsiteBaker
+ *
+ * Website Baker is a PHP-based Content Management System (CMS)
+ * designed with one goal in mind: to enable its users to produce websites
+ * with ease.
+ *
+ * 						LICENSE INFORMATION
+ *
+ * WebsiteBaker is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * WebsiteBaker is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * 				WebsiteBaker Extra Information
+ *
+ * This file is where the WB release version is stored.
+ *
+ */
+/**
+ *
+ * @category     	admin
+ * @package      	interface
+ * @author          WebsiteBaker Project
+ * @copyright       2004-2009, Ryan Djurovich
+ * @copyright       2009-2010, Website Baker Org. e.V.
+ * @link			http://www.websitebaker2.org/
+ * @license         http://www.gnu.org/licenses/gpl.html
+ * @platform        WebsiteBaker 2.8.1
+ * @requirements    PHP 4.3.4 and higher
+ * @revision     	$Revision$
+ * @version      	$Id$
+ * @filesource		$HeadURL$
+ * @lastmodified    $Date$
+ * 
+ */
+
+if(!defined('WB_URL')) {
+	header('Location: ../index.php');
+	exit(0);
+}
+
+// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
+if(!defined('VERSION')) define('VERSION', '2.8.1');
+if(!defined('REVISION')) define('REVISION', '1347');
+
 ?>
\ No newline at end of file
Index: branches/2.8.x/wb/admin/users/save.php
===================================================================
--- branches/2.8.x/wb/admin/users/save.php	(revision 1346)
+++ branches/2.8.x/wb/admin/users/save.php	(revision 1347)
@@ -1,112 +1,112 @@
-<?php
-/**
- *
- * @category        admin
- * @package         users
- * @author          WebsiteBaker Project
- * @copyright       2004-2009, Ryan Djurovich
- * @copyright       2009-2010, Website Baker Org. e.V.
- * @link			http://www.websitebaker2.org/
- * @license         http://www.gnu.org/licenses/gpl.html
- * @platform        WebsiteBaker 2.8.x
- * @requirements    PHP 4.4.9 and higher
- * @version         $Id$
- * @filesource		$HeadURL$
- * @lastmodified    $Date$
- *
- */
-
-// Print admin header
-require('../../config.php');
-require_once(WB_PATH.'/framework/class.admin.php');
-$admin = new admin('Access', 'users_modify');
-
-// Create new database object
-$database = new database();
-
-// Check if user id is a valid number and doesnt equal 1
-if(!isset($_POST['user_id']) OR !is_numeric($_POST['user_id']) OR $_POST['user_id'] == 1) {
-	header("Location: index.php");
-	exit(0);
-} else {
-	$user_id = $_POST['user_id'];
-}
-
-// Gather details entered
-$groups_id = (isset($_POST['groups'])) ? implode(",", $admin->add_slashes($_POST['groups'])) : '';
-$active = $admin->add_slashes($_POST['active'][0]);
-$username_fieldname = $admin->get_post_escaped('username_fieldname');
-$username = strtolower($admin->get_post_escaped($username_fieldname));
-$password = $admin->get_post('password');
-$password2 = $admin->get_post('password2');
-$display_name = $admin->get_post_escaped('display_name');
-$email = $admin->get_post_escaped('email');
-$home_folder = $admin->get_post_escaped('home_folder');
-
-// Create a javascript back link
-$js_back = "javascript: history.go(-1);";
-
-// Check values
-if($groups_id == "") {
-	$admin->print_error($MESSAGE['USERS']['NO_GROUP'], $js_back);
-}
-if(strlen($username) < 2) {
-	$admin->print_error($MESSAGE['USERS']['USERNAME_TOO_SHORT'], $js_back);
-}
-if($password != "") {
-	if(strlen($password) < 2) {
-		$admin->print_error($MESSAGE['USERS']['PASSWORD_TOO_SHORT'], $js_back);
-	}
-	if($password != $password2) {
-		$admin->print_error($MESSAGE['USERS']['PASSWORD_MISMATCH'], $js_back);
-	}
-}
-
-if($email != "")
-{
-	if($admin->validate_email($email) == false)
-    {
-        $admin->print_error($MESSAGE['USERS']['INVALID_EMAIL'], $js_back);
-	}
-} else { // e-mail must be present
-	$admin->print_error($MESSAGE['SIGNUP']['NO_EMAIL'], $js_back);
-}
-
-// Check if the email already exists
-$results = $database->query("SELECT user_id FROM ".TABLE_PREFIX."users WHERE email = '".$admin->add_slashes($_POST['email'])."'");
-if($results->numRows() > 0)
-{
-	if(isset($MESSAGE['USERS']['EMAIL_TAKEN']))
-    {
-		$admin->print_error($MESSAGE['USERS']['EMAIL_TAKEN'], $js_back);
-	} else {
-		$admin->print_error($MESSAGE['USERS']['INVALID_EMAIL'], $js_back);
-	}
-}
-
-// Prevent from renaming user to "admin"
-if($username != 'admin') {
-	$username_code = ", username = '$username'";
-} else {
-	$username_code = '';
-}
-
-// Update the database
-if($password == "") {
-	$query = "UPDATE ".TABLE_PREFIX."users SET groups_id = '$groups_id', active = '$active'$username_code, display_name = '$display_name', home_folder = '$home_folder', email = '$email' WHERE user_id = '$user_id'";
-} else {
-	// MD5 supplied password
-	$md5_password = md5($password);
-	$query = "UPDATE ".TABLE_PREFIX."users SET groups_id = '$groups_id', active = '$active'$username_code, display_name = '$display_name', home_folder = '$home_folder', email = '$email', password = '$md5_password' WHERE user_id = '$user_id'";
-}
-$database->query($query);
-if($database->is_error()) {
-	$admin->print_error($database->get_error());
-} else {
-	$admin->print_success($MESSAGE['USERS']['SAVED']);
-}
-
-// Print admin footer
-$admin->print_footer();
-
+<?php
+/**
+ *
+ * @category        admin
+ * @package         users
+ * @author          WebsiteBaker Project
+ * @copyright       2004-2009, Ryan Djurovich
+ * @copyright       2009-2010, Website Baker Org. e.V.
+ * @link			http://www.websitebaker2.org/
+ * @license         http://www.gnu.org/licenses/gpl.html
+ * @platform        WebsiteBaker 2.8.x
+ * @requirements    PHP 4.4.9 and higher
+ * @version         $Id$
+ * @filesource		$HeadURL$
+ * @lastmodified    $Date$
+ *
+ */
+
+// Print admin header
+require('../../config.php');
+require_once(WB_PATH.'/framework/class.admin.php');
+$admin = new admin('Access', 'users_modify');
+
+// Create new database object
+$database = new database();
+
+// Check if user id is a valid number and doesnt equal 1
+if(!isset($_POST['user_id']) OR !is_numeric($_POST['user_id']) OR $_POST['user_id'] == 1) {
+	header("Location: index.php");
+	exit(0);
+} else {
+	$user_id = $_POST['user_id'];
+}
+
+// Gather details entered
+$groups_id = (isset($_POST['groups'])) ? implode(",", $admin->add_slashes($_POST['groups'])) : '';
+$active = $admin->add_slashes($_POST['active'][0]);
+$username_fieldname = $admin->get_post_escaped('username_fieldname');
+$username = strtolower($admin->get_post_escaped($username_fieldname));
+$password = $admin->get_post('password');
+$password2 = $admin->get_post('password2');
+$display_name = $admin->get_post_escaped('display_name');
+$email = $admin->get_post_escaped('email');
+$home_folder = $admin->get_post_escaped('home_folder');
+
+// Create a javascript back link
+$js_back = "javascript: history.go(-1);";
+
+// Check values
+if($groups_id == "") {
+	$admin->print_error($MESSAGE['USERS']['NO_GROUP'], $js_back);
+}
+if(strlen($username) < 2) {
+	$admin->print_error($MESSAGE['USERS']['USERNAME_TOO_SHORT'], $js_back);
+}
+if($password != "") {
+	if(strlen($password) < 2) {
+		$admin->print_error($MESSAGE['USERS']['PASSWORD_TOO_SHORT'], $js_back);
+	}
+	if($password != $password2) {
+		$admin->print_error($MESSAGE['USERS']['PASSWORD_MISMATCH'], $js_back);
+	}
+}
+
+if($email != "")
+{
+	if($admin->validate_email($email) == false)
+    {
+        $admin->print_error($MESSAGE['USERS']['INVALID_EMAIL'], $js_back);
+	}
+} else { // e-mail must be present
+	$admin->print_error($MESSAGE['SIGNUP']['NO_EMAIL'], $js_back);
+}
+
+// Check if the email already exists
+$results = $database->query("SELECT user_id FROM ".TABLE_PREFIX."users WHERE email = '".$admin->add_slashes($_POST['email'])."' AND user_id <> '".$user_id."' ");
+if($results->numRows() > 0)
+{
+	if(isset($MESSAGE['USERS']['EMAIL_TAKEN']))
+    {
+		$admin->print_error($MESSAGE['USERS']['EMAIL_TAKEN'], $js_back);
+	} else {
+		$admin->print_error($MESSAGE['USERS']['INVALID_EMAIL'], $js_back);
+	}
+}
+
+// Prevent from renaming user to "admin"
+if($username != 'admin') {
+	$username_code = ", username = '$username'";
+} else {
+	$username_code = '';
+}
+
+// Update the database
+if($password == "") {
+	$query = "UPDATE ".TABLE_PREFIX."users SET groups_id = '$groups_id', active = '$active'$username_code, display_name = '$display_name', home_folder = '$home_folder', email = '$email' WHERE user_id = '$user_id'";
+} else {
+	// MD5 supplied password
+	$md5_password = md5($password);
+	$query = "UPDATE ".TABLE_PREFIX."users SET groups_id = '$groups_id', active = '$active'$username_code, display_name = '$display_name', home_folder = '$home_folder', email = '$email', password = '$md5_password' WHERE user_id = '$user_id'";
+}
+$database->query($query);
+if($database->is_error()) {
+	$admin->print_error($database->get_error());
+} else {
+	$admin->print_success($MESSAGE['USERS']['SAVED']);
+}
+
+// Print admin footer
+$admin->print_footer();
+
 ?>
\ No newline at end of file
Index: branches/2.8.x/wb/modules/droplets/example/LoginBox.php
===================================================================
--- branches/2.8.x/wb/modules/droplets/example/LoginBox.php	(revision 1346)
+++ branches/2.8.x/wb/modules/droplets/example/LoginBox.php	(revision 1347)
@@ -1,24 +1,24 @@
 //:Puts a Login / Logout box on your page.
 //:Use: [[LoginBox]]. Remember to enable frontend login in your website settings.
-global $wb, $TEXT, $MENU;
-$return_value = " ";
-if(FRONTEND_LOGIN == 'enabled' && VISIBILITY != 'private' && $wb->get_session('USER_ID') == '') {
-	$return_value  = '<form name="login" action="'.LOGIN_URL.'" method="post" class="login_table">';
-	$return_value .= '<h2>'.$TEXT['LOGIN'].'</h2>';
-	$return_value .= $TEXT['USERNAME'].':<input type="text" name="username" style="text-transform: lowercase;" /><br />';
-	$return_value .= $TEXT['PASSWORD'].':<input type="password" name="password" /><br />';
-	$return_value .= '<input type="submit" name="submit" value="'.$TEXT['LOGIN'].'" class="dbutton" /><br />';
-	$return_value .= '<a href="'.FORGOT_URL.'">'.$TEXT['FORGOT_DETAILS'].'</a><br />';
-	if(is_numeric(FRONTEND_SIGNUP))  
-		$return_value .= '<a href="'.SIGNUP_URL.'">'.$TEXT['SIGNUP'].'</a>';
-	$return_value .= '</form>';
-} elseif(FRONTEND_LOGIN == 'enabled' && is_numeric($wb->get_session('USER_ID'))) {
-	$return_value = '<form name="logout" action="'.LOGOUT_URL.'" method="post" class="login_table">';
-	$return_value .= '<h2>'.$TEXT['LOGGED_IN'].'</h2>';
-	$return_value .= $TEXT['WELCOME_BACK'].', '.$wb->get_display_name().'<br />';
-	$return_value .= '<input type="submit" name="submit" value="'.$MENU['LOGOUT'].'" class="dbutton" /><br />';
-	$return_value .= '<a href="'.PREFERENCES_URL.'">'.$MENU['PREFERENCES'].'</a><br />';
-	$return_value .= '<a href="'.ADMIN_URL.'/index.php" target="_blank">'.$TEXT['ADMINISTRATION'].'</a>';
-	$return_value .= '</form>';
-}
+global $wb, $TEXT, $MENU;
+$return_value = " ";
+if(FRONTEND_LOGIN == 'enabled' && VISIBILITY != 'private' && $wb->get_session('USER_ID') == '') {
+	$return_value  = '<form name="login" action="'.LOGIN_URL.'" method="post" class="login_table">';
+	$return_value .= '<h2>'.$TEXT['LOGIN'].'</h2>';
+	$return_value .= $TEXT['USERNAME'].':<input type="text" name="username" style="text-transform: lowercase;" /><br />';
+	$return_value .= $TEXT['PASSWORD'].':<input type="password" name="password" /><br />';
+	$return_value .= '<input type="submit" name="submit" value="'.$TEXT['LOGIN'].'" class="dbutton" /><br />';
+	$return_value .= '<a href="'.FORGOT_URL.'">'.$TEXT['FORGOT_DETAILS'].'</a><br />';
+	if(is_numeric(FRONTEND_SIGNUP) && (FRONTEND_SIGNUP > 0))  
+		$return_value .= '<a href="'.SIGNUP_URL.'">'.$TEXT['SIGNUP'].'</a>';
+	$return_value .= '</form>';
+} elseif(FRONTEND_LOGIN == 'enabled' && is_numeric($wb->get_session('USER_ID'))) {
+	$return_value = '<form name="logout" action="'.LOGOUT_URL.'" method="post" class="login_table">';
+	$return_value .= '<h2>'.$TEXT['LOGGED_IN'].'</h2>';
+	$return_value .= $TEXT['WELCOME_BACK'].', '.$wb->get_display_name().'<br />';
+	$return_value .= '<input type="submit" name="submit" value="'.$MENU['LOGOUT'].'" class="dbutton" /><br />';
+	$return_value .= '<a href="'.PREFERENCES_URL.'">'.$MENU['PREFERENCES'].'</a><br />';
+	$return_value .= '<a href="'.ADMIN_URL.'/index.php" target="_blank">'.$TEXT['ADMINISTRATION'].'</a>';
+	$return_value .= '</form>';
+}
 return $return_value;
\ No newline at end of file
