diff --git a/e107_handlers/user_handler.php b/e107_handlers/user_handler.php index 4a1ecdb5b..5d0f8582d 100644 --- a/e107_handlers/user_handler.php +++ b/e107_handlers/user_handler.php @@ -9,9 +9,9 @@ * Handler - user-related functions * * $Source: /cvs_backup/e107_0.8/e107_handlers/user_handler.php,v $ - * $Revision: 1.5 $ - * $Date: 2008-12-28 22:37:43 $ - * $Author: e107steved $ + * $Revision: 1.6 $ + * $Date: 2008-12-30 14:05:44 $ + * $Author: secretr $ * */ @@ -70,9 +70,9 @@ class UserHandler 0 - Null method 1 - Check for duplicates 2 - Check against $pref['signup_disallow_text'] - + Index is the destination field name. If the source index name is different, specify 'srcName' in the array. - + Possible processing options: 'dbClean' - 'sanitising' method for final value: - 'toDB' - passes final value through $tp->toDB() @@ -141,7 +141,7 @@ class UserHandler { case PASSWORD_E107_MD5 : return md5($password); - + case PASSWORD_E107_SALT : return PASSWORD_E107_ID.md5(md5($password).$login_name); break; @@ -220,7 +220,7 @@ class UserHandler return FALSE; } - + // Checks whether the password value can be converted to the current default // Returns TRUE if conversion possible. // Returns FALSE if conversion not possible, or not needed @@ -340,14 +340,14 @@ class UserHandler if ($pref['user_tracking'] == "session") { $_SESSION[$pref['cookie_name']] = $cookieval; - } - else + } + else { - if ($autologin == 1) + if ($autologin == 1) { // Cookie valid for up to 30 days cookie($pref['cookie_name'], $cookieval, (time() + 3600 * 24 * 30)); - } - else + } + else { cookie($pref['cookie_name'], $cookieval); } @@ -364,7 +364,7 @@ class UserHandler { $classList = array(); global $e_userclass; - if (!isset($e_userclass) && !is_object($e_userclass)) + if (!isset($e_userclass) && !is_object($e_userclass)) { require_once(e_HANDLER."userclass_class.php"); $e_userclass = new user_class; @@ -432,7 +432,7 @@ class UserHandler user_login realname realname realname User Real name user_xup xupexist$ user_xup - XUP file link user_class class class userclass User class (array on form) - + user_loginname may be auto-generated * avatar (user_image) and photo (user_sess) may be uploaded files $changed to match the majority vote @@ -507,7 +507,7 @@ Following fields auto-filled in code as required: return $ret; } - // Given an array of user data intended to be written to the DB, adds empty strings (or other default value) for any field which doesn't have a default in the SQL definition. + // Given an array of user data intended to be written to the DB, adds empty strings (or other default value) for any field which doesn't have a default in the SQL definition. // (Avoids problems with MySQL in STRICT mode.). // Returns TRUE if additions made, FALSE if no change. function addNonDefaulted(&$userInfo) @@ -524,8 +524,8 @@ Following fields auto-filled in code as required: } return $ret; } - - + + // Delete time-expired partial registrations from the user DB function deleteExpired() { @@ -539,4 +539,4 @@ Following fields auto-filled in code as required: } -?> +?> \ No newline at end of file diff --git a/e107_handlers/validator_class.php b/e107_handlers/validator_class.php index 851688245..01a665b25 100644 --- a/e107_handlers/validator_class.php +++ b/e107_handlers/validator_class.php @@ -9,9 +9,9 @@ * Handler - general purpose validation functions * * $Source: /cvs_backup/e107_0.8/e107_handlers/validator_class.php,v $ - * $Revision: 1.3 $ - * $Date: 2008-12-28 22:37:43 $ - * $Author: e107steved $ + * $Revision: 1.4 $ + * $Date: 2008-12-30 14:05:44 $ + * $Author: secretr $ * */ @@ -43,7 +43,7 @@ define('ERR_IMAGE_TOO_HIGH', '21'); The validator functions use an array of parameters for each variable to be validated. The index of the parameter array is the destination field name. - + Possible processing options: 'srcname' - specifies the array index of the source data, where its different to the destination index 'dbClean' - method for preparing the value to write to the DB (done as final step before returning). Options are: @@ -61,7 +61,7 @@ The validator functions use an array of parameters for each variable to be valid 'dataType' - selects special processing methods: 1 - array of numerics (e.g. class membership) - In general, only define an option if its to be used + In general, only define an option if its to be used */ @@ -102,7 +102,7 @@ class validatorClass { continue; // Just loop to the next field - ignore this one. } - } + } if (!$errNum && isset($defs['stripTags'])) { $newValue = trim(strip_tags($value)); @@ -111,7 +111,7 @@ class validatorClass $errNum = ERR_INVALID_CHARS; } $value = $newValue; - } + } if (!$errNum && isset($defs['stripChars'])) { $newValue = trim(preg_replace($defs['stripChars'], "", $value)); @@ -167,7 +167,7 @@ class validatorClass } if (!$errNum && isset($defs['dataType'])) { - switch ($defs['dataType']) + switch ($defs['dataType']) { case 1 : // Assumes we're passed an array variable to be turned into a comma-separated list of integers if (is_array($value)) @@ -289,7 +289,7 @@ class validatorClass 1 - Check for duplicates - field name in table must be the same as array index unless 'dbFieldName' specifies otherwise 2 - Check against the comma-separated wordlist in the $pref named in vetParam['signup_disallow_text'] 3 - Check email address against remote server, only if option enabled - + */ function dbValidateArray(&$targetData, &$definitions, $targetTable, $userID = 0) { @@ -313,7 +313,7 @@ class validatorClass { case 0 : // Shouldn't get this - just do nothing if we do break; - case 1 : // Check for duplicates. + case 1 : // Check for duplicates. if ($v == '') { $errMsg = ERR_MISSING_VALUE; @@ -393,8 +393,8 @@ class validatorClass } return $allOK; } - - + + // Given two arrays, returns an array of those elements in $input which are different from the corresponding element in $refs. // If $addMissing == TRUE, includes any element in $input for which there isn't a corresponding element in $refs function findChanges(&$input, &$refs, $addMissing = FALSE) @@ -458,4 +458,4 @@ class validatorClass } -?> +?> \ No newline at end of file