From 743fa0a70999261e1948b40bb31725774d3c4fb9 Mon Sep 17 00:00:00 2001 From: e107steved Date: Sun, 12 Aug 2007 21:40:49 +0000 Subject: [PATCH] Bugtracker #3497 - force entry of email address if blank and required --- class2.php | 13 +++++++++---- e107_themes/templates/usersettings_template.php | 6 +++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/class2.php b/class2.php index a37bcd153..aec6ef2c9 100644 --- a/class2.php +++ b/class2.php @@ -11,9 +11,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/class2.php,v $ -| $Revision: 1.20 $ -| $Date: 2007-04-30 21:00:10 $ -| $Author: e107coders $ +| $Revision: 1.21 $ +| $Date: 2007-08-12 21:40:49 $ +| $Author: e107steved $ +----------------------------------------------------------------------------+ */ // @@ -1485,8 +1485,11 @@ if(!function_exists("print_a")) { } } -function force_userupdate() { +// Check that all required user fields (including extended fields) are valid. +// Return TRUE if update required +function force_userupdate() +{ global $sql,$pref,$currentUser; if (e_PAGE == "usersettings.php" || strpos(e_SELF, ADMINDIR) == TRUE) @@ -1504,6 +1507,8 @@ function force_userupdate() { } } + if (!varset($pref['disable_emailcheck'],TRUE) && !trim($currentUser['user_email'])) return TRUE; + if($sql -> db_Select("user_extended_struct", "user_extended_struct_name", "user_extended_struct_required = '1'")) { while($row = $sql -> db_Fetch()) diff --git a/e107_themes/templates/usersettings_template.php b/e107_themes/templates/usersettings_template.php index 958cdc1ad..7fe63daae 100755 --- a/e107_themes/templates/usersettings_template.php +++ b/e107_themes/templates/usersettings_template.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_themes/templates/usersettings_template.php,v $ -| $Revision: 1.3 $ -| $Date: 2007-07-23 20:06:05 $ +| $Revision: 1.4 $ +| $Date: 2007-08-12 21:40:49 $ | $Author: e107steved $ +----------------------------------------------------------------------------+ */ @@ -135,7 +135,7 @@ $USERSETTINGS_EDIT = " {PASSWORD2} - ".LAN_112." + ".LAN_112.req(!$pref['disable_emailcheck'])." {EMAIL}