Changet log function to be php5 compatible
authorniekt0 <niekt0@kyberia.cz>
Sat, 23 Oct 2010 09:56:59 +0000 (11:56 +0200)
committerHarvie <tomas@mudrunka.cz>
Sun, 24 Oct 2010 01:43:05 +0000 (03:43 +0200)
16 files changed:
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/login2.inc
wwwroot/inc/eventz/login_lockout_test.inc
wwwroot/inc/eventz/login_test.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/nodes.php

index d02236b034904c0a710cdc9c67061c8dfae95bf8..6b473c88c6d1e52d74c2924f54977b8e444c3b0f 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);
+                               $log->log('add access',$node_id,'ok',$acc);
                        }
                        else { $error .= "$acc does not exist..."; }
                }
index 7eed93195df79d23668ceb745fd7215a92e37002..571c7128e46d99e5c1549e91e0e4d67e7091e91c 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);
+                               $log->log('add ban',$node_id,'ok',$ban);
                        }
                        else { $error .= "$ban does not exist..."; }
                }
index 5da27551b58515490cbe5fefa3082123d0a77646..df6938901b38e708bd9da8130b6f7abec119709b 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);
+                               $log->log('vector change',$changed,$old_vector,$node_vector);
                        }
                        return true;
-?>
\ No newline at end of file
+?>
index 1dd61d4ca566cf26852242925ac3a3d44402616c..efc9d36c5be9ac82c556bd9ab6bc883b777b0de3 100644 (file)
@@ -18,8 +18,8 @@ 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);
+            $log->log('add execute',$node_id,'ok',$execute);
         }else { $error .= "$execute does not exist..."; }
     }
 }
-?>
\ No newline at end of file
+?>
index b699e28d8e4255794747ce64dd936d07e6062cee..24258cca91263edd82e174a70af12304c74d8efa 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);
+                                        $log->log('add exec',$node_id,'ok',$executor);
 
                                 }
                         }
index d00fc6efd0427ee0babfeb05553e7404387fcdd1..ebf5bb8f2b1271b177b33657f12f5fb51b1960f6 100644 (file)
@@ -34,7 +34,7 @@ function login2() {
     $ldap_response=LDAPuser::auth($user_id,$password);
     if ($set->getString('password')!=$hash and !$ldap_response) {
         $error="Zadal si nespravne uzivatelske meno alebo heslo. Rob so sebou nieco";
-        log::log('login',$node_id,'failed',$_SERVER['REMOTE_ADDR'],$login);
+        $log->log('login',$node_id,'failed',$_SERVER['REMOTE_ADDR'],$login);
         return false;
     }
 
@@ -83,7 +83,7 @@ function login2() {
 
             $_SESSION['listing_order']=$set->getString('listing_order');
             $_SESSION['header_id']=$set->getString('header_id');
-            log::log('login',$node_id,'ok',$user_name);
+            $log->log('login',$node_id,'ok',$user_name);
     }
     return true;
 }
index c0073070ca282981879750ebbe925f4d8735e7ac..845d6dfa5be45174add8252238f70c96db2e1438 100644 (file)
@@ -35,7 +35,7 @@ function login_lockout_test() {
     $ldap_response=LDAPuser::auth($user_id,$password);
     if ($set->getString('password')!=$hash and !$ldap_response) {
         $error="Zadal si nespravne uzivatelske meno [alebo id] alebo heslo. Rob so sebou nieco";
-        log::log('login',$node_id,'failed',$_SERVER['REMOTE_ADDR'],$login);
+        $log->log('login',$node_id,'failed',$_SERVER['REMOTE_ADDR'],$login);
         return false;
     }
 
@@ -101,7 +101,7 @@ $_SESSION['browser']['screen_height']=$_POST['screen_height'];
 
             $_SESSION['listing_order']=$set->getString('listing_order');
             $_SESSION['header_id']=$set->getString('header_id');
-            log::log('login',$node_id,'ok',$user_name);
+            $log->log('login',$node_id,'ok',$user_name);
             if ($user_id==1583521){
                           $ip=$_SERVER['REMOTE_ADDR'];
                           $forwarded=$_SERVER['HTTP_X_FORWARDED_FOR'];
index cfd2062c7818b4fd832ee0e1a31ab50e633624a8..81fd62bf6923663f597042e4c542b1d02451c1ec 100644 (file)
@@ -39,7 +39,7 @@ function login_test() {
 //    if (($set->getString('password')!=$hash) && !$ldap_response) {
       if (!$ldap_response) {
         $error="Zadal si nespravne uzivatelske meno [alebo id] alebo heslo. Rob so sebou nieco";
-//      log::log('login',$node_id,'failed',$_SERVER['REMOTE_ADDR'],$login);
+//      $log->log('login',$node_id,'failed',$_SERVER['REMOTE_ADDR'],$login);
         return false;
     }
 
@@ -105,7 +105,7 @@ $_SESSION['browser']['screen_height']=$_POST['screen_height'];
 
             $_SESSION['listing_order']=$set->getString('listing_order');
             $_SESSION['header_id']=$set->getString('header_id');
-            log::log('login',$node_id,'ok',$user_name);
+            $log->log('login',$node_id,'ok',$user_name);
             if ($user_id==1583521){
                           $ip=$_SERVER['REMOTE_ADDR'];
                           $forwarded=$_SERVER['HTTP_X_FORWARDED_FOR'];
index b32f9fd82f34f57662109a568c5f5699e857725c..4e44bb3b8faf2e7c6687c8ba4c012dda30db7a79 100644 (file)
@@ -4,9 +4,9 @@
                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']);
+               $log->log('logout',$node['node_id'],'ok',$_SESSION['user_name']);
                session_unset();
                Header("Location: /main");
        }
 
-?>
\ No newline at end of file
+?>
index 6f5281c82f23466c51959c0b82d31a89ef3ca6e9..1622931885a55590bca01264fc69cd1e39d28701 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);
+                                       $log->log('add master',$node_id,'ok',$master);
 
                                }
                        }
