Main Page | Directories | File List | File Members

logger.php

Go to the documentation of this file.
00001 <?php
00002 # This file is part of the Savane project
00003 # <http://gna.org/projects/savane/>
00004 #
00005 # $Id: logger.php 4567 2005-06-30 17:19:37Z toddy $
00006 #
00007 #  Copyright 1999-2000 (c) The SourceForge Crew
00008 #  Copyright 2000-2003 (c) Free Software Foundation
00009 #
00010 #  Copyright 2004      (c) ...
00011 # 
00012 # The Savane project is free software; you can redistribute it and/or
00013 # modify it under the terms of the GNU General Public License
00014 # as published by the Free Software Foundation; either version 2
00015 # of the License, or (at your option) any later version.
00016 #
00017 # The Savane project is distributed in the hope that it will be useful,
00018 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00019 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020 # GNU General Public License for more details.
00021 #
00022 # You should have received a copy of the GNU General Public License
00023 # along with the Savane project; if not, write to the Free Software
00024 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00025 
00026 # No path disclosure when access comes from itself.
00027 if (eregi("logger.php",$PHP_SELF))
00028         { 
00029    exit("Sorry, you can not access directly this file."); 
00030         }
00031  
00032 if ($group_id) {
00033         $log_group=$group_id;
00034 } else if ($form_grp) {
00035         $log_group=$form_grp;
00036 } else {
00037         $log_group=0;
00038 }
00039 
00040 # Input validation of the $log_group value.
00041 
00042 $log_group = trim($log_group);
00043 $log_group = addslashes($log_group);
00044 
00045 $sql =  "INSERT INTO activity_log "
00046         . "(day,hour,group_id,browser,ver,platform,time,page,type) "
00047         . "VALUES (" . date('Ymd', mktime()) . ",'" . date('H', mktime())
00048         . "','$log_group','" . browser_get_agent() . "','" . browser_get_version() 
00049         . "','" . browser_get_platform() . "','" . time() . "','$PHP_SELF','0');";
00050 
00051 $res_logger = db_query ( $sql );
00052 
00053 if (!$res_logger) {
00054         echo "An error occured in the logger.\n";
00055         echo db_error(); # FIXME: Check if important information is given when an error occurs.
00056         exit;
00057 }
00058 
00059 
00060 ?>

Generated on Sun Feb 26 13:23:04 2006 for Savane PHP Frontend Developer Reference by  doxygen 1.4.4