Kyberia v2.3 - 1st revision from SVN (Without patches of kyberia.sk team)
[mirrors/Kyberia-bloodline.git] / inc / eventz.inc
index cd2e6afa4773e0297fa8f0b5b6e6c6fd336f68fc..1e03596c493ec7273527549481dab5dd216850a9 100644 (file)
@@ -1,13 +1,35 @@
 <?php
-/* This program is free software. It comes without any warranty, to
- * the extent permitted by applicable law. You can redistribute it
- * and/or modify it under the terms of the Do What The Fuck You Want
- * To Public License, Version 2, as published by Sam Hocevar. See
- * http://sam.zoy.org/wtfpl/COPYING for more details. */
-
+//do not make a permission check if an event was executed before
+if ($_SESSION['eventz'][$event]) {
+       include_once(SYSTEM_ROOT."/inc/eventz/$event.inc");
+       $status=$event();
+}
 
+elseif (is_file(SYSTEM_ROOT."/inc/eventz/$event.inc")) {
+       $event_id=nodes::getNodeIdByName($event,"event://$event");
+       $event_node=nodes::getNodeById($event_id,$_SESSION['user_id']);
+       if ($event_node['node_system_access']=='public'
+|| ($event_node['node_creator']==$_SESSION['user_id'])
+|| $event_node['node_permission']=='op'
+|| $event_node['node_permission']=='execute'
+|| $event_node['node_permission']=='master' ) {
                include_once(SYSTEM_ROOT."/inc/eventz/$event.inc");
                $status=$event();
+               $_SESSION['eventz'][$event]=true;
+
+       }
+
+       else {
+               $error=$error_messages['EVENT_NOT_PERMITTED'];
+       }
+
+}
+
+else {
+       $error=$error_messages['EVENT_NOT_EXISTENT'];
+       $status=false;
+}
+
 
 if ($status>1) {
        Header("Location: /id/".$status."/");
This page took 0.13397 seconds and 4 git commands to generate.