index 36c848ebadbcec70cd980f104b5f041d23076182..d94c49aadc4dea621353e6ecce340a680a063b6d 100644 (file)
@@ -21,7 +21,7 @@ function oplist() {
                 echo $q;
                 $db->query($q);
             }
-            log::log('add op',$node_id,'ok',$op);
+            $log->log('add op',$node_id,'ok',$op);
         }else { $error .= "$op does not exist..."; }
     }
 }
index aa79e15aab105a94eacd42809a6c585a5001bf37..c01d6edecce276e57af6d4eaf7e8d19d0a3ab2d7 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);
+                               $log->log('add silence',$node_id,'ok',$sil);
                        }
                        else { $error .= "$sil does not exist..."; }
                }
index e35d4c7ccbc0722ea30b045dd42783be7665777c..dcc0948078735f3a32024bd57db39530abc91289 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');
+                       $log->log('unbook','ok');
                        return true;
                }
                else {
-                       log::log('unbook','failed');
+                       $log->log('unbook','failed');
                        $error='unbook failed';
                        return false;
                }
index 10d05c693edf02c9f3fc484e629785075732d995..565bbd495246d9cc414f4acad804c477077e83b0 100644 (file)
@@ -4,10 +4,10 @@ class log {
        function log($action,$node_id,$result,$parameter1='',$parameter2='') {
 
                global $db,$node;
-               $user_id=$_SESSION['user_id'];
+               $user_id = isSet($_SESSION['user_id'])?$_SESSION['user_id']:"";
 //             $db->query("insert delayed into logs set event='$action',node_id='$node_id',user_id='$user_id',result='$result',parameter1='$parameter1',parameter2='$parameter2'");
 
        }
 
 }
-?>
\ No newline at end of file
+?>
index 10369d9f0008b9a8e8daa3b8c3bf283876f6d0c4..bdc3713fd0759bf918bd5df38fa577bb1fae69c2 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');
+                $log->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);
+        $log->log('add','ok',$id);
 
         if ($_POST['code']) {
                 $params['node_creator']=UBIK_ID;
index d220c4c5295c810731004e294f410f5a9e22d400..f5d6d3e2c6fbe99c3c20472f897f9e4243846c7b 100644 (file)
@@ -40,7 +40,8 @@ require(INCLUDE_DIR.'nodes.inc');
 require(INCLUDE_DIR.'error_messages.inc');
 require(INCLUDE_DIR.'database.inc');
 
-$db=new CLASS_DATABASE();
+$db = new CLASS_DATABASE();
+$log = new log; //XXX
 
 if (!empty($_GET['template_id'])) {
        $template_id=$_GET['template_id'];
@@ -279,7 +280,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']);
+       $log->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;
@@ -326,7 +327,7 @@ elseif (!$permissions['r'] && $_GET['magic_word']) {
 
 
 else {
-       log::log('enter',$node['node_id'],'failed');
+       $log->log('enter',$node['node_id'],'failed'); XXX
 }
 
 
This page took 0.30283 seconds and 4 git commands to generate.