Ignore:
Timestamp:
Mar 11, 2010, 11:14:05 AM (14 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ů.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.