1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 14:17:49 +02:00

More useful error message when user_name and user_xup conflict

During e_user_provider::signup()
This commit is contained in:
Nick Liu
2020-02-25 13:10:02 +01:00
parent 639943e7ed
commit 7bae4a04c4

View File

@@ -1474,7 +1474,7 @@ class e_user_provider
{
if ($redirectUrl)
{
e107::getRedirect()->redirect($redirectUrl);
$this->redirectAndForwardMessages($redirectUrl);
}
return false;
// throw new Exception( "Signup failed! User already signed in. ", 1); // TODO lan
@@ -1535,11 +1535,16 @@ class e_user_provider
if ($uid = $sql->retrieve("user", "user_id", "user_xup='" . $sql->escape($this->userId()) . "' " . $insert . " OR user_loginname='{$userdata['user_loginname']}' OR user_name='{$userdata['user_name']}'"))
{
// $this->login($redirectUrl); // auto-login
e107::getUser()->loginProvider($this->userId());
$result = e107::getUser()->loginProvider($this->userId());
if (!$result)
{
e107::getMessage()->addError("user_name already exists but doesn't have a matching user_xup");
}
if ($redirectUrl)
{
e107::getRedirect()->redirect($redirectUrl);
$this->redirectAndForwardMessages($redirectUrl);
}
return false;
@@ -1657,7 +1662,7 @@ class e_user_provider
{
if ($redirectUrl)
{
e107::getRedirect()->redirect($redirectUrl);
$this->redirectAndForwardMessages($redirectUrl);
}
return true;
}