mirror of
https://github.com/e107inc/e107.git
synced 2025-08-10 16:46:50 +02:00
Password options for logon, email login option, random user name/PW generation, Bugtracker #4393 and possibly others previously added to 0.7
This commit is contained in:
@@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_handlers/user_extended_class.php,v $
|
||||
| $Revision: 1.12 $
|
||||
| $Date: 2008-05-25 15:31:58 $
|
||||
| $Revision: 1.13 $
|
||||
| $Date: 2008-06-13 20:20:21 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@@ -94,6 +94,33 @@ class e107_user_extended
|
||||
}
|
||||
|
||||
|
||||
// $val is whatever the user entered.
|
||||
// $params is the field definition
|
||||
// Return FALSE if acceptable, TRUE if fail , error message on regex fail if the message is defined
|
||||
function user_extended_validate_entry($val, $params)
|
||||
{
|
||||
global $tp;
|
||||
$parms = explode("^,^", $params['user_extended_struct_parms']);
|
||||
$requiredField = $params['user_extended_struct_required'] == 1;
|
||||
$regex = $tp->toText($parms[1]);
|
||||
$regexfail = $tp->toText($parms[2]);
|
||||
if (defined($regexfail)) { $regexfail = constant($regexfail); }
|
||||
if($val == '' && $requiredField) return TRUE;
|
||||
switch ($type)
|
||||
{
|
||||
case EUF_DATE :
|
||||
if ($requiredField && ($val == '0000-00-00')) return TRUE;
|
||||
break;
|
||||
}
|
||||
if($regex != "" && $val != "")
|
||||
{
|
||||
if(!preg_match($regex, $val)) return $regexfail ? $regexfail : TRUE;
|
||||
}
|
||||
return FALSE; // Pass by default here
|
||||
}
|
||||
|
||||
|
||||
|
||||
function user_extended_get_categories($byID = TRUE)
|
||||
{
|
||||
$ret = array();
|
||||
|
Reference in New Issue
Block a user