aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/db.php5
-rw-r--r--src/fcontest.php4
-rwxr-xr-xsrc/globals.php6
3 files changed, 8 insertions, 7 deletions
diff --git a/src/db.php b/src/db.php
index 6d437dc..8ccda12 100644
--- a/src/db.php
+++ b/src/db.php
@@ -177,7 +177,7 @@ function DBClose($c) {
//$sql eh a instrucao sql
//$txt eh um pequeno texto descrevendo o que esta sendo feito no sql
function DBExecNonStop($conn,$sql,$txt='') {
- if($txt=='') $txt='unknown at '.getFunctionName();
+ if($txt=='') $txt='unknown at '. getFunctionName();
$result = @DB_pg_exec ($conn, $sql);
if (!$result) {
LOGLevel("Unable to exec SQL in the database ($txt). " .
@@ -191,7 +191,8 @@ function DBExecNonStop($conn,$sql,$txt='') {
//$sql eh a instrucao sql
//$txt eh um pequeno texto descrevendo o que esta sendo feito no sql
function DBExec($conn,$sql,$txt='') {
- if($txt=='') $txt='unknown at '.getFunctionName();
+ if($txt=='') $txt='unknown at '. getFunctionName();
+ LOGLevel("DBExec: " . $sql, 3, false);
$result = DB_pg_exec ($conn, $sql);
if (!$result) {
LOGError("Unable to exec SQL in the database ($txt). " .
diff --git a/src/fcontest.php b/src/fcontest.php
index 16c4ad5..7733111 100644
--- a/src/fcontest.php
+++ b/src/fcontest.php
@@ -671,8 +671,8 @@ function DBUpdateSite ($param,$c=null) {
$sql .= " sitelastmilescore=$sitelastmilescore, ";
if($sitescorelevel > -5)
$sql .= " sitescorelevel=$sitescorelevel, ";
- $sql .= " updatetime=".$updatetime." where contestnumber=$contestnumber and sitenumber=$sitenumber " .
- "and updatetime < $updatetime";
+ $sql .= " updatetime=".$updatetime." where contestnumber=$contestnumber and sitenumber=$sitenumber ";
+ //. "and updatetime < $updatetime";
DBExec($c,$sql, "DBUpdateSite(update site)");
if($docommit) {
DBExec($c, "commit work", "DBUpdateSite(commit-update)");
diff --git a/src/globals.php b/src/globals.php
index b179bd5..487c26f 100755
--- a/src/globals.php
+++ b/src/globals.php
@@ -213,10 +213,10 @@ function ValidSession() {
}
// grava erro no arquivo de log
function LOGError($msg) {
- LOGLevel($msg,0);
+ LOGLevel($msg,0,false);
}
// grava linha no arquivo de log com o nivel especificado
-function LOGLevel($msg,$level) {
+function LOGLevel($msg,$level,$dodb=true) {
$msga = sanitizeText(str_replace("\n", " ", $msg));
$msg = now() . ": ";
define_syslog_variables ();
@@ -244,7 +244,7 @@ function LOGLevel($msg,$level) {
openlog ("BOCA", LOG_ODELAY, LOG_USER);
syslog ($prior, $msg);
closelog();
- if (isset($_SESSION["usertable"]))
+ if ($dodb && isset($_SESSION["usertable"]))
DBNewLog($_SESSION["usertable"]["contestnumber"], $_SESSION["usertable"]["usersitenumber"],
$_SESSION["usertable"]["usernumber"], $type, getIP(), $msga, "");
}