Changeset 549 for trunk/Modules/FrontPage/FrontPage.php
- Timestamp:
- Jun 18, 2013, 8:30:40 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/FrontPage/FrontPage.php
r548 r549 23 23 'Permission' => LICENCE_ANONYMOUS, 24 24 'Icon' => '', 25 ) );25 ), 0); 26 26 } 27 28 function HandleLoginForm() 29 { 30 global $User, $Message, $MessageType; 31 32 if(array_key_exists('action', $_GET)) 33 { 34 if($_GET['action'] == 'login') 35 { 36 if(array_key_exists('LoginUser', $_POST) and array_key_exists('LoginPass', $_POST)) 37 { 38 $User->Login($_POST['LoginUser'], $_POST['LoginPass']); 39 if($User->Role == LICENCE_ANONYMOUS) 40 { 41 $Message = 'Jméno nebo heslo bylo zadáno špatně.'; 42 $MessageType = MESSAGE_CRITICAL; 43 } else 44 { 45 $Message = 'Přihlášení proběhlo úspěšně. Vítej <strong>'.$User->Name.'</strong>!'; 46 $MessageType = MESSAGE_INFORMATION; 47 } 48 } else 49 { 50 $Message = 'Nebylo zadáno jméno a heslo.'; 51 $MessageType = MESSAGE_CRITICAL; 52 } 53 } else 54 if($_GET['action'] == 'logout') 55 { 56 if($User->Role != LICENCE_ANONYMOUS) 57 { 58 WriteLog('Odhlášení', LOG_TYPE_USER); 59 $User->Logout(); 60 $Message = 'Byl jsi odhlášen.'; 61 $MessageType = MESSAGE_INFORMATION; 62 } 63 } 64 } 65 } 66 27 67 } 28 68 … … 31 71 function Show() 32 72 { 33 $Output = '<br />'. 73 global $Message, $MessageType; 74 75 $this->System->ModuleManager->Modules['FrontPage']->HandleLoginForm(); 76 $Output = ''; 77 if(isset($Message)) $Output .= ShowMessage($Message, $MessageType); 78 79 $Output .= '<br />'. 34 80 '<table class="Home"><tr><td colspan="3">'.$this->ShowWelcome(). 35 81 '</td></tr>'. … … 39 85 '</tr></table>'; 40 86 return($Output); 41 } 87 } 42 88 43 89 function ShowShoutbox()
Note:
See TracChangeset
for help on using the changeset viewer.