- Affected version
- 2.2.7
The manual approval queue can be bypassed if any form of spam detection is used when email confirmation is enabled, and manual approval is used.
The process is;
The behaviour exists because of the function
The only true solution is to consult the user change log for the previous
*User state changes related to signup/approvals probably need to be protected from being purged.
The process is;
- An admin enables the flags;
- Enable registration
- Enable email confirmation
- Enable manual approval
- A user signs up, and a spam provider reports they should be moderated
- The user is added to the approval queue, skipping email confirmation
- The user is in a "moderate" state
- The user changes their email address
- The user is removed from the approval queue, and an edit confirmation email is sent.
- The user is in a "email_confirm_edit" state
- The user confirms their email
- The user is now in a "valid" state.
- There is are no user change logs generated
The behaviour exists because of the function
XF\Service\User\EmailConfirmation::advanceUserState
function;
PHP:
protected function advanceUserState()
{
$user = $this->user;
switch ($user->user_state)
{
case 'email_confirm':
if ($this->app->options()->registrationSetup['moderation'])
{
$user->user_state = 'moderated';
break;
}
// otherwise, fall through
case 'email_confirm_edit': // this is a user editing email, never send back to moderation
case 'moderated':
$user->user_state = 'valid';
break;
}
}
The only true solution is to consult the user change log for the previous
user_state
to determine what the user should go back to*. Another problem is not all user_state
changes are recorded when a user is made valid or moderated as the result of email confirmation.*User state changes related to signup/approvals probably need to be protected from being purged.
Last edited: