Ignore:
Timestamp:
Aug 11, 2023, 12:22:14 PM (17 months ago)
Author:
chronos
Message:
  • Added: Require configuration for user registration and password recovery that user is a human.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/User/UserPage.php

    r922 r954  
    183183        {
    184184          $Form->LoadValuesFromForm();
    185           $Result = $User->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']);
    186           $Output .= $this->SystemMessage('Obnova hesla', $Result);
     185          if ($Form->Values['IsHuman'] == 1)
     186          {
     187            $Result = $User->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']);
     188            $Output .= $this->SystemMessage('Obnova hesla', $Result);
     189          } else
     190          {
     191            $Result = USER_NOT_HUMAN;
     192            $Output .= $this->SystemMessage('Nejsi člověk. Strojům není dovoleno obnovovat heslo.', $Result);
     193          }
    187194          if ($Result <> USER_PASSWORD_RECOVERY_SUCCESS)
    188195          {
     
    204211        $Form->SetClass('UserRegister');
    205212        $Form->LoadValuesFromForm();
    206         $Result = $User->Register($Form->Values['Login'], $Form->Values['Password'],
    207           $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name']);
    208         $Output .= $this->SystemMessage('Registrace nového účtu', $Result);
     213        if ($Form->Values['IsHuman'] == 1)
     214        {
     215          $Result = $User->Register($Form->Values['Login'], $Form->Values['Password'],
     216            $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name']);
     217          $Output .= $this->SystemMessage('Registrace nového účtu', $Result);
     218        } else
     219        {
     220          $Result = USER_NOT_HUMAN;
     221          $Output .= $this->SystemMessage('Nejsi člověk. Strojům není dovoleno se registrovat.', $Result);
     222        }
    209223        if ($Result <> USER_REGISTRATED)
    210224        {
Note: See TracChangeset for help on using the changeset viewer.