Changeset 567 for trunk/Modules/Portal/Portal.php
- Timestamp:
- Sep 8, 2013, 2:28:15 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Portal/Portal.php
r553 r567 131 131 if(array_key_exists('Action', $_GET)) 132 132 { 133 if($_GET['Action'] == 'CustomizeNewsSave') 133 $Action = $_GET['Action']; 134 if($Action == 'CustomizeNewsSave') 134 135 { 135 136 $Output .= $this->System->ModuleManager->Modules['News']->CustomizeSave(); 136 137 } else 137 if($ _GET['Action']== 'LoginForm')138 if($Action == 'LoginForm') 138 139 { 139 140 $Form = new Form($this->System->FormManager); … … 144 145 '<a href="?Action=PasswordRecovery">Obnova zapomenutého hesla</a></div>'; 145 146 } else 146 if($ _GET['Action']== 'Login')147 if($Action == 'Login') 147 148 { 148 149 if(array_key_exists('Username', $_POST) and array_key_exists('Password', $_POST)) 149 150 { 150 $Form = new Form($this->System->FormManager); 151 $Form->SetClass('UserLogin'); 152 $Form->OnSubmit = '?Action=Login'; 153 $Result = $this->System->User->Login($_POST['Username'], $_POST['Password']); 154 $Output .= $this->SystemMessage('Přihlášení', $Result); 155 if($Result <> USER_LOGGED_IN) 156 { 157 $Form->LoadValuesFromForm(); 158 $Form->Values['Password'] = ''; 159 $Output .= $Form->ShowEditForm(); 160 $Output .= '<div class="Centred"><a href="?Action=UserRegister">Registrovat se</a> '. 161 '<a href="?Action=PasswordRecovery">Obnova zapomenutého hesla</a></div>'; 162 } 151 $Form = new Form($this->System->FormManager); 152 $Form->SetClass('UserLogin'); 153 $Form->OnSubmit = '?Action=Login'; 154 $Result = $this->System->User->Login($_POST['Username'], $_POST['Password']); 155 $Output .= $this->SystemMessage('Přihlášení', $Result); 156 if($Result <> USER_LOGGED_IN) 157 { 158 $Form->LoadValuesFromForm(); 159 $Form->Values['Password'] = ''; 160 $Output .= $Form->ShowEditForm(); 161 $Output .= '<div class="Centred"><a href="?Action=UserRegister">Registrovat se</a> '. 162 '<a href="?Action=PasswordRecovery">Obnova zapomenutého hesla</a></div>'; 163 } else { 164 //$Output .= '<div class="Centred">Za 5 sekund budete přesměrováni na <a href="?Action=UserMenu">nabídku uživatele</a></div>'; 165 //Header('refresh:5;url=?Action=UserMenu'); 166 Header('Location: ?Action=UserMenu'); 167 } 163 168 } else $Output .= $this->SystemMessage('Přihlášení', 'Nezadány přihlašovací údaje'); 164 169 } else 165 if($ _GET['Action']== 'Logout')170 if($Action == 'Logout') 166 171 { 167 172 if($this->System->User->User['Id'] != null) … … 170 175 } else $Output .= $this->SystemMessage('Nastavení uživatele', 'Nejste přihlášen'); 171 176 } else 172 if($ _GET['Action']== 'UserOptions')177 if($Action == 'UserOptions') 173 178 { 174 179 if($this->System->User->User['Id'] != null) … … 181 186 } else $Output .= $this->SystemMessage('Nastavení uživatele', 'Nejste přihlášen'); 182 187 } else 183 if($ _GET['Action']== 'UserOptionsSave')188 if($Action == 'UserOptionsSave') 184 189 { 185 190 $Form = new Form($this->System->FormManager); … … 192 197 $Form->OnSubmit = '?Action=UserOptionsSave'; 193 198 $Output .= $Form->ShowEditForm(); 194 } 195 if($ _GET['Action']== 'UserRegister')199 } else 200 if($Action == 'UserRegister') 196 201 { 197 202 $Form = new Form($this->System->FormManager); … … 201 206 $Output .= $Form->ShowEditForm(); 202 207 } else 203 if($ _GET['Action']== 'UserRegisterConfirm')208 if($Action == 'UserRegisterConfirm') 204 209 { 205 210 $Output .= $this->SystemMessage('Potvrzení registrace', 206 211 $this->System->User->RegisterConfirm($_GET['User'], $_GET['H'])); 207 212 } else 208 if($ _GET['Action']== 'PasswordRecovery')213 if($Action == 'PasswordRecovery') 209 214 { 210 215 $Form = new Form($this->System->FormManager); … … 213 218 $Output .= $Form->ShowEditForm(); 214 219 } else 215 if($ _GET['Action']== 'PasswordRecovery2')220 if($Action == 'PasswordRecovery2') 216 221 { 217 222 $Form = new Form($this->System->FormManager); … … 225 230 } 226 231 } else 227 if($ _GET['Action']== 'PasswordRecoveryConfirm')232 if($Action == 'PasswordRecoveryConfirm') 228 233 { 229 234 $Output .= $this->SystemMessage('Obnova hesla', $this->System->User->PasswordRecoveryConfirm($_GET['User'], $_GET['H'], $_GET['P'])); 230 235 } else 231 if($ _GET['Action']== 'UserRegisterSave')236 if($Action == 'UserRegisterSave') 232 237 { 233 238 $Form = new Form($this->System->FormManager); … … 243 248 } 244 249 } else 245 if($ _GET['Action']== 'MemberOptions')250 if($Action == 'MemberOptions') 246 251 { 247 252 $Form = new Form($this->System->FormManager); … … 264 269 } else $Output .= $this->SystemMessage('Chyba', 'Nejste zákazníkem'); 265 270 } else 266 if($ _GET['Action']== 'MemberOptionsSave')271 if($Action == 'MemberOptionsSave') 267 272 { 268 273 $Form = new Form($this->System->FormManager); … … 298 303 $Form->OnSubmit = '?Action=MemberOptionsSave'; 299 304 $Output .= $Form->ShowEditForm(); 300 } 301 } 302 305 } else 306 if($Action == 'UserMenu') 307 { 308 $Output = $this->ShowUserPanel(); 309 } else $Output = $this->ShowMain(); 310 } else $Output = $this->ShowMain(); 311 return($Output); 312 } 313 314 function ShowMain() 315 { 316 $Output = ''; 303 317 $DbResult = $this->Database->query('SELECT * FROM `ActionGroup`'); 304 318 while($DbRow = $DbResult->fetch_assoc()) … … 322 336 else if($Panel['Module'] == 'UserOptions') 323 337 { 324 if($this->System->User->User['Id'] != null) $Output .= $this->Panel('Přihlášený uživatel', $this->UserPanel());338 //if($this->System->User->User['Id'] != null) $Output .= $this->Panel('Přihlášený uživatel', $this->UserPanel()); 325 339 } else 326 340 if($Panel['Module'] == 'Webcam') $Output .= $this->Panel('Kamery', $this->WebcamPanel()); … … 331 345 } 332 346 $Output .= '</tr></table>'; 347 return($Output); 348 } 349 350 function ShowUserPanel() 351 { 352 $Output = ''; 353 if($this->System->User->User['Id'] != null) 354 $Output .= $this->Panel('Nabídka uživatele', $this->UserPanel()); 355 else $Output .= $this->SystemMessage('Oprávnění', 'Nejste přihlášen'); 333 356 return($Output); 334 357 }
Note:
See TracChangeset
for help on using the changeset viewer.