Changeset 357 for trunk/includes/global.php
- Timestamp:
- Mar 5, 2010, 7:42:00 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/global.php
r331 r357 41 41 global $Database, $Config; 42 42 43 echo('<strong><a href="'.$Config['Web']['BaseURL'].'action.php?action=ShoutBoxView"> Shoutbox:</a></strong>');43 echo('<strong><a href="'.$Config['Web']['BaseURL'].'action.php?action=ShoutBoxView">Kecátko:</a></strong>'); 44 44 if(Licence(LICENCE_USER)) echo(' <a href="'.$Config['Web']['BaseURL'].'action.php?action=shoutbox">Vložit</a>'); 45 45 echo('<div class="box"><table>'); … … 189 189 190 190 echo('Online překladatelé:<br />'); 191 $ID = $Database->SQLCommand('SELECT user, GM, ID FROM `user` WHERE LastLogin >= Now() - 300 AND ((LastLogout < LastLogin) OR (ISNULL(LastLogout)))');191 $ID = $Database->SQLCommand('SELECT `user`, `GM`, `ID` FROM `user` WHERE `LastLogin` >= NOW() - 300 AND ((`LastLogout` < `LastLogin`) OR (ISNULL(`LastLogout`)))'); 192 192 while ($Line = mysql_fetch_assoc($ID)) 193 193 { … … 215 215 $_SESSION['Pass'] = $_POST['LoginPass']; 216 216 217 $DbResult = $Database->SQLCommand('SELECT * FROM user WHERE LOWER(user) = LOWER("'.$_SESSION['User'].'") AND pass = sha1(CONCAT(sha1("'.$_SESSION['Pass'].'"), Salt))');217 $DbResult = $Database->SQLCommand('SELECT * FROM `user` WHERE LOWER(`user`) = LOWER("'.$_SESSION['User'].'") AND `pass` = sha1(CONCAT(sha1("'.$_SESSION['Pass'].'"), `Salt`))'); 218 218 if(mysql_num_rows($DbResult) == 0) 219 219 { … … 227 227 $_SESSION['UserID'] = $User['ID']; 228 228 $_SESSION['User'] = $User['user']; 229 WriteLog('Login: '.$_SESSION['User'], 3);229 WriteLog('Login: '.$_SESSION['User'], LOG_TYPE_USER); 230 230 } 231 231 } … … 234 234 if(array_key_exists('Logout', $_GET) and ($_SESSION['User'] != '')) 235 235 { 236 WriteLog('Odhlášení', 3);236 WriteLog('Odhlášení', LOG_TYPE_USER); 237 237 if(is_numeric($_SESSION['UserID'])) 238 $Database->SQLCommand('UPDATE user SET LastLogout = NOW() WHERE ID= '.$_SESSION['UserID']);238 $Database->SQLCommand('UPDATE `user` SET `LastLogout` = NOW() WHERE `ID` = '.$_SESSION['UserID']); 239 239 $_SESSION['User'] = ''; 240 240 $_SESSION['Pass'] = ''; … … 243 243 244 244 // Záznam o aktivitě 245 if(Licence( 0) and array_key_exists('REMOTE_ADDR', $_SERVER))246 $Database->SQLCommand('UPDATE user SET LastIP = "'.$_SERVER['REMOTE_ADDR'].'", LastLogin = NOW() WHERE ID= '.$_SESSION['UserID']);245 if(Licence(LICENCE_USER) and array_key_exists('REMOTE_ADDR', $_SERVER)) 246 $Database->SQLCommand('UPDATE `user` SET `LastIP` = "'.$_SERVER['REMOTE_ADDR'].'", `LastLogin` = NOW() WHERE `ID` = '.$_SESSION['UserID']); 247 247 } 248 248
Note:
See TracChangeset
for help on using the changeset viewer.