$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..."; }
}
$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..."; }
}
$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
+?>
$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
+?>
$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);
}
}
$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;
}
$_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;
}
$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;
}
$_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'];
// 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;
}
$_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'];
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
+?>
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);
}
}
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..."; }
}
}
$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..."; }
}
$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;
}
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
+?>
$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;
}
--$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;
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'];
//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;
else {
- log::log('enter',$node['node_id'],'failed');
+ $log->log('enter',$node['node_id'],'failed'); XXX
}