(){}_.,;:-+*/=@\"'\$", //Punctuation 4000); //Issue the MySQL query. mysql_query("INSERT INTO loge SET type=" . $type . ", utime=\"" . $utime . "\" " . ", stime=\"" . mysql_real_escape_string ($stime, $GLOBAL_dbhandle) . "\" " . ", ip=\"" . mysql_real_escape_string ($ip, $GLOBAL_dbhandle) . "\" " . ", userid=\"" . mysql_real_escape_string ($userid, $GLOBAL_dbhandle) . "\" " . ", sid=\"" . mysql_real_escape_string ($sid, $GLOBAL_dbhandle) . "\" " . ", scriptfile=\"" . mysql_real_escape_string ($scriptfile, $GLOBAL_dbhandle) . "\" " . ", getpostpars=\"" . mysql_real_escape_string ($getpostpars, $GLOBAL_dbhandle) . "\" " . ", phpfilek=\"" . mysql_real_escape_string ($phpfilek, $GLOBAL_dbhandle) . "\" " . ", phplinek=\"" . mysql_real_escape_string ($phplinek, $GLOBAL_dbhandle) . "\" " . ", logentry=\"" . mysql_real_escape_string ($logentry, $GLOBAL_dbhandle) . "\"", $GLOBAL_dbhandle); } // // //-------------------------------------------------------------------------------------------------------------- //Forces a log entry type into a valid type and range. Return value is the //sanitized value. // function LOG_force_type_set($type) { if (!is_int($type)) { //It is not an integer. Flag this as invalid. $type = (int) LOG_ET_INVALID_SPECIFIED; } else { //It is an integer. Force it into set of allowed values. switch($type) { case LOG_ET_UNKNOWN_MISC: case LOG_ET_PAGEHIT: case LOG_ET_ERRDBCONN: case LOG_ET_LOGIN_OK: case LOG_ET_LOGIN_FAIL: case LOG_ET_LOGOUT_VOL: case LOG_ET_LOGOUT_TIME: case LOG_ET_REVAL_OK: case LOG_ET_SEC_SID_FORGED: case LOG_ET_SEC_LOGOUT_IP: case LOG_ET_MAINT_PERIODIC: case LOG_ET_UNCATEGORIZED: case LOG_ET_INVALID_SPECIFIED: //Do nothing. This is already in bounds. break; default: //It is out of range. Force it in. $type = (int) LOG_ET_INVALID_SPECIFIED; } } //Sanitization is complete. Return it. return($type); } // //-------------------------------------------------------------------------------------------------------------- //Makes a system log entry, with a constant prefix. // function LOG_syslog($text) { syslog(LOG_WARNING, CONFIG_MYSQL_ERR_SYSLOG_PREFIX . ": " . $text); } // //-------------------------------------------------------------------------------------------------------------- //End of $RCSfile: log.inc,v $. //-------------------------------------------------------------------------------------------------------------- ?>