Changeset 922 for trunk/Modules/User


Ignore:
Timestamp:
Feb 28, 2022, 8:53:22 AM (3 years ago)
Author:
chronos
Message:
  • Modified: Do not determine form submit from URL but directly from submit variable and filled form variables.
  • Added: Use system config from /etc/isp-central directory if standard config is not available.
  • Modified: Form file code cleanup. FormManager class moved to separate file.
Location:
trunk/Modules/User
Files:
2 edited

Legend:

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

    r916 r922  
    418418        $Row['Id'].'&H='.$Row['Password'].'&P='.$NewPassword.'">tento odkaz</a>.'."\n<br />".
    419419        "Po přihlášení si prosím změňte heslo na nové.\n\n<br><br>Na tento email neodpovídejte.", 'text/html');
    420       print_r($Mail);
    421420      $Mail->Send();
    422421
  • trunk/Modules/User/UserPage.php

    r912 r922  
    180180        $Form = new Form($this->System->FormManager);
    181181        $Form->SetClass('PasswordRecovery');
    182         $Form->OnSubmit = '?Action=PasswordRecovery2';
    183         $Output .= $Form->ShowEditForm();
    184       } else
    185       if ($Action == 'PasswordRecovery2')
    186       {
    187         $Form = new Form($this->System->FormManager);
    188         $Form->SetClass('PasswordRecovery');
    189         $Form->LoadValuesFromForm();
    190         $Result = $User->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']);
    191         $Output .= $this->SystemMessage('Obnova hesla', $Result);
    192         if ($Result <> USER_PASSWORD_RECOVERY_SUCCESS)
    193         {
     182        if ($Form->HasAllPostVariables())
     183        {
     184          $Form->LoadValuesFromForm();
     185          $Result = $User->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']);
     186          $Output .= $this->SystemMessage('Obnova hesla', $Result);
     187          if ($Result <> USER_PASSWORD_RECOVERY_SUCCESS)
     188          {
     189            $Output .= $Form->ShowEditForm();
     190          }
     191        } else
     192        {
     193          $Form->OnSubmit = '?Action=PasswordRecovery';
    194194          $Output .= $Form->ShowEditForm();
    195195        }
Note: See TracChangeset for help on using the changeset viewer.