Changeset 7 for trunk/Modules/User/UserPage.php
- Timestamp:
- Apr 14, 2020, 11:13:32 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/User/UserPage.php
r1 r7 9 9 function Panel($Title, $Content, $Menu = array()) 10 10 { 11 if (count($Menu) > 0)12 foreach ($Menu as $Item)11 if (count($Menu) > 0) 12 foreach ($Menu as $Item) 13 13 $Title .= '<div class="Action">'.$Item.'</div>'; 14 return ('<div class="Panel"><div class="Title">'.$Title.'</div><div class="Content">'.$Content.'</div></div>');14 return '<div class="Panel"><div class="Title">'.$Title.'</div><div class="Content">'.$Content.'</div></div>'; 15 15 } 16 16 … … 39 39 40 40 $DbResult = $this->Database->query($Query); 41 while ($Contact = $DbResult->fetch_assoc())41 while ($Contact = $DbResult->fetch_assoc()) 42 42 { 43 43 $Output .= '<tr>'. … … 50 50 $Output .= $PageList['Output']; 51 51 52 return ($Output);52 return $Output; 53 53 } 54 54 … … 56 56 { 57 57 $Output = ''; 58 if ($this->System->User->User['Id'] != null)58 if ($this->System->User->User['Id'] != null) 59 59 { 60 60 $Actions = ''; 61 foreach ($this->System->ModuleManager->Modules['User']->UserPanel as $Action)62 { 63 if (is_string($Action[0]))61 foreach ($this->System->ModuleManager->Modules['User']->UserPanel as $Action) 62 { 63 if (is_string($Action[0])) 64 64 { 65 65 $Class = new $Action[0]($this->System); … … 71 71 $Output .= $this->Panel('Nabídka uživatele', $Actions); 72 72 $Output .= '</td><td style="vertical-align:top;">'; 73 if ($this->System->User->User['Id'] != null)73 if ($this->System->User->User['Id'] != null) 74 74 { 75 75 $Form = new Form($this->System->FormManager); … … 85 85 $Output .= '</td></tr></table></div>'; 86 86 } else $Output .= $this->SystemMessage('Oprávnění', 'Nejste přihlášen'); 87 return ($Output);87 return $Output; 88 88 } 89 89 … … 91 91 { 92 92 $Output = ''; 93 if (array_key_exists('Action', $_GET))93 if (array_key_exists('Action', $_GET)) 94 94 { 95 95 $Action = $_GET['Action']; 96 if ($Action == 'LoginForm')96 if ($Action == 'LoginForm') 97 97 { 98 98 $Form = new Form($this->System->FormManager); … … 103 103 '<a href="?Action=PasswordRecovery">Obnova zapomenutého hesla</a></div>'; 104 104 } else 105 if ($Action == 'Login')106 { 107 if (array_key_exists('Username', $_POST) and array_key_exists('Password', $_POST))105 if ($Action == 'Login') 106 { 107 if (array_key_exists('Username', $_POST) and array_key_exists('Password', $_POST)) 108 108 { 109 109 $Form = new Form($this->System->FormManager); 110 110 $Form->SetClass('UserLogin'); 111 111 $Form->OnSubmit = '?Action=Login'; 112 if (array_key_exists('StayLogged', $_POST) and ($_POST['StayLogged'] == 'on')) $StayLogged = true;112 if (array_key_exists('StayLogged', $_POST) and ($_POST['StayLogged'] == 'on')) $StayLogged = true; 113 113 else $StayLogged = false; 114 114 $Result = $this->System->User->Login($_POST['Username'], $_POST['Password'], $StayLogged); 115 115 $Output .= $this->SystemMessage('Přihlášení', $Result); 116 if ($Result <> USER_LOGGED_IN)116 if ($Result <> USER_LOGGED_IN) 117 117 { 118 118 $Form->LoadValuesFromForm(); … … 128 128 } else $Output .= $this->SystemMessage('Přihlášení', 'Nezadány přihlašovací údaje'); 129 129 } else 130 if ($Action == 'Logout')131 { 132 if ($this->System->User->User['Id'] != null)130 if ($Action == 'Logout') 131 { 132 if ($this->System->User->User['Id'] != null) 133 133 { 134 134 $Output .= $this->SystemMessage('Odhlášení', $this->System->User->Logout()); 135 135 } else $Output .= $this->SystemMessage('Nastavení uživatele', 'Nejste přihlášen'); 136 136 } else 137 if ($Action == 'UserOptions')138 { 139 if ($this->System->User->User['Id'] != null)137 if ($Action == 'UserOptions') 138 { 139 if ($this->System->User->User['Id'] != null) 140 140 { 141 141 $Form = new Form($this->System->FormManager); … … 146 146 } else $Output .= $this->SystemMessage('Nastavení uživatele', 'Nejste přihlášen'); 147 147 } else 148 if ($Action == 'UserOptionsSave')148 if ($Action == 'UserOptionsSave') 149 149 { 150 150 $Form = new Form($this->System->FormManager); … … 158 158 $Output .= $Form->ShowEditForm(); 159 159 } else 160 if ($Action == 'UserRegister')160 if ($Action == 'UserRegister') 161 161 { 162 162 $Form = new Form($this->System->FormManager); … … 166 166 $Output .= $Form->ShowEditForm(); 167 167 } else 168 if ($Action == 'UserRegisterConfirm')168 if ($Action == 'UserRegisterConfirm') 169 169 { 170 170 $Output .= $this->SystemMessage('Potvrzení registrace', 171 171 $this->System->User->RegisterConfirm($_GET['User'], $_GET['H'])); 172 172 } else 173 if ($Action == 'PasswordRecovery')173 if ($Action == 'PasswordRecovery') 174 174 { 175 175 $Form = new Form($this->System->FormManager); … … 178 178 $Output .= $Form->ShowEditForm(); 179 179 } else 180 if ($Action == 'PasswordRecovery2')180 if ($Action == 'PasswordRecovery2') 181 181 { 182 182 $Form = new Form($this->System->FormManager); … … 185 185 $Result = $this->System->User->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']); 186 186 $Output .= $this->SystemMessage('Obnova hesla', $Result); 187 if ($Result <> USER_PASSWORD_RECOVERY_SUCCESS)187 if ($Result <> USER_PASSWORD_RECOVERY_SUCCESS) 188 188 { 189 189 $Output .= $Form->ShowEditForm(); 190 190 } 191 191 } else 192 if ($Action == 'PasswordRecoveryConfirm')192 if ($Action == 'PasswordRecoveryConfirm') 193 193 { 194 194 $Output .= $this->SystemMessage('Obnova hesla', $this->System->User->PasswordRecoveryConfirm($_GET['User'], $_GET['H'], $_GET['P'])); 195 195 } else 196 if ($Action == 'UserRegisterSave')196 if ($Action == 'UserRegisterSave') 197 197 { 198 198 $Form = new Form($this->System->FormManager); … … 202 202 $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name']); 203 203 $Output .= $this->SystemMessage('Registrace nového účtu', $Result); 204 if ($Result <> USER_REGISTRATED)204 if ($Result <> USER_REGISTRATED) 205 205 { 206 206 $Form->OnSubmit = '?Action=UserRegisterSave'; … … 208 208 } 209 209 } else 210 if ($Action == 'UserMenu')210 if ($Action == 'UserMenu') 211 211 { 212 212 $Output = $this->ShowUserPanel(); 213 213 } else $Output = $this->ShowMain(); 214 214 } else $Output = $this->ShowMain(); 215 return ($Output);215 return $Output; 216 216 } 217 217 … … 219 219 { 220 220 $Output = 'Nebyla vybrána akce'; 221 return ($Output);221 return $Output; 222 222 } 223 223 }
Note:
See TracChangeset
for help on using the changeset viewer.