- bug fixed : when a user is the guest user, login saved in history table is

"guest" and not the localized version of guest username


git-svn-id: http://piwigo.org/svn/trunk@725 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
plegall
2005-02-01 07:29:37 +00:00
parent 8479367eb2
commit f30455c6ff
+13 -7
View File
@@ -333,14 +333,20 @@ function pwg_log( $file, $category, $picture = '' )
{
global $conf, $user;
if ( $conf['log'] )
if ($conf['log'])
{
$query = 'insert into '.HISTORY_TABLE;
$query.= ' (date,login,IP,file,category,picture) values';
$query.= " (NOW(), '".$user['username']."'";
$query.= ",'".$_SERVER['REMOTE_ADDR']."'";
$query.= ",'".$file."','".$category."','".$picture."');";
pwg_query( $query );
$query = '
INSERT INTO '.HISTORY_TABLE.'
(date,login,IP,file,category,picture)
VALUES
(NOW(),
\''.(($user['id'] == 2) ? 'guest' : $user['username']).'\',
\''.$_SERVER['REMOTE_ADDR'].'\',
\''.$file.'\',
\''.$category.'\',
\''.$picture.'\')
;';
pwg_query($query);
}
}