query("select node_parent, node_system_access, node_creator,
template_id, node_content, node_name from nodes where nodes.node_id = '$add_event_id'");
$set->next();
$node_parent = $set->getString('node_parent');
$node_system_access = $set->getString('node_system_access');
$node_creator = $set->getString('node_creator');
$node_template = $set->getString('template_id');
$node_content = stripslashes($set->getString('node_content'));
$event_name = $set->getString('node_name');
$fp = fopen (EVENT_DIR.$event_name.".inc","w+");
fwrite($fp,$node_content);
fclose($fp);
chown(EVENT_DIR.$event_name.".inc","wwwedit");
$q = "update nodes set external_link = '' where node_name = '".$event_name."' and external_link = 'event://$event_name'";
$db->query($q);
$q = "update nodes set external_link = 'event://$event_name' where node_id = '".$add_event_id."'";
$db->query($q);
//logging of every event for security reasons
$params['node_creator'] = UBIK_ID;
$params['node_parent'] = 2019771;
$params['node_name'] = "addEvent execute: node $add_event_id";
$params['node_content'] = "addEvent execute: node $add_event_id by user ".$_SESSION['user_name'];
$params['node_content'] .= "
event_name: ".$event_name;
$params['node_content'] .= "
template_id: ".$node_template."";
$params['node_content'] .= "
node_parent: ".$node_parent."";
$params['node_content'] .= "
node_system_access: ".$node_system_access;
$params['node_content'] .= "
node_creator: ".$node_creator."";
$params['node_content'] = mysql_real_escape_string($params['node_content']);
nodes::addNode($params);
return true;
}
?>