Changeset 9 for trunk/Modules


Ignore:
Timestamp:
Jun 1, 2023, 1:01:38 AM (18 months ago)
Author:
chronos
Message:
  • Fixed: Modules initialization.
Location:
trunk/Modules
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Map/ModuleMap.php

    r8 r9  
    11<?php
     2
     3include_once(dirname(__FILE__).'/Map.php');
     4include_once(dirname(__FILE__).'/MapGoogle.php');
     5include_once(dirname(__FILE__).'/MapOSM.php');
     6include_once(dirname(__FILE__).'/MapSeznam.php');
    27
    38class ModuleMap extends Module
  • trunk/Modules/User/ModuleUser.php

    r8 r9  
    133133    $this->System->User = new User($this->System);
    134134    if (isset($_SERVER['REMOTE_ADDR'])) $this->System->User->Check();
    135     $this->System->RegisterPage('userlist', 'PageUserList');
    136     $this->System->RegisterPage('user', 'PageUser');
     135    $this->System->RegisterPage(['userlist'], 'PageUserList');
     136    $this->System->RegisterPage(['user'], 'PageUser');
    137137    $this->System->RegisterPageBarItem('Top', 'User', array($this, 'TopBarCallback'));
    138138    $this->System->FormManager->RegisterClass('UserLogin', array(
  • trunk/Modules/User/PasswordHash.php

    r8 r9  
    11<?php
     2
    23
    34class PasswordHash
    45{
    5   function Hash($Password, $Salt)
     6  function Hash(string $Password, string $Salt): string
    67  {
    78    return sha1(sha1($Password).$Salt);
    89  }
    910
    10   function Verify($Password, $Salt, $StoredHash)
     11  function Verify(string $Password, string $Salt, string $StoredHash): bool
    1112  {
    1213    return $this->Hash($Password, $Salt) == $StoredHash;
    1314  }
    1415
    15   function GetSalt()
     16  function GetSalt(): string
    1617  {
    17     mt_srand(microtime(true) * 100000 + memory_get_usage(true));
     18    mt_srand(intval(microtime(true)) * 100000 + memory_get_usage(true));
    1819    return sha1(uniqid(mt_rand(), true));
    1920  }
  • trunk/Modules/User/User.php

    r8 r9  
    143143
    144144            // Send activation mail to user email
    145             $ServerURL = 'http://'.$this->System->Config['Web']['Host'].$this->System->Config['Web']['RootFolder'];
     145            $ServerURL = 'http://'.Core::Cast($this->System)->Config['Web']['Host'].Core::Cast($this->System)->Config['Web']['RootFolder'];
    146146            $Mail = new Mail();
    147147            $Mail->Subject = 'Registrace nového účtu';
     
    154154              '<br/><br/>Na tento email neodpovídejte.", 'text/html');
    155155            $Mail->AddTo($Email, $Name);
    156             $Mail->From = $this->System->Config['Web']['Title'].' <noreplay@zdechov.net>';
     156            $Mail->From = Core::Cast($this->System)->Config['Web']['Title'].' <noreplay@zdechov.net>';
    157157            $Mail->Send();
    158158
     
    368368      $NewPassword = substr(sha1(strtoupper($Row['Login'])), 0, 7);
    369369
    370       $ServerURL = 'http://'.$this->System->Config['Web']['Host'].$this->System->Config['Web']['RootFolder'];
     370      $ServerURL = 'http://'.Core::Cast($this->System)->Config['Web']['Host'].Core::Cast($this->System)->Config['Web']['RootFolder'];
    371371      $Mail = new Mail();
    372372      $Mail->Subject = 'Obnova hesla';
    373       $Mail->From = $this->System->Config['Web']['Title'].' <noreplay@zdechov.net>';
     373      $Mail->From = Core::Cast($this->System)->Config['Web']['Title'].' <noreplay@zdechov.net>';
    374374      $Mail->AddTo($Row['Email'], $Row['Name']);
    375375      $Mail->AddBody('Požádali jste o zaslání nového hesla na serveru <a href="'.$ServerURL.'">'.$ServerURL.'"</a>.<br />\n'.
Note: See TracChangeset for help on using the changeset viewer.