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