log function fix
authorniekt0 <niekt0@kyberia.cz>
Tue, 26 Oct 2010 22:10:33 +0000 (00:10 +0200)
committerniekt0 <niekt0@kyberia.cz>
Tue, 26 Oct 2010 22:10:33 +0000 (00:10 +0200)
15 files changed:
cron/logoutidle.php
wwwroot/inc/eventz/accesslist.inc
wwwroot/inc/eventz/banlist.inc
wwwroot/inc/eventz/configure_parent.inc
wwwroot/inc/eventz/executelist.inc
wwwroot/inc/eventz/executorlist.inc
wwwroot/inc/eventz/logout.inc
wwwroot/inc/eventz/masterlist.inc
wwwroot/inc/eventz/oplist.inc
wwwroot/inc/eventz/silencelist.inc
wwwroot/inc/eventz/unbook.inc
wwwroot/inc/log.inc
wwwroot/inc/nodes.inc
wwwroot/inc/smarty/node_methodz/function.get_search.php
wwwroot/nodes.php

index cd61ef99a5a6689df604ae597c33f12394632a06..a477b8aabd166386d3d0fffadcaaf83c8f2e64d4 100755 (executable)
@@ -1,15 +1,12 @@
 #!/usr/bin/php
 <?php
-//require('/storage/system/www-docroot/kyberia.sk/config/config.inc');
-require('/home/freezy/kyb/config/config.inc');
-//connecting to database and creating universal $db object
+
+//XXX fix full path
+require('/storage/system/www-docroot/kyberia/config/config.inc');
+
 //require(SYSTEM_ROOT.'/inc/log.inc');
-//require(SYSTEM_ROOT.'/inc/database.inc');
+require(SYSTEM_ROOT.'/inc/database.inc');
 //require(SYSTEM_ROOT.'/inc/nodes.inc');
-//require('/storage/system/www-docroot/kyberia.sk/inc/log.inc');
-//require('/storage/system/www-docroot/kyberia.sk/inc/database.inc');
-require('/home/freezy/kyb/inc/database.inc');
-//require('/storage/system/www-docroot/kyberia.sk/inc/nodes.inc');
 $db=new CLASS_DATABASE();
 $db->query("update users set user_action=NULL,user_action_id=NULL,user_location_vector=NULL where unix_timestamp()-3600>unix_timestamp(last_action)");
 ?>
index 6b473c88c6d1e52d74c2924f54977b8e444c3b0f..7fbe5ce29c44955f184422d2ece23754c5441ad8 100644 (file)
@@ -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..."; }
                }
index 571c7128e46d99e5c1549e91e0e4d67e7091e91c..4dd5dd87c5f7f1feb4511e4517f54d19953cc01e 100644 (file)
@@ -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..."; }
                }
index df6938901b38e708bd9da8130b6f7abec119709b..1d97d7c6d5548b3cee5800b93a0005eecaaf9f9a 100644 (file)
@@ -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;
 ?>
index efc9d36c5be9ac82c556bd9ab6bc883b777b0de3..83c08acd23dc3330bbb51d21e1fad09b9bd6c635 100644 (file)
@@ -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..."; }
     }
 }
index 24258cca91263edd82e174a70af12304c74d8efa..f6c24dc4e39124df46e03c21306356e07600d4f2 100644 (file)
@@ -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);
 
                                 }
                         }
index b11c484a1f027b9f020d5b5877f7a017c32da4fa..2590c136149c0be71e864227fbdefb1e7cce8ae2 100644 (file)
@@ -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");
        }
index 1622931885a55590bca01264fc69cd1e39d28701..d2583658750c21ad3ef3b5f49cb3ce29d565db43 100644 (file)
@@ -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);
 
                                }
                        }
index d94c49aadc4dea621353e6ecce340a680a063b6d..ee048b7703126bb688b6df486c13fb16d189147f 100644 (file)
@@ -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..."; }
     }
 }
index c01d6edecce276e57af6d4eaf7e8d19d0a3ab2d7..4aaf7032fc6f3d6ee6bee9d09e0bce4d130c99ce 100644 (file)
@@ -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..."; }
                }
index dcc0948078735f3a32024bd57db39530abc91289..e92dd68445397640d8551e5f6b2300d0c3275e42 100644 (file)
@@ -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;
                }
index 565bbd495246d9cc414f4acad804c477077e83b0..f575f63491ca8e309d09edfe06cd1bcb39c6a835 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-class log {
+class logger {
 
        function log($action,$node_id,$result,$parameter1='',$parameter2='') {
 
index bdc3713fd0759bf918bd5df38fa577bb1fae69c2..2b7053695068640759f99266ab8a87f8e22d7176 100644 (file)
@@ -28,7 +28,7 @@ function addNode($params) {
         $parent_permissions=permissions::checkPermissions($parent_id);
         if (!$parent_permissions['w']) {
                 $error=$error_messages['WRITE_PERMISSION_ERROR'];
-                $log->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;
index 8df3d241ba3f79d74488f2e36020af6899e9d83e..5e35e0181dde943146a2ceeb611910dfa7c39147 100644 (file)
@@ -1,39 +1,6 @@
 <?php
 function smarty_function_get_search($params,&$smarty) {
-/*
-$string=escapeshellarg($params['query']);
-$output=`/usr/local/bin/swish-e -d ::: -p node_name node_id node_type node_content k node_views -s node_views -f
-/storage/data/index.swish-e -w node_name=($string) or node_content=($string)`;
-//$output2=`/usr/local/bin/swish-e -d ::: -p node_name node_id node_type node_content k node_views -s node_views -f
-/storage/data/index.swish-e -w '$string'`;
-//echo "/usr/local/bin/swish-e -d ::: -p node_name node_id node_type node_content k node_views -s node_views -f
-/storage/data/index.swish-e -w $string";
-//$output=$output1.$output2;
-$output=str_replace($params['query'],"<span
-class='most_important'>".$params['query']."</span>",$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 "<a href='/id/".$id."'>".$matches[4][$key]."</a>
-(".$matches[6][$key].")<br>";
-echo $matches[7][$key]."<br><br>";
-//echo $matches[5][$key]."<br><br>";
-}
-
 
-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 "<a href='/id/{$rec[node_id]}'>{$rec[node_name]}</a><br>";
-}
-*/
 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
+?>
index 427603f538c00a0e49b2fdb3653709f35e01f2ec..586f81ecbb1d9bf4972d720eacf319038c64f732 100644 (file)
@@ -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');
 }
 
 
This page took 0.282217 seconds and 4 git commands to generate.