added invalid email address handling
This commit is contained in:
@@ -95,6 +95,17 @@ function __autoload($class_name)
|
||||
if (function_exists('post_config'))
|
||||
post_config();
|
||||
|
||||
// check for email address problems
|
||||
// use direct database access instead of user class for performance reasons - need not
|
||||
// to include user.class.php in any script
|
||||
if (!isset($verifyemail) &&
|
||||
$login->userid > 0 &&
|
||||
sql_value("SELECT `email_problems` FROM `user` WHERE `user_id`='&1'", 0, $login->userid) != 0)
|
||||
{
|
||||
header("Location: verifyemail.php?page=" . basename($_SERVER['REQUEST_URI']));
|
||||
exit;
|
||||
}
|
||||
|
||||
// normalize important settings
|
||||
function normalize_settings()
|
||||
{
|
||||
|
||||
@@ -49,6 +49,7 @@ class user
|
||||
$this->reUser->addString('username', '', false);
|
||||
$this->reUser->addString('password', null, true);
|
||||
$this->reUser->addString('email', null, true);
|
||||
$this->reUser->addString('email_problems', 0, false);
|
||||
$this->reUser->addFloat('latitude', 0, false);
|
||||
$this->reUser->addFloat('longitude', 0, false);
|
||||
$this->reUser->addDate('last_modified', time(), true, RE_INSERT_IGNORE);
|
||||
@@ -1113,6 +1114,31 @@ class user
|
||||
return true;
|
||||
}
|
||||
|
||||
// email bounce processing
|
||||
function addEmailProblem($licensemail=false)
|
||||
{
|
||||
if ($licensemail)
|
||||
return $this->reUser->setValue('email_problems', 1000001) && $this->save();
|
||||
else
|
||||
return $this->reUser->setValue('email_problems', $this->getEmailProblems() + 1) && $this->save();
|
||||
}
|
||||
|
||||
function getEmailProblems()
|
||||
{
|
||||
// see also common.inc.php "SELECT `email_problems`"
|
||||
return $this->reUser->getValue('email_problems') % 1000000;
|
||||
}
|
||||
|
||||
function missedDataLicenseMail()
|
||||
{
|
||||
return $this->reUser->getValue('email_problems') > 1000000;
|
||||
}
|
||||
|
||||
function confirmEmailAddress()
|
||||
{
|
||||
return $this->reUser->setValue('email_problems', 0) && $this->save();
|
||||
}
|
||||
|
||||
function reload()
|
||||
{
|
||||
$this->reUser->reload();
|
||||
|
||||
Reference in New Issue
Block a user