Changeset 8 for trunk/Modules/User
- Timestamp:
- Jun 1, 2023, 12:18:18 AM (19 months ago)
- Location:
- trunk/Modules/User
- Files:
-
- 1 added
- 1 copied
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/User/ModuleUser.php
r7 r8 1 1 <?php 2 2 3 include_once(dirname(__FILE__).'/User Model.php');4 include_once(dirname(__FILE__).'/ UserList.php');5 include_once(dirname(__FILE__).'/ UserPage.php');6 7 class ModuleUser extends AppModule3 include_once(dirname(__FILE__).'/User.php'); 4 include_once(dirname(__FILE__).'/PageUserList.php'); 5 include_once(dirname(__FILE__).'/PageUser.php'); 6 7 class ModuleUser extends Module 8 8 { 9 9 var $UserPanel; … … 21 21 } 22 22 23 function DoInstall() 23 function DoInstall(): void 24 24 { 25 25 $this->Database->query('CREATE TABLE IF NOT EXISTS `User` ('. … … 107 107 } 108 108 109 function DoUninstall() 109 function DoUninstall(): void 110 110 { 111 111 $this->Database->query('DROP TABLE `PermissionUserAssignment`'); … … 117 117 } 118 118 119 function DoUpgrade() 119 function DoUpgrade(): string 120 120 { 121 121 /* … … 126 126 } 127 127 */ 128 } 129 130 function DoStart() 128 return ''; 129 } 130 131 function DoStart(): void 131 132 { 132 133 $this->System->User = new User($this->System); … … 281 282 } 282 283 283 function DoStop() 284 function DoStop(): void 284 285 { 285 286 } -
trunk/Modules/User/PageUser.php
r7 r8 3 3 class PageUser extends Page 4 4 { 5 var $FullTitle = 'Uživatel'; 6 var $ShortTitle = 'Uživatel'; 7 var $ParentClass = 'PagePortal'; 5 function __construct(System $System) 6 { 7 parent::__construct($System); 8 $this->Title = 'Uživatel'; 9 $this->Description = 'Uživatel'; 10 $this->ParentClass = 'PagePortal'; 11 } 8 12 9 13 function Panel($Title, $Content, $Menu = array()) … … 88 92 } 89 93 90 function Show() 94 function Show(): string 91 95 { 92 96 $Output = ''; -
trunk/Modules/User/PageUserList.php
r7 r8 3 3 class PageUserList extends Page 4 4 { 5 var $FullTitle = 'Seznam registrovaných uživatelů'; 6 var $ShortTitle = 'Seznam uživatelů'; 7 var $ParentClass = 'PagePortal'; 5 function __construct(System $System) 6 { 7 parent::__construct($System); 8 $this->Title = 'Seznam uživatelů'; 9 $this->Description = 'Seznam registrovaných uživatelů'; 10 $this->ParentClass = 'PagePortal'; 11 } 8 12 9 function Show() 13 function Show(): string 10 14 { 11 15 if (!$this->System->User->CheckPermission('User', 'ShowList')) -
trunk/Modules/User/User.php
r7 r8 1 1 <?php 2 3 include_once(dirname(__FILE__).'/PasswordHash.php'); 2 4 3 5 define('LOGIN_USED', 'Přihlašovací jméno již použito.'); … … 28 30 define('DEFAULT_GROUP', 1); 29 31 30 class PasswordHash31 {32 function Hash($Password, $Salt)33 {34 return sha1(sha1($Password).$Salt);35 }36 37 function Verify($Password, $Salt, $StoredHash)38 {39 return $this->Hash($Password, $Salt) == $StoredHash;40 }41 42 function GetSalt()43 {44 mt_srand(microtime(true) * 100000 + memory_get_usage(true));45 return sha1(uniqid(mt_rand(), true));46 }47 }48 49 32 // TODO: Make User class more general without dependencies to System, Mail, Log 50 33
Note:
See TracChangeset
for help on using the changeset viewer.