Changeset 954


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

Legend:

Unmodified
Added
Removed
  • trunk/Application/Version.php

    r953 r954  
    11<?php
    22
    3 $Revision = 953; // Subversion revision
     3$Revision = 954; // Subversion revision
    44$DatabaseRevision = 953; // SQL structure revision
    55$ReleaseTime = strtotime('2023-08-11');
  • trunk/Modules/User/User.php

    r951 r954  
    8282        'Name' => array('Type' => 'String', 'Caption' => 'Zobrazované jméno', 'Default' => ''),
    8383        'Email' => array('Type' => 'String', 'Caption' => 'E-mail', 'Default' => ''),
     84        'IsHuman' => array('Type' => 'Boolean', 'Caption' => 'Jsi člověk?', 'Default' => 0),
    8485      ),
    8586    ));
     
    9192        'Name' => array('Type' => 'String', 'Caption' => 'Přihlašovací jméno', 'Default' => ''),
    9293        'Email' => array('Type' => 'String', 'Caption' => 'E-mail', 'Default' => ''),
     94        'IsHuman' => array('Type' => 'Boolean', 'Caption' => 'Jsi člověk?', 'Default' => 0),
    9395      ),
    9496    ));
  • trunk/Modules/User/UserModel.php

    r952 r954  
    55define('EMAIL_USED', 'Email je již použitý. Použijte jiný email nebo si můžete nechat zaslat nové heslo na email.');
    66define('USER_REGISTRATED', 'Uživatel registrován. Na zadanou emailovou adresu byl poslán mail s odkazem pro aktivování účtu.');
     7define('USER_NOT_HUMAN', 'Uživate nepotvrdil, že je člověk.');
    78define('USER_REGISTRATION_CONFIRMED', 'Vaše registrace byla potvrzena.');
    89define('DATA_MISSING', 'Chybí emailová adresa, přezdívka, nebo některé z hesel.');
  • 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.