Subversion Repositories oidplus

Rev

Rev 730 | Rev 1050 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 730 Rev 825
Line 162... Line 162...
162
                if ($inside_severity_block) return false;
162
                if ($inside_severity_block) return false;
163
 
163
 
164
                return $out;
164
                return $out;
165
        }
165
        }
166
 
166
 
-
 
167
        private static $missing_plugin_queue = array();
-
 
168
 
-
 
169
        public static function reLogMissing() {
-
 
170
                while (count(self::$missing_plugin_queue) > 0) {
-
 
171
                        $item = self::$missing_plugin_queue[0];
-
 
172
                        if (!self::log_internal($item[0], $item[1], false)) return false;
-
 
173
                        array_shift(self::$missing_plugin_queue);
-
 
174
                }
-
 
175
                return true;
-
 
176
        }
-
 
177
 
167
        public static function log($maskcodes, $event) {
178
        public static function log($maskcodes, $event) {
-
 
179
                self::reLogMissing(); // try to re-log failed requests
-
 
180
                return self::log_internal($maskcodes, $event, true);
-
 
181
        }
-
 
182
 
-
 
183
        private static function log_internal($maskcodes, $event, $allow_delayed_log) {
168
                $loggerPlugins = OIDplus::getLoggerPlugins();
184
                $loggerPlugins = OIDplus::getLoggerPlugins();
169
                if (count($loggerPlugins) == 0) return false;
185
                if (count($loggerPlugins) == 0) {
-
 
186
                        // The plugin might not be initialized in OIDplus::init()
-
 
187
                        // yet. Remember the log entries for later submission during
-
 
188
                        // OIDplus::init();
-
 
189
                        if ($allow_delayed_log) self::$missing_plugin_queue[] = array($maskcodes, $event);
-
 
190
                        return false;
-
 
191
                }
170
 
192
 
171
                // What is a mask code?
193
                // What is a mask code?
172
                // A mask code gives information about the log event:
194
                // A mask code gives information about the log event:
173
                // 1. The severity (info, warning, error)
195
                // 1. The severity (info, warning, error)
174
                // 2. In which logbook(s) the event shall be placed
196
                // 2. In which logbook(s) the event shall be placed
Line 378... Line 400...
378
                                $result |= $plugin->log($event, $users, $objects);
400
                                $result |= $plugin->log($event, $users, $objects);
379
                        }
401
                        }
380
                }
402
                }
381
 
403
 
382
                return $result;
404
                return $result;
383
 
-
 
384
        }
405
        }
385
}
406
}