Changeset 365 for trunk/registrace.php


Ignore:
Timestamp:
Mar 9, 2010, 11:29:05 AM (15 years ago)
Author:
george
Message:
  • Upraveno: Jména tabulek v databází upraveny na stejná s prvními velkými písmeny.
  • Upraveno: Doplněny SQL uvozovky do mnoha SQL dotazů.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/registrace.php

    r357 r365  
    77if(array_key_exists('user', $_POST))
    88{
    9   $User = $_POST['user'];
     9  $UserName = $_POST['user'];
    1010  $Pass = $_POST['pass'];
    1111  $Pass2 = $_POST['pass2'];
     
    1919  if($Pass == $Pass2)
    2020  {
    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.'"'));
    2222    if(!$Line)
    2323    {
    2424      $Address = $_SERVER['REMOTE_ADDR'];
    2525      $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())');
    2928      echo('Registrace proběhla úspěšně.<br />');
    3029     
    31       $_SESSION['User'] = $User;
     30      $_SESSION['User'] = $UserName;
    3231      $_SESSION['Pass'] = $Pass;
    3332   
    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'].'"'));
    3534      $_SESSION['UserID'] = $Line['ID'];
    3635      WriteLog('Uživatel se zaregistroval: '.$User, LOG_TYPE_USER);
Note: See TracChangeset for help on using the changeset viewer.