Changeset 365 for trunk/registrace.php
- Timestamp:
- Mar 9, 2010, 11:29:05 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/registrace.php
r357 r365 7 7 if(array_key_exists('user', $_POST)) 8 8 { 9 $User = $_POST['user'];9 $UserName = $_POST['user']; 10 10 $Pass = $_POST['pass']; 11 11 $Pass2 = $_POST['pass2']; … … 19 19 if($Pass == $Pass2) 20 20 { 21 $Line = mysql_fetch_row($Database->SQLCommand('SELECT * FROM user WHERE user= "'.$User.'"'));21 $Line = mysql_fetch_row($Database->SQLCommand('SELECT * FROM `User` WHERE `User` = "'.$User.'"')); 22 22 if(!$Line) 23 23 { 24 24 $Address = $_SERVER['REMOTE_ADDR']; 25 25 $Salt = GetPasswordSalt(); 26 $Database->SQLCommand('INSERT INTO `user` (`user` , `pass` , `Salt`, `LastIP` , `LastLogin` , `Email` , `Language` , `team` , `NeedUpdate`, `RegistrationTime` ) 27 VALUES ("'.$User.'", sha1(CONCAT(sha1("'.$Pass.'"), "'.$Salt.'")), "'.$Salt.'", "'.$Address.'", NOW(), "'.$Email.'", '.$Language.', '.$Team.', 1, NOW())'); 28 // $Database->SQLCommand("INSERT INTO user () VALUES('$User','$Pass','0','$Addres',now(),'0','$Email')"); 26 $Database->SQLCommand('INSERT INTO `User` (`Name` , `Pass` , `Salt`, `LastIP` , `LastLogin` , `Email` , `Language` , `Team` , `NeedUpdate`, `RegistrationTime` ) 27 VALUES ("'.$UserName.'", sha1(CONCAT(sha1("'.$Pass.'"), "'.$Salt.'")), "'.$Salt.'", "'.$Address.'", NOW(), "'.$Email.'", '.$Language.', '.$Team.', 1, NOW())'); 29 28 echo('Registrace proběhla úspěšně.<br />'); 30 29 31 $_SESSION['User'] = $User ;30 $_SESSION['User'] = $UserName; 32 31 $_SESSION['Pass'] = $Pass; 33 32 34 $Line = mysql_fetch_array($Database->SQLCommand('SELECT ID FROM user WHERE user= "'.$_SESSION['User'].'"'));33 $Line = mysql_fetch_array($Database->SQLCommand('SELECT `ID` FROM `User` WHERE `Name` = "'.$_SESSION['User'].'"')); 35 34 $_SESSION['UserID'] = $Line['ID']; 36 35 WriteLog('Uživatel se zaregistroval: '.$User, LOG_TYPE_USER);
Note:
See TracChangeset
for help on using the changeset viewer.