From: niekt0 Date: Tue, 26 Oct 2010 22:10:33 +0000 (+0200) Subject: log function fix X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=d4e006f91a41dac11aaf32f7ed8b0205600d3010;p=mirrors%2FKyberia-bloodline.git log function fix --- diff --git a/cron/logoutidle.php b/cron/logoutidle.php index cd61ef9..a477b8a 100755 --- a/cron/logoutidle.php +++ b/cron/logoutidle.php @@ -1,15 +1,12 @@ #!/usr/bin/php query("update users set user_action=NULL,user_action_id=NULL,user_location_vector=NULL where unix_timestamp()-3600>unix_timestamp(last_action)"); ?> diff --git a/wwwroot/inc/eventz/accesslist.inc b/wwwroot/inc/eventz/accesslist.inc index 6b473c8..7fbe5ce 100644 --- a/wwwroot/inc/eventz/accesslist.inc +++ b/wwwroot/inc/eventz/accesslist.inc @@ -22,7 +22,7 @@ return false; $q="insert into node_access set node_permission='access',node_id=$node_id,user_id=".$set->getString('user_id'); $db->query($q); } - $log->log('add access',$node_id,'ok',$acc); + $logger->log('add access',$node_id,'ok',$acc); } else { $error .= "$acc does not exist..."; } } diff --git a/wwwroot/inc/eventz/banlist.inc b/wwwroot/inc/eventz/banlist.inc index 571c712..4dd5dd8 100644 --- a/wwwroot/inc/eventz/banlist.inc +++ b/wwwroot/inc/eventz/banlist.inc @@ -22,7 +22,7 @@ return false; $q="insert into node_access set node_permission='ban',node_id=$node_id,user_id=".$set->getString('user_id'); $db->query($q); } - $log->log('add ban',$node_id,'ok',$ban); + $logger->log('add ban',$node_id,'ok',$ban); } else { $error .= "$ban does not exist..."; } } diff --git a/wwwroot/inc/eventz/configure_parent.inc b/wwwroot/inc/eventz/configure_parent.inc index df69389..1d97d7c 100644 --- a/wwwroot/inc/eventz/configure_parent.inc +++ b/wwwroot/inc/eventz/configure_parent.inc @@ -50,7 +50,7 @@ function configure_parent() { $db->update($q); $q="update nodes set node_children_count=node_children_count-1 where node_id='$old_parent'"; $db->update($q); - $log->log('vector change',$changed,$old_vector,$node_vector); + $logger->log('vector change',$changed,$old_vector,$node_vector); } return true; ?> diff --git a/wwwroot/inc/eventz/executelist.inc b/wwwroot/inc/eventz/executelist.inc index efc9d36..83c08ac 100644 --- a/wwwroot/inc/eventz/executelist.inc +++ b/wwwroot/inc/eventz/executelist.inc @@ -18,7 +18,7 @@ function executelist() { $q="insert into node_access set node_permission='execute',node_id=$node_id,user_id=".$set->getString('user_id'); $db->query($q); } - $log->log('add execute',$node_id,'ok',$execute); + $logger->log('add execute',$node_id,'ok',$execute); }else { $error .= "$execute does not exist..."; } } } diff --git a/wwwroot/inc/eventz/executorlist.inc b/wwwroot/inc/eventz/executorlist.inc index 24258cc..f6c24dc 100644 --- a/wwwroot/inc/eventz/executorlist.inc +++ b/wwwroot/inc/eventz/executorlist.inc @@ -22,7 +22,7 @@ user_id='".$set->getString('user_id')."'"; $q="insert into node_access set node_permission='exec',node_id=$node_id,user_id=".$set->getString('user_id'); $db->query($q); - $log->log('add exec',$node_id,'ok',$executor); + $logger->log('add exec',$node_id,'ok',$executor); } } diff --git a/wwwroot/inc/eventz/logout.inc b/wwwroot/inc/eventz/logout.inc index b11c484..2590c13 100644 --- a/wwwroot/inc/eventz/logout.inc +++ b/wwwroot/inc/eventz/logout.inc @@ -4,7 +4,7 @@ global $db; $q="update users set user_action_id=null where user_id='".$_SESSION['user_id']."'"; $db->query($q); - //$log->log('logout',$node['node_id'],'ok',$_SESSION['user_name']); //obnovit kdyz to bude mozne. ~harvie + $logger->log('logout',$node['node_id'],'ok',$_SESSION['user_name']); session_unset(); Header("Location: /main"); } diff --git a/wwwroot/inc/eventz/masterlist.inc b/wwwroot/inc/eventz/masterlist.inc index 1622931..d258365 100644 --- a/wwwroot/inc/eventz/masterlist.inc +++ b/wwwroot/inc/eventz/masterlist.inc @@ -18,7 +18,7 @@ return false; if (!$changed) { $q="insert into node_access set node_permission='master',node_id=$node_id,user_id=".$set->getString('user_id'); $db->query($q); - $log->log('add master',$node_id,'ok',$master); + $logger->log('add master',$node_id,'ok',$master); } } diff --git a/wwwroot/inc/eventz/oplist.inc b/wwwroot/inc/eventz/oplist.inc index d94c49a..ee048b7 100644 --- a/wwwroot/inc/eventz/oplist.inc +++ b/wwwroot/inc/eventz/oplist.inc @@ -21,7 +21,7 @@ function oplist() { echo $q; $db->query($q); } - $log->log('add op',$node_id,'ok',$op); + $logger->log('add op',$node_id,'ok',$op); }else { $error .= "$op does not exist..."; } } } diff --git a/wwwroot/inc/eventz/silencelist.inc b/wwwroot/inc/eventz/silencelist.inc index c01d6ed..4aaf703 100644 --- a/wwwroot/inc/eventz/silencelist.inc +++ b/wwwroot/inc/eventz/silencelist.inc @@ -20,7 +20,7 @@ return false; $q="insert into node_access set node_permission='silence',node_id=$node_id,user_id=".$set->getString('user_id'); $db->query($q); } - $log->log('add silence',$node_id,'ok',$sil); + $logger->log('add silence',$node_id,'ok',$sil); } else { $error .= "$sil does not exist..."; } } diff --git a/wwwroot/inc/eventz/unbook.inc b/wwwroot/inc/eventz/unbook.inc index dcc0948..e92dd68 100644 --- a/wwwroot/inc/eventz/unbook.inc +++ b/wwwroot/inc/eventz/unbook.inc @@ -8,11 +8,11 @@ $q="update node_access set last_visit='',node_bookmark='no' where user_id='".$_SESSION['user_id']."' and node_id='".$node['node_id']."'"; $result=$db->query($q); if ($result) { - $log->log('unbook','ok'); + $logger->log('unbook','ok'); return true; } else { - $log->log('unbook','failed'); + $logger->log('unbook','failed'); $error='unbook failed'; return false; } diff --git a/wwwroot/inc/log.inc b/wwwroot/inc/log.inc index 565bbd4..f575f63 100644 --- a/wwwroot/inc/log.inc +++ b/wwwroot/inc/log.inc @@ -1,5 +1,5 @@ log('add','error','WRITE_PERMISSION_ERROR'); + $logger->log('add','error','WRITE_PERMISSION_ERROR'); return false; } @@ -100,7 +100,7 @@ node_vector='".$params['node_vector']."'"; --$user_k; $db->query("update users set user_k='$user_k' where user_id='$params[node_creator]'"); $db->query("commit"); - $log->log('add','ok',$id); + $logger->log('add','ok',$id); if ($_POST['code']) { $params['node_creator']=UBIK_ID; diff --git a/wwwroot/inc/smarty/node_methodz/function.get_search.php b/wwwroot/inc/smarty/node_methodz/function.get_search.php index 8df3d24..5e35e01 100644 --- a/wwwroot/inc/smarty/node_methodz/function.get_search.php +++ b/wwwroot/inc/smarty/node_methodz/function.get_search.php @@ -1,39 +1,6 @@ ".$params['query']."",$output); -preg_match_all("/:::(.*?):::(.*?):::(.*?):::(.*?):::(.*?):::(.*?):::(.*?):::(.*?):::(.*?)n/i",$output,$matches); -foreach($matches[0] as $key => $value) { -preg_match("/(.*?).xml/i",$matches[2][$key],$ids); -$id=$ids[1]; -echo "".$matches[4][$key]." -(".$matches[6][$key].")
"; -echo $matches[7][$key]."

