Changeset 202 for trunk/index.php
- Timestamp:
- Apr 30, 2009, 11:30:37 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/index.php
r197 r202 68 68 'fun' => array('Zábava', 69 69 array('Youtube', 'http://www.youtube.com/', ''), 70 array('Stream.cz', 'http://www.stream.cz/', ''), 70 71 array('Last.fm', 'http://www.last.fm/', ''), 71 72 ), … … 100 101 function InfoBar() 101 102 { 102 $this->Database->select_db('is'); 103 global $Config; 104 105 $Database->select_db($Config['Database']['Database']); 103 106 104 107 $Output2 = ''; … … 197 200 function GetServerUptime() 198 201 { 199 $Data = explode(' ', exec('uptime'));202 $Data = explode(' ', exec('uptime')); 200 203 $Data = array_slice($Data, 3, -8); 201 204 $Uptime = ''; … … 227 230 if($_GET['Action'] == 'LoginForm') 228 231 { 229 $Output .= '<form action="?Action=Login" method="post"><center><fieldset style="width: 500px;"><legend>Přihlašovací údaje</legend>'. 230 '<table class="hidden">'. 231 '<tr align="left"><td colspan="2">Jméno:</td></tr>'. 232 '<tr align="left"><td colspan="2"><input type="text" name="Username" size="40" maxlength="16" /></td></tr>'. 233 '<tr align="left"><td colspan="2">Heslo:</td></tr>'. 234 '<tr align="left"><td colspan="2"><input type="password" name="Password" size="40" maxlength="16" /></td></tr>'. 235 '<tr><td colspan="2"> </td></tr>'. 236 '<tr align="left">'. 237 //<td><input type="checkbox" name="remember" value="1" checked="checked" /> Trvalé přihlášení</td> 238 '<td align="center" colspan="2"><input type="submit" value="Přihlásit" /></td>'. 239 '</tr>'. 240 '<tr align="left">'. 241 '<td><a href="?Action=UserRegister">Registrovat se</a></td>'. 242 '<td><a href="?Action=PasswordRecovery">Obnova zapomenutého hesla</a></td>'. 243 '</tr>'. 244 '</table>'. 245 '</fieldset></center>'. 246 '</form>'; 247 // $Output .= $this->SystemMessage('Test', $Output); 232 $Form = new Form('UserLogin'); 233 $Form->OnSubmit = '?Action=Login'; 234 $Output .= $Form->ShowEditForm(); 235 $Output .= '<div class="Centred"><a href="?Action=UserRegister">Registrovat se</a> '. 236 '<a href="?Action=PasswordRecovery">Obnova zapomenutého hesla</a></div>'; 248 237 } else 249 238 if($_GET['Action'] == 'Login') 250 239 { 251 $Output .= $this->SystemMessage('Přihlášení', $this->System->Modules['User']->Login($_POST['Username'], $_POST['Password'])); 240 $Form = new Form('UserLogin'); 241 $Form->OnSubmit = '?Action=Login'; 242 $Result = $this->System->Modules['User']->Login($_POST['Username'], $_POST['Password']); 243 $Output .= $this->SystemMessage('Přihlášení', $Result); 244 if($Result <> USER_LOGGED_IN) 245 { 246 $Form->LoadValuesFromForm(); 247 $Form->Values['Password'] = ''; 248 $Output .= $Form->ShowEditForm(); 249 $Output .= '<div class="Centred"><a href="?Action=UserRegister">Registrovat se</a> '. 250 '<a href="?Action=PasswordRecovery">Obnova zapomenutého hesla</a></div>'; 251 } 252 252 } else 253 253 if($_GET['Action'] == 'Logout') … … 275 275 if($_GET['Action'] == 'UserRegister') 276 276 { 277 $UserRegister = new Form('UserRegister'); 278 $UserRegister->OnSubmit = '?Action=UserRegisterSave'; 279 $Output .= $UserRegister->ShowEditForm(); 277 $Form = new Form('UserRegister'); 278 $Form->LoadValuesFromForm(); 279 $Form->OnSubmit = '?Action=UserRegisterSave'; 280 $Output .= $Form->ShowEditForm(); 280 281 } else 281 282 if($_GET['Action'] == 'UserRegisterConfirm') 282 283 { 283 $Output .= $this->SystemMessage('Potvrzení registrace', $this->System->Modules['User']->RegisterConfirm($_GET['User'], $_GET['H']));284 $Output .= $this->SystemMessage('Registrace nového účtu', $this->System->Modules['User']->RegisterConfirm($_GET['User'], $_GET['H'])); 284 285 } else 285 286 if($_GET['Action'] == 'PasswordRecovery') … … 293 294 $Form = new Form('PasswordRecovery'); 294 295 $Form->LoadValuesFromForm(); 295 296 $Output .= $this->SystemMessage('Obnova hesla', $this->System->Modules['User']->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email'])); 296 $Result = $this->System->Modules['User']->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']); 297 $Output .= $this->SystemMessage('Obnova hesla', $Result); 298 if($Result <> USER_PASSWORD_RECOVERY_SUCCESS) 299 { 300 $Output .= $Form->ShowEditForm(); 301 } 297 302 } else 298 303 if($_GET['Action'] == 'PasswordRecoveryConfirm') … … 302 307 if($_GET['Action'] == 'UserRegisterSave') 303 308 { 304 $UserRegister = new Form('UserRegister', array()); 305 $UserRegister->LoadValuesFromForm(); 306 $Output .= $this->SystemMessage('Nastavení', $this->System->Modules['User']->Register($UserRegister->Values['Login'], $UserRegister->Values['Password'], $UserRegister->Values['Password2'], $UserRegister->Values['Email'], $UserRegister->Values['Name'], $UserRegister->Values['PhoneNumber'], $UserRegister->Values['ICQ'])); 309 $Form = new Form('UserRegister', array()); 310 $Form->LoadValuesFromForm(); 311 $Result = $this->System->Modules['User']->Register($Form->Values['Login'], $Form->Values['Password'], $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name'], $Form->Values['PhoneNumber'], $Form->Values['ICQ']); 312 $Output .= $this->SystemMessage('Nastavení', $Result); 313 if($Result <> USER_REGISTRATED) 314 { 315 $Form->OnSubmit = '?Action=UserRegisterSave'; 316 $Output .= $Form->ShowEditForm(); 317 } 307 318 } else 308 319 if($_GET['Action'] == 'MemberOptions') … … 344 355 } 345 356 346 $Database->select_db( 'is');357 $Database->select_db($Config['Database']['Database']); 347 358 348 359 //$Output .= $this->InfoBar();
Note:
See TracChangeset
for help on using the changeset viewer.