Changeset 378


Ignore:
Timestamp:
Mar 11, 2010, 11:14:05 AM (15 years ago)
Author:
george
Message:
  • Opraveno: Chyba řazení sloupce jména v seznamu překladatelů.
  • Opraveno: Aktualizace přítomnosti uživatelů.
  • Opraveno: Zobrazení souvislostí překladů.
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/TranslationList.php

    r376 r378  
    6565        <strong>Vypsání souvislostí ze skupiny '.$Line['Name'].'</strong><br /><br />');
    6666
    67    WriteQuests('SELECT *, (SELECT `sub`.`User` FROM `'.$Table.'` AS `sub` WHERE (`sub`.`Entry` = `'.$Table.'`.`Entry`) AND (`Language` <> 0) LIMIT 1) AS `UserID`, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `UserID`) AS `UserName` FROM `'.$Table.'` WHERE (`Language` = 0) AND (`Entry` IN(SELECT `Entry` FROM `connexion_item` WHERE `connexion` = '.$_SESSION['connexion_id'].') AND `VersionEnd` = "'.$BuildNumber_max.'" AND `VersionEnd` = "'.$BuildNumber_max.'"');
     67   WriteQuests('SELECT *, (SELECT `Sub`.`User` FROM `'.$Table.'` AS `Sub` WHERE (`Sub`.`Entry` = `'.$Table.'`.`Entry`) AND (`Language` <> 0) LIMIT 1) AS `UserID`, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `UserID`) AS `UserName` FROM `'.$Table.'` WHERE (`Language` = 0) AND (`Entry` IN(SELECT `Entry` FROM `connexion_item` WHERE `connexion` = '.$_SESSION['connexion_id'].')) AND (`VersionEnd` = "'.$BuildNumber_max.'") AND (`VersionEnd` = "'.$BuildNumber_max.'")');
    6868}
    6969
  • trunk/includes/user.php

    r377 r378  
    3737      $this->Load();
    3838      WriteLog('Login: '.$Name, LOG_TYPE_USER);
    39 
    40       // Záznam o aktivitě
    41       if(array_key_exists('REMOTE_ADDR', $_SERVER))
    42         $Database->SQLCommand('UPDATE `User` SET `LastIP` = "'.$_SERVER['REMOTE_ADDR'].'", `LastLogin` = NOW() WHERE `ID` = '.$this->Id);
     39      $this->UpdateState();
    4340    } else $ŧhis->Role = LICENCE_ANONYMOUS;
    4441  }
     
    5956    $DbResult = $Database->SQLCommand('SELECT * FROM `User` WHERE `ID` = '.$this->Id);
    6057    $User = mysql_fetch_assoc($DbResult);
     58    // Security: Password and Salt hash should not be loaded to variables
    6159    $this->Id = $User['ID'];
    6260    $this->Team = $User['Team'];
     
    7371    {
    7472      $this->Id = $_SESSION['UserId'];
    75       if($this->Id != 0) $this->Load();
    76         else $this->SetAnonymous();
     73      if($this->Id != 0)
     74      {
     75        $this->Load();
     76        $this->UpdateState();
     77      } else $this->SetAnonymous();
    7778    } else $this->SetAnonymous();
    7879  }
     
    111112    return('sha1(CONCAT(sha1('.$Password.'), '.$Salt.'))');
    112113  }
     114 
     115  function UpdateState()
     116  {
     117    global $Database;
     118   
     119    if(array_key_exists('REMOTE_ADDR', $_SERVER))
     120      $Database->SQLCommand('UPDATE `User` SET `LastIP` = "'.$_SERVER['REMOTE_ADDR'].'", `LastLogin` = NOW() WHERE `ID` = '.$this->Id);
     121  }
    113122}
    114123
  • trunk/userlist.php

    r376 r378  
    3434
    3535$TableColumns = array(
    36   array('Name' => 'User', 'Title' => 'Jméno'),
     36  array('Name' => 'Name', 'Title' => 'Jméno'),
    3737  array('Name' => 'TranslatedCount', 'Title' => 'Přeložených'),
    3838  array('Name' => 'XP', 'Title' => 'Úroveň'),
Note: See TracChangeset for help on using the changeset viewer.