Changeset 9 for trunk/Modules/User
- Timestamp:
- Jun 1, 2023, 1:01:38 AM (19 months ago)
- Location:
- trunk/Modules/User
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/User/ModuleUser.php
r8 r9 133 133 $this->System->User = new User($this->System); 134 134 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'); 137 137 $this->System->RegisterPageBarItem('Top', 'User', array($this, 'TopBarCallback')); 138 138 $this->System->FormManager->RegisterClass('UserLogin', array( -
trunk/Modules/User/PasswordHash.php
r8 r9 1 1 <?php 2 2 3 3 4 class PasswordHash 4 5 { 5 function Hash( $Password, $Salt)6 function Hash(string $Password, string $Salt): string 6 7 { 7 8 return sha1(sha1($Password).$Salt); 8 9 } 9 10 10 function Verify( $Password, $Salt, $StoredHash)11 function Verify(string $Password, string $Salt, string $StoredHash): bool 11 12 { 12 13 return $this->Hash($Password, $Salt) == $StoredHash; 13 14 } 14 15 15 function GetSalt() 16 function GetSalt(): string 16 17 { 17 mt_srand( microtime(true) * 100000 + memory_get_usage(true));18 mt_srand(intval(microtime(true)) * 100000 + memory_get_usage(true)); 18 19 return sha1(uniqid(mt_rand(), true)); 19 20 } -
trunk/Modules/User/User.php
r8 r9 143 143 144 144 // 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']; 146 146 $Mail = new Mail(); 147 147 $Mail->Subject = 'Registrace nového účtu'; … … 154 154 '<br/><br/>Na tento email neodpovídejte.", 'text/html'); 155 155 $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>'; 157 157 $Mail->Send(); 158 158 … … 368 368 $NewPassword = substr(sha1(strtoupper($Row['Login'])), 0, 7); 369 369 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']; 371 371 $Mail = new Mail(); 372 372 $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>'; 374 374 $Mail->AddTo($Row['Email'], $Row['Name']); 375 375 $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.