Changeset 29
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/form.php
r24 r29 14 14 15 15 $this->Definition = &$FormClasses[$ClassName]; 16 foreach($this->Definition['Items'] as $Index => $Item) 17 { 18 $this->Values[$Index] = ''; 19 } 16 20 } 17 21 -
trunk/www/index.php
r28 r29 207 207 } 208 208 return($Output); 209 } 210 211 function ShowLoginForm() 212 { 213 $Form = new Form('UserLogin'); 214 $Form->OnSubmit = '?Action=Login'; 215 $Output = $Form->ShowEditForm(); 216 $Output .= '<div class="Centred"><a href="?Action=UserRegister">Registrovat se</a> '. 217 '<a href="?Action=PasswordRecovery">Obnova zapomenutého hesla</a></div>'; 218 return($Output); 219 } 220 221 function ImportDatabase() 222 { 223 if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER) 224 { 225 $Server = new Server($this->Database, $_GET['Id']); 226 if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)) 227 { 228 $Server->ImportDatabase(true); 229 $Output .= $this->SystemMessage('Import čisté databáze', 'Úloha zařazena do fronty'); 230 $Output .= $this->ShowTaskList(); 231 } else $this->SystemMessage('Import databáze', 'Nemáte oprávnění'); 232 } else $Output .= USER_BAD_ROLE; 209 233 } 210 234 … … 266 290 if($_GET['Action'] == 'LoginForm') 267 291 { 268 $Form = new Form('UserLogin'); 269 $Form->OnSubmit = '?Action=Login'; 270 $Output .= $Form->ShowEditForm(); 271 $Output .= '<div class="Centred"><a href="?Action=UserRegister">Registrovat se</a> '. 272 '<a href="?Action=PasswordRecovery">Obnova zapomenutého hesla</a></div>'; 292 $Output .= $this->ShowLoginForm(); 273 293 } else 274 294 if($_GET['Action'] == 'Login') … … 278 298 $Form->LoadValuesFromForm(); 279 299 $Result = $this->System->Modules['User']->Login($Form->Values['Username'], $Form->Values['Password']); 280 $Output .= $this->SystemMessage('Přihlášení', $Result);300 $Output = $this->SystemMessage('Přihlášení', $Result); 281 301 if($Result <> USER_LOGGED_IN) 282 302 { … … 284 304 $Output .= $Form->ShowEditForm(); 285 305 $Output .= '<div class="Centred"><a href="?Action=UserRegister">Registrovat se</a> '. 286 306 '<a href="?Action=PasswordRecovery">Obnova zapomenutého hesla</a></div>'; 287 307 } 288 308 } else … … 290 310 { 291 311 $Output .= $this->SystemMessage('Odhlášení', $this->System->Modules['User']->Logout()); 312 $Output .= $this->ShowLoginForm(); 292 313 } else 293 314 if($_GET['Action'] == 'UserOptions') … … 314 335 $Form->LoadValuesFromForm(); 315 336 $Form->OnSubmit = '?Action=UserRegisterSave'; 337 $Output = 'Vyplňte správně požadované údaje. Na zadaný email vám bude zaslán aktivační email.'; 316 338 $Output .= $Form->ShowEditForm(); 317 339 } else … … 319 341 { 320 342 $Output .= $this->SystemMessage('Potvrzení registrace', $this->System->Modules['User']->RegisterConfirm($_GET['User'], $_GET['H'])); 343 $Output .= $this->ShowLoginForm(); 321 344 } else 322 345 if($_GET['Action'] == 'PasswordRecovery') … … 340 363 { 341 364 $Output .= $this->SystemMessage('Obnova hesla', $this->System->Modules['User']->PasswordRecoveryConfirm($_GET['User'], $_GET['H'], $_GET['P'])); 365 $Output .= $this->ShowLoginForm(); 342 366 } else 343 367 if($_GET['Action'] == 'UserRegisterSave') … … 398 422 $Server = new Server($this->Database, $LastInsertId); 399 423 $Server->CreateDatabase(); 400 $Output .= $this->SystemMessage('Nový server', 'Server vytvořen.'); 424 $Server->ImportDatabase(true); 425 $Output .= $this->SystemMessage('Vytvoření serveru', 'Úloha načtení nové databáze zařazena do fronty'); 426 $Output .= $this->ShowTaskList(); 401 427 //$UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->User['Id']); 402 428 //$Form->OnSubmit = '?Action=ServerCreate'; … … 467 493 if($_GET['Action'] == 'ServerDatabaseImport') 468 494 { 469 if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER) 470 { 471 $Server = new Server($this->Database, $_GET['Id']); 472 if(($this->System->Modules['User']->User['Id'] == $Server->Server['User']) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)) 473 { 474 $Server->ImportDatabase(true); 475 $Output .= $this->SystemMessage('Import čisté databáze', 'Úloha zařazena do fronty'); 476 $Output .= $this->ShowTaskList(); 477 } else $this->SystemMessage('Zastavení serveru', 'Nemáte oprávnění'); 478 } else $Output .= USER_BAD_ROLE; 495 $this->ImportDatabase(); 479 496 } else 480 497 if($_GET['Action'] == 'EmulatorShow') -
trunk/www/server.php
r26 r29 214 214 $Config->ParameterList['WorldServerPort'] = $this->Server['NetworkPortWorldd']; 215 215 $Config->ParameterList['Motd'] = $this->Server['Motd']; 216 $Config->ParameterList['DataDir'] = 'wowclient/'.$this->Server['Database']['Emulator']['Client V']['Version'];216 $Config->ParameterList['DataDir'] = 'wowclient/'.$this->Server['Database']['Emulator']['Client']['Version']; 217 217 $Config->ParameterList['LogsDir'] = 'server/'.$this->Id.'/log'; 218 218 $Config->ParameterList['LogLevel'] = 1; … … 265 265 else 266 266 { 267 echo($Name.':'.strtoupper($Password)); 267 268 $Password = sha1($Name.':'.strtoupper($Password)); 268 269 $this->Database->query('INSERT INTO `server'.$this->Id.'_realmd`.`account` (`username`, `sha_pass_hash`, `email`, `joindate`, `expansion`) VALUES ("'.$Name.'", "'.$Password.'", "'.$Email.'", NOW(), '.$Expansion.')'); -
trunk/www/task.php
r28 r29 3 3 class Task extends Module 4 4 { 5 var $TempScript = ' /tmp/wowhosting_script.sh';5 var $TempScript = 'temp/wowhosting_script.sh'; 6 6 7 7 function __construct($Database) -
trunk/www/types/Password.php
r15 r29 23 23 global $Database; 24 24 25 $Result = sha1($_POST[$Item['Name']]);25 $Result = $_POST[$Item['Name']]; 26 26 /* 27 27 if(!array_key_exists('SourceItemId', $Item)) $Result = sha1($_POST[$Item['Name']]); -
trunk/www/user.php
r22 r29 102 102 else 103 103 { 104 $this->Database->insert('User', array('Name' => $Name, 'Login' => $Login, 'Password' => $Password, 'Email' => $Email, 'RegistrationTime' => 'NOW()', 'Locked' => 1, 'Role' => 2));104 $this->Database->insert('User', array('Name' => $Name, 'Login' => $Login, 'Password' => sha1($Password), 'Email' => $Email, 'RegistrationTime' => 'NOW()', 'Locked' => 1, 'Role' => 2)); 105 105 $UserId = $this->Database->insert_id; 106 106 107 107 $Subject = FromUTF8('Registrace nového účtu', 'iso2'); 108 $Message = 'Provedli jste registraci nového účtu na serveru <a href="http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'/">http://'.$Config['Web']['Host'].$Config['Web']['RootFolder']."/</a>.<br>\nPokud jste tak neučinili, měli by jste tento email ignorovat.<br><br>\n\nVáš účet je: ".$Login."\n<br>Pro dokončení registrace klikněte na tento odkaz: ".'<a href="http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'/?Action=UserRegisterConfirm&User='.$UserId.'&H='. $Password.'">http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'/?Action=UserRegisterConfirm&User='.$UserId.'&H='.$Password.'</a>.'."\n<br> \n\n<br><br>Na tento email neodpovídejte.";108 $Message = 'Provedli jste registraci nového účtu na serveru <a href="http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'/">http://'.$Config['Web']['Host'].$Config['Web']['RootFolder']."/</a>.<br>\nPokud jste tak neučinili, měli by jste tento email ignorovat.<br><br>\n\nVáš účet je: ".$Login."\n<br>Pro dokončení registrace klikněte na tento odkaz: ".'<a href="http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'/?Action=UserRegisterConfirm&User='.$UserId.'&H='.sha1($Password).'">http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'/?Action=UserRegisterConfirm&User='.$UserId.'&H='.sha1($Password).'</a>.'."\n<br> \n\n<br><br>Na tento email neodpovídejte."; 109 109 $AdditionalHeaders = "To: ".$Name." <".$Email.">\n"."From: ".FromUTF8($Config['Web']['Title'], 'iso2')." <noreplay@zdechov.net>\n"."MIME-Version: 1.0\n"."Content-type: text/html; charset=utf-8"; 110 110 mail($Email, $Subject, $Message, $AdditionalHeaders); … … 141 141 { 142 142 $Row = $Query->fetch_assoc(); 143 if($Row['Password'] != $Password) $Result = BAD_PASSWORD;143 if($Row['Password'] != sha1($Password)) $Result = BAD_PASSWORD; 144 144 else if($Row['Locked'] == 1) $Result = ACCOUNT_LOCKED; 145 145 else
Note:
See TracChangeset
for help on using the changeset viewer.