diff options
author | plegall <plg@piwigo.org> | 2005-02-01 07:29:37 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2005-02-01 07:29:37 +0000 |
commit | f30455c6ff6543519c88242154e915de59928eb6 (patch) | |
tree | 27676e8d3a864ffc5cbd9baaf4aaccecc28aee93 | |
parent | 8479367eb2ffd0ae270fcae2ac4d1ca2921b379e (diff) |
- 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
-rw-r--r-- | include/functions.inc.php | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/include/functions.inc.php b/include/functions.inc.php index 457fa0a82..77be51606 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -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); } } |