"; -//echo $matches[5][$key]."

"; -} - -global $db, $node; - -$q = "SELECT * FROM nodes WHERE node_system_access!='private' AND template_id=3 AND node_name LIKE -'%". -str_replace(array("%", "_"), array('%', '_'), -addslashes($params['query']))."%'"; -$set=$db->query($q); -while($set->next()) { -$rec = $set->getRecord(); -echo "{$rec[node_name]}
"; -} -*/ global $db, $node; if (is_numeric($params['offset'])) $offset = $params['offset']; else $offset = 0; @@ -67,4 +34,4 @@ while ($set->next()) { $smarty->assign('get_search',$search); } -?> \ No newline at end of file +?> diff --git a/wwwroot/nodes.php b/wwwroot/nodes.php index 427603f..586f81e 100644 --- a/wwwroot/nodes.php +++ b/wwwroot/nodes.php @@ -42,7 +42,7 @@ require(INCLUDE_DIR.'error_messages.inc'); require(INCLUDE_DIR.'database.inc'); $db = new CLASS_DATABASE(); -$log = new log; //XXX +$logger = new logger; //XXX if (!empty($_GET['template_id'])) { $template_id=$_GET['template_id']; @@ -283,7 +283,7 @@ if ($_SESSION['user_id']) { //if node is css if ($node['template_id']!='2019721'){ - $log->log('enter',$node['node_id'],'ok',$node['node_user_subchild_count']); + $logger->log('enter',$node['node_id'],'ok',$node['node_user_subchild_count']); if (!empty($_SESSION['user_id']) && is_numeric($node['node_id'])) { $q="update node_access set visits=visits+1,node_user_subchild_count='0',last_visit=NOW() where node_id='".$node['node_id']."' and user_id='".$_SESSION['user_id']."'"; // echo $q; @@ -330,7 +330,7 @@ elseif (!$permissions['r'] && $_GET['magic_word']) { else { - $log->log('enter',$node['node_id'],'failed'); + $logger->log('enter',$node['node_id'],'failed'); }