Changeset 26 for trunk/www/server.php
- Timestamp:
- Jun 13, 2009, 1:49:53 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/server.php
r24 r26 252 252 } 253 253 } 254 255 function NewAccount($Name, $Password, $Password2, $Email, $Expansion) 256 { 257 $Output = ''; 258 if(($Password == '') or ($Password2 == '') or ($Name == '') or ($Email == '')) $Output = 'Vyplňte správně všechny údaje.'; 259 else if($Password != $Password2) $Output = 'Hesla si neodpovídají.'; 260 else 261 { 262 $Name = strtoupper($Name); 263 $DbResult = $this->Database->query('SELECT Id FROM server'.$this->Id.'_realmd.account WHERE username="'.$Name.'"'); 264 if($DbResult->num_rows > 0) $Output = 'Účet se zadaným jménem již existuje.'; 265 else 266 { 267 $Password = sha1($Name.':'.strtoupper($Password)); 268 $this->Database->query('INSERT INTO `server'.$this->Id.'_realmd`.`account` (`username`, `sha_pass_hash`, `email`, `joindate`, `expansion`) VALUES ("'.$Name.'", "'.$Password.'", "'.$Email.'", NOW(), '.$Expansion.')'); 269 $Output = 'Nový účet vytvořen.'; 270 } 271 } 272 return($Output); 273 } 254 274 } 255 275
Note:
See TracChangeset
for help on using the changeset viewer.