Changeset 10 for trunk/Modules/User/ModuleUser.php
- Timestamp:
- Jun 1, 2023, 1:31:28 AM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/User/ModuleUser.php
r9 r10 131 131 function DoStart(): void 132 132 { 133 $this->System->User = new User($this->System);134 if (isset($_SERVER['REMOTE_ADDR'])) $this->System->User->Check();133 Core::Cast($this->System)->User = new User($this->System); 134 if (isset($_SERVER['REMOTE_ADDR'])) Core::Cast($this->System)->User->Check(); 135 135 $this->System->RegisterPage(['userlist'], 'PageUserList'); 136 136 $this->System->RegisterPage(['user'], 'PageUser'); 137 $this->System->RegisterPageBarItem('Top', 'User', array($this, 'TopBarCallback'));138 $this->System->FormManager->RegisterClass('UserLogin', array(137 Core::Cast($this->System)->RegisterPageBarItem('Top', 'User', array($this, 'TopBarCallback')); 138 Core::Cast($this->System)->FormManager->RegisterClass('UserLogin', array( 139 139 'Title' => 'Přihlášení uživatele', 140 140 'SubmitText' => 'Přihlásit', … … 146 146 ), 147 147 )); 148 $this->System->FormManager->RegisterClass('UserOptions', array(148 Core::Cast($this->System)->FormManager->RegisterClass('UserOptions', array( 149 149 'Title' => 'Základní nastavení', 150 150 'Table' => 'User', … … 158 158 ), 159 159 )); 160 $this->System->FormManager->RegisterClass('UserRegister', array(160 Core::Cast($this->System)->FormManager->RegisterClass('UserRegister', array( 161 161 'Title' => 'Registrace uživatele', 162 162 'SubmitText' => 'Registrovat', … … 170 170 ), 171 171 )); 172 $this->System->FormManager->RegisterClass('PasswordRecovery', array(172 Core::Cast($this->System)->FormManager->RegisterClass('PasswordRecovery', array( 173 173 'Title' => 'Obnova hesla', 174 174 'SubmitText' => 'Obnovit', … … 179 179 ), 180 180 )); 181 $this->System->FormManager->RegisterClass('APIToken', array(181 Core::Cast($this->System)->FormManager->RegisterClass('APIToken', array( 182 182 'Title' => 'Přístupový token', 183 183 'Table' => 'APIToken', … … 187 187 ), 188 188 )); 189 $this->System->FormManager->RegisterClass('User', array(189 Core::Cast($this->System)->FormManager->RegisterClass('User', array( 190 190 'Title' => 'Uživatelé', 191 191 'Table' => 'User', … … 206 206 ), 207 207 )); 208 $this->System->FormManager->RegisterClass('PermissionUserAssignment', array(208 Core::Cast($this->System)->FormManager->RegisterClass('PermissionUserAssignment', array( 209 209 'Title' => 'Oprávnění uživatelů', 210 210 'Table' => 'PermissionUserAssignment', … … 215 215 ), 216 216 )); 217 $this->System->FormManager->RegisterClass('PermissionGroup', array(217 Core::Cast($this->System)->FormManager->RegisterClass('PermissionGroup', array( 218 218 'Title' => 'Skupiny oprávnění', 219 219 'Table' => 'PermissionGroup', … … 224 224 ), 225 225 )); 226 $this->System->FormManager->RegisterClass('PermissionGroupAssignment', array(226 Core::Cast($this->System)->FormManager->RegisterClass('PermissionGroupAssignment', array( 227 227 'Title' => 'Přiřazení skupin oprávnění', 228 228 'Table' => 'PermissionGroupAssignment', … … 233 233 ), 234 234 )); 235 $this->System->FormManager->RegisterClass('PermissionOperation', array(235 Core::Cast($this->System)->FormManager->RegisterClass('PermissionOperation', array( 236 236 'Title' => 'Operace oprávnění', 237 237 'Table' => 'PermissionOperation', … … 244 244 ), 245 245 )); 246 $this->System->FormManager->RegisterFormType('TUser', array(246 Core::Cast($this->System)->FormManager->RegisterFormType('TUser', array( 247 247 'Type' => 'Reference', 248 248 'Table' => 'User', … … 251 251 'Filter' => '1', 252 252 )); 253 $this->System->FormManager->RegisterFormType('TPermissionGroup', array(253 Core::Cast($this->System)->FormManager->RegisterFormType('TPermissionGroup', array( 254 254 'Type' => 'Reference', 255 255 'Table' => 'PermissionGroup', … … 258 258 'Filter' => '1', 259 259 )); 260 $this->System->FormManager->RegisterFormType('TPermissionGroupAssignment', array(260 Core::Cast($this->System)->FormManager->RegisterFormType('TPermissionGroupAssignment', array( 261 261 'Type' => 'Reference', 262 262 'Table' => 'PermissionGroupAssignment', … … 265 265 'Filter' => '1', 266 266 )); 267 $this->System->FormManager->RegisterFormType('TPermissionOperation', array(267 Core::Cast($this->System)->FormManager->RegisterFormType('TPermissionOperation', array( 268 268 'Type' => 'Reference', 269 269 'Table' => 'PermissionOperation', … … 288 288 function TopBarCallback() 289 289 { 290 if ( $this->System->User->User['Id'] == null)290 if (Core::Cast($this->System)->User->User['Id'] == null) 291 291 { 292 292 $Output = '<a href="'.$this->System->Link('/user/?Action=LoginForm').'">Přihlášení</a> '. … … 294 294 } else 295 295 { 296 $Output = $this->System->User->User['Name'].296 $Output = Core::Cast($this->System)->User->User['Name']. 297 297 ' <a href="'.$this->System->Link('/user/?Action=UserMenu').'">Nabídka</a>'. 298 298 ' <a href="'.$this->System->Link('/user/?Action=Logout').'">Odhlásit</a>';
Note:
See TracChangeset
for help on using the changeset viewer.