CMS  Version 3.9
component_manager.inc
Go to the documentation of this file.
1 <?php
2 /**************************************************************
3 
4  Copyright (c) 2010 Sonjara, Inc
5 
6  Permission is hereby granted, free of charge, to any person
7  obtaining a copy of this software and associated documentation
8  files (the "Software"), to deal in the Software without
9  restriction, including without limitation the rights to use,
10  copy, modify, merge, publish, distribute, sublicense, and/or sell
11  copies of the Software, and to permit persons to whom the
12  Software is furnished to do so, subject to the following
13  conditions:
14 
15  The above copyright notice and this permission notice shall be
16  included in all copies or substantial portions of the Software.
17 
18  Except as contained in this notice, the name(s) of the above
19  copyright holders shall not be used in advertising or otherwise
20  to promote the sale, use or other dealings in this Software
21  without prior written authorization.
22 
23  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
25  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
27  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
28  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
30  OTHER DEALINGS IN THE SOFTWARE.
31 
32 *****************************************************************/
33 
50 {
51  var $found = array();
52 
53  static $verbosityLevel = 0;
54  static $plainOutput = false;
55  private static $scanLog = "";
56 
57  static function scanTrace($message, $level)
58  {
59  global $config;
60 
62  {
63  if (!ComponentManager::$scanLog)
64  {
65  ComponentManager::$scanLog = $config['uploadbase'].DIRECTORY_SEPARATOR."component_scan_".date("Ymd-His").".log";
66  }
67 
68  error_log($message."\n", 3, ComponentManager::$scanLog);
69 
70  echo $message;
71  echo (ComponentManager::$plainOutput) ? "\n" : "<br/>";
72  }
73 
74  trace($message, $level);
75  }
76 
80  function ComponentManager()
81  {
82  }
83 
90  function scanComponents($root, $subdir)
91  {
92  if (!$root || $root == ".") return;
93 
94  $path = $root . DIRECTORY_SEPARATOR . str_replace("/", DIRECTORY_SEPARATOR, $subdir);
95 
96  ComponentManager::scanTrace("Scanning $path", 2);
97 
98  if (is_dir($path))
99  {
100  $handle = opendir($path);
101  while(false !== ($file = readdir($handle)))
102  {
103  $f = $path . DIRECTORY_SEPARATOR . $file;
104  $m = $f . DIRECTORY_SEPARATOR . "manifest.inc";
105  $d = $f . DIRECTORY_SEPARATOR . "DEPRECATED";
106 
107  if (is_dir($f))
108  {
109  ComponentManager::scanTrace("== Found component '$file'", 3);
110  if (is_file($d))
111  {
112  ComponentManager::scanTrace("**** Deprecated component - ignoring", 3);
113  Cache::invalidate("fakoli_includes_$file");
114  continue;
115  }
116 
117  if ($this->found[$file])
118  {
119  ComponentManager::scanTrace("---- already defined - skipping", 3);
120  continue;
121  }
122 
123  if (!is_file($m))
124  {
125  ComponentManager::scanTrace("== No manifest found. Skipping...", 3);
126  continue;
127  }
128 
129  require_once $m;
130 
131  $cl = Fakoli::getComponentClassRoot($file) . "Manifest";
132 
133  try
134  {
135  ComponentManager::scanTrace("== Instantiating $cl", 3);
136 
137  $manifest = new $cl;
138  $component = $manifest->getComponentDefinition();
139  $component->component_path = sanitizePath($f);
140  $component->joinTransaction($this->tx);
141  $component->save();
142 
143  $this->found[$file] = $component;
144 
145  $this->scanAdminPages($component);
147 
148  }
149  catch(Exception $e)
150  {
151  ComponentManager::scanTrace("-- Failed to instantiate manifest class. Skipping...", 3);
152  }
153 
154  Cache::invalidate("fakoli_includes_$file");
155  }
156  }
157 
158  closedir($handle);
159  }
160  }
161 
167  {
168  if (!$component->enabled) return;
169 
170  $admin = $component->component_path . DIRECTORY_SEPARATOR . "admin";
171 
172  if (!is_dir($admin)) return;
173 
174  ComponentManager::scanTrace("== Scanning $admin", 3);
175 
176  $handle = opendir($admin);
177 
178  while(false !== ($file = readdir($handle)))
179  {
180  if (endsWith($file, ".inc"))
181  {
182  $page = new AdminPage();
183  $page->identifier = preg_replace("/\\.inc$/", "", $file);
184  $page->server_path = $admin . DIRECTORY_SEPARATOR . $file;
185  $page->component_id = $component->component_id;
186  $page->joinTransaction($this->tx);
187  $page->save();
188  Cache::invalidate("fakoli_admin_pages_{$page->identifier}");
189  }
190  }
191 
192  }
193 
199  {
200  $pages = $component->component_path . DIRECTORY_SEPARATOR . "pages";
201 
202  if (!is_dir($pages)) return;
203  ComponentManager::scanTrace("== Scanning $pages", 3);
204 
205  $handle = opendir($pages);
206 
207  while(false !== ($file = readdir($handle)))
208  {
209  if (endsWith($file, ".inc"))
210  {
211  $identifier = preg_replace("/\\.inc$/", "", $file);
212 
213  try
214  {
215  $page = Query::create(ComponentPage, "WHERE component=:c AND identifier=:i")
216  ->bind(":c", $component->name, ":i", $identifier)
217  ->executeSingle();
218 
219  $page->scanned = true;
220  $page->server_path = $pages . DIRECTORY_SEPARATOR . $file;
221  $page->filter = new InclusionFilter("component_page_id", "server_path", "scanned");
222  $page->save();
223  }
224  catch(DataNotFoundException $e)
225  {
226  $page = new ComponentPage();
227  $page->page_title = prettify($identifier);
228  $page->identifier = $identifier;
229  $page->component = $component->name;
230  $page->server_path = $pages . DIRECTORY_SEPARATOR . $file;
231  $page->role = "";
232  $page->enabled = true;
233  $page->scanned = true;
234  $page->save();
235  }
236  }
237  }
238 
239  }
240 
246  function scan($verbosity = 0)
247  {
248  global $config;
249 
250  Fakoli::$scanning = true;
252 
253  $this->tx = new DataTransaction();
254 
255  try
256  {
257 
258  $c = new Component();
259  $c->joinTransaction($this->tx);
260  $c->deleteAll();
261 
262 
263  $p = new AdminPage();
264  $p->joinTransaction($this->tx);
265  $p->deleteAll();
266 
267  $cp = new ComponentPage();
268  $cp->joinTransaction($this->tx);
269  $cp->updateExplicit("SET scanned=0");
270 
271  $path .= $config['homedir'] . PATH_SEPARATOR . ini_get("include_path");
272 
273  if (isset($config["extra_includes"])) $path .= PATH_SEPARATOR . $config["extra_includes"];
274 
275  $roots = explode(PATH_SEPARATOR, $path);
276 
277  foreach($roots as $root)
278  {
279  if ($root == ".") continue;
280 
281  ComponentManager::scanTrace("Scanning $root for components", 2);
282  $this->scanComponents($root, "cms/components");
283  $this->scanComponents($root, "components");
284  }
285 
286  Cache::invalidate("fakoli_components");
287  Cache::invalidate("fakoli_admin_menu");
288  Cache::invalidate("fakoli_admin_icons");
289  Cache::invalidate("fakoli_scripts");
290  Cache::invalidate("fakoli_styles");
291  Cache::invalidate("fakoli_event_map");
292 
293  $cp->delete("WHERE scanned=0");
294 
295 
296  $this->tx->commit();
297  unset($this->tx);
298 
299  $components = indexedQuery(Component, "WHERE enabled=1", "name");
300  Cache::put("fakoli_components", $components);
301 
302  ComponentManager::fireEvent("upgradeComponent");
303 
304  ComponentManager::fireEvent("ComponentScanComplete");
305 
306  Fakoli::$scanning = false;
307  }
308  catch(Exception $e)
309  {
310  // JDG 6/1/2011 - if fails on ComponentScanComplete
311  if(isset($this->tx))
312  $this->tx->rollback();
313  unset($this->tx);
314 
315  Fakoli::$scanning = false;
316 
318  {
319  echo $e->__toString();
320  }
321  else
322  {
323  throw $e;
324  }
325  }
326  }
327 
333  static function findComponentPath($name)
334  {
335  global $config;
336 
337  $path .= $config['homedir'] . PATH_SEPARATOR . ini_get("include_path");
338 
339  if (isset($config["extra_includes"])) $path .= PATH_SEPARATOR . $config["extra_includes"];
340 
341  $roots = explode(PATH_SEPARATOR, $path);
342 
343  foreach($roots as $root)
344  {
345  if ($root == ".") continue;
346 
347  $path = $root . DIRECTORY_SEPARATOR . "cms" . DIRECTORY_SEPARATOR . "components" . DIRECTORY_SEPARATOR . $name;
348 
349  if (file_exists($path))
350  {
351  if (!file_exists($path.DIRECTORY_SEPARATOR."DEPRECATED")) return $path;
352  }
353 
354  $path = $root . DIRECTORY_SEPARATOR . "components" . DIRECTORY_SEPARATOR . $name;
355 
356  if (file_exists($path))
357  {
358  if (!file_exists($path.DIRECTORY_SEPARATOR."DEPRECATED")) return $path;
359  }
360  }
361 
362  return null;
363  }
364 
371  {
373 
374  if (!array_key_exists($component, $components))
375  {
376  throw new FakoliException("Unrecognized or disabled component '$component'");
377  }
378  return $components[$component];
379  }
380 
386  static function getEventHandlers()
387  {
388  $eventMap = Cache::get("fakoli_event_map");
389  if ($eventMap) return $eventMap;
390 
391  ComponentManager::scanTrace("Mapping Event Handlers", 3);
392  $components = Query::create(Component, "WHERE enabled=1 ORDER BY priority")->execute();
393 
394  $eventMap = array();
395 
396  foreach($components as $component)
397  {
398  $manifest = $component->loadManifest();
399 
400  if (!$manifest || !method_exists($manifest, subscribeToEvents)) continue;
401 
402  $subscriptions = $manifest->subscribeToEvents();
403 
404  foreach($subscriptions as $event => $handler)
405  {
406  $handlerRecord = array("component" => $component->name, "priority" => $component->priority, "handler" => $handler);
407 
408  ComponentManager::scanTrace(" $component->name is subscribing to $event", 3);
409  if (array_key_exists($event, $eventMap))
410  {
411  $eventMap[$event][] = $handlerRecord;
412  }
413  else
414  {
415  $eventMap[$event] = array($handlerRecord);
416  }
417  }
418  }
419 
420  Cache::put("fakoli_event_map", $eventMap);
421  return $eventMap;
422  }
423 
430  static function compareByPriority($item1, $item2)
431  {
432  return $item1["priority"] - $item2["priority"];
433  }
434 
442  static function fireEvent($event, $parameter = null, $mustBeConsumed = false)
443  {
444  trace("** Firing event '$event'", 4);
445 
447 
448  if (!array_key_exists($event, $eventMap))
449  {
450  trace("No handlers subscribed to '$event'", 4);
451  return $parameter;
452  }
453 
454  $continue = true;
455 
456  foreach($eventMap[$event] as $subscription)
457  {
458  Fakoli::using($subscription["component"]);
459 
460  if (is_array($subscription["handler"]))
461  {
462  trace("Handling $event with {$subscription["handler"][0]}::{$subscription["handler"][1]}", 4);
463  }
464  else
465  {
466  trace("Handling $event with {$subscription["handler"]}", 4);
467  }
468 
469  if (!is_callable($subscription["handler"]))
470  {
471  if (is_array($subscription["handler"]))
472  {
473  trace("Subscription handler {$subscription["handler"][0]}::{$subscription["handler"][1]} for $event is invalid", 2);
474  }
475  else
476  {
477  trace("Subscription handler $event with {$subscription["handler"]} for $event is invalid", 2);
478  }
479 
480  trace(printIncludes(false, true), 3);
481  }
482  else
483  {
484  $parameter = call_user_func_array($subscription["handler"], array($parameter, &$continue));
485  }
486  if (!$continue) break;
487  }
488 
489  if ($mustBeConsumed && $continue)
490  {
491  throw new FakoliEventNotConsumed("'$event' not handled by any subscriber");
492  }
493 
494  return $parameter;
495  }
496 
504  static function fireEventTo($event, $component, $parameter = null)
505  {
506  trace("** Firing event '$event' to $component", 4);
507 
509 
510  if (!array_key_exists($event, $eventMap))
511  {
512  trace("No handlers subscribed to '$event'", 4);
513  return $parameter;
514  }
515 
516  foreach($eventMap[$event] as $subscription)
517  {
518  if ($component == $subscription["component"])
519  {
520 
521  Fakoli::using($subscription["component"]);
522 
523  if (is_array($subscription["handler"]))
524  {
525  trace("Handling $event with {$subscription["handler"][0]}::{$subscription["handler"][1]}", 4);
526  }
527  else
528  {
529  trace("Handling $event with {$subscription["handler"]}", 4);
530  }
531 
532  $parameter = call_user_func_array($subscription["handler"], array($parameter, &$continue));
533  break;
534  }
535  }
536 
537  return $parameter;
538  }
539 
545  function dispatchAction($process = null)
546  {
547  global $script;
548  global $isAction;
549  $isAction = true;
550 
551  $component = $this->getComponent($_REQUEST["component"]);
552  $action = $_REQUEST["action"];
553 
554  if (!preg_match("/^[\\w\\d_\\.]+$/", $action))
555  {
556  throw new FakoliException("Invalid action");
557  }
558 
559  $this->fireEventTo("PreAction", $component->name, $action);
560 
561  ob_start();
562 
563  $this->dispatchActionInternal($process);
564 
565  $out = ob_get_contents();
566  ob_end_clean();
567 
568  echo $script;
569  echo $out;
570 
571  $this->fireEventTo("PostAction", $component->name, $action);
572 
573  ComponentManager::fireEvent("RequestComplete");
574  }
575 
576  private function dispatchActionInternal($process = null)
577  {
578  global $method;
579  global $user;
580  global $config;
581  global $script;
582 
583  $action = $_REQUEST["action"];
584 
585  trace("ComponentManager::dispatchAction action: $action", 3);
586 
587  $component = $this->getComponent($_REQUEST["component"]);
588 
589  if (!preg_match("/^[\\w\\d_\\.]+$/", $action))
590  {
591  throw new FakoliException("Invalid action");
592  }
593 
594  $manifest = $component->loadManifest();
595 
596  if (!isset($user) && !$process && (!$manifest->allow_sessionless_handlers ||
597  (is_array($manifest->allow_sessionless_handlers) && array_search($action, $manifest->allow_sessionless_handlers) === FALSE)))
598  {
599  throw new FakoliException("Session Expired");
600  }
601 
602  $handler = $component->component_path . DIRECTORY_SEPARATOR . "handlers" . DIRECTORY_SEPARATOR . $action . ".inc";
603  trace("ComponentManager::dispatchAction handler: $handler", 3);
604 
606 
607  if (!is_file($handler))
608  {
609  throw new FakoliException("Invalid action");
610  }
611 
612  try
613  {
614  include $handler;
615  }
616  catch(FakoliEarlyExit $exit)
617  {
618  echo $exit->getMessage();
619  }
620 
622 
623  }
624 
626  {
627  global $method;
628 
629  trace($action, 3);
630 
631  list($uri, $queryString) = explode("?", $action);
632 
633  trace("URI: $uri, Query String: $queryString", 3);
634 
635  list($empty, $prefix, $component, $action) = explode("/", $uri);
636 
637  trace("Prefix: $prefix, Component: $component, Action: $action", 3);
638 
639  if ($prefix != "action")
640  {
641  throw new FakoliException("Malformed action handler");
642  }
643 
644  $context = array(
645  "_GET" => $_GET,
646  "_REQUEST" => $_REQUEST,
647  "_SERVER" => $_SERVER,
648  "method" => $method
649  );
650 
651  parse_str($queryString, $_GET);
652 
653  //trace("\$_GET: " . json_encode($_GET), 3);
654 
655  $_SERVER["REQUEST_URI"] = $uri;
656 
657  $_GET["component"] = $component;
658  $_GET["action"] = $action;
659 
660  $_REQUEST["component"] = $component;
661  $_REQUEST["action"] = $action;
662 
663  ob_start();
664 
665  try
666  {
667  $this->dispatchActionInternal($process);
668  }
669  catch(Exception $e)
670  {
671  trace($e->getMessage(), 3);
672  echo $e->getMessage();
673  }
674 
675  $output = ob_get_contents();
676  ob_end_clean();
677 
678  //trace(print_r($context, true), 3);
679 
680  foreach($context as $name => $value)
681  {
682  $$name = $value;
683  }
684 
685  return $output;
686  }
687 
688  static function displayPage($identifier, &$continue)
689  {
690  global $page_role;
691 
692  try
693  {
694  checkIdentifier($identifier);
695 
696  $page = ComponentPage::findByIdentifier($identifier, "WHERE enabled=1");
697 
698  // JDG 11/2011 - are templates ever stored with tpl at the end??
699  $page_template = (preg_match("/tpl$/", $page->template)) ? $page->template : "{$page->template}.tpl";
700  $pageView = new ComponentPageView($page, $page_template);
701 
702  $page_role = $page->role;
703 
704  if (!checkRole($page->role))
705  {
707  redirect("/login");
708  }
709 
710  echo $pageView->drawView();
711 
712  $continue = false;
713  }
714  catch(DataNotFoundException $e)
715  {
716 
717  }
718 
719  return $identifier;
720  }
721 
723  {
724  $pages = Query::create(ComponentPage, "ORDER BY identifier")->execute();
725 
726  $items["Component Pages"] = $pages;
727  return $items;
728  }
729 
730  static function deleteRole($del_role)
731  {
732  $constraint = "WHERE role like '%$del_role%'";
733  $componentPages = Query::create(ComponentPage, $constraint)->execute();
734 
735  RoleManager::deleteRoleFromString($componentPages, $del_role);
736 
737  return $del_role;
738 
739  }
740 
741  static function setComponentVersion($component_name)
742  {
743  $components = Query::create(Component, "WHERE name=:component_name")
744  ->bind(":component_name", $component_name)
745  ->execute();
746 
747  if(count($components) == 0)
748  return;
749 
750  $component = $components[0];
751 
752  $latest_version = ComponentUpdateLog::getLatestVersion($component_name);
753 
754  // To do - set inital values in table for existing components to start
755 
756  if($latest_version && $latest_version != $component->version)
757  {
758  $component->version = $latest_version;
759  $component->filter = new InclusionFilter("version");
760  $component->save();
761  }
762 
763  }
764 
765  static function upgradeComponent($version)
766  {
768  $mgr->upgrade($version);
769  }
770 
771 
772  static function componentListTabs()
773  {
774  $tabs = array( "Components" => "/admin/components",
775  "Component Pages" => "/admin/component_pages"
776  );
777 
778  $bar = new TabBar("tabs", $tabs, "");
779  $bar->useQueryString = false;
780 
781  return $bar;
782  }
783 
784  static function componentPageTabs($key)
785  {
786  $tabs = array( "Definition" => "/admin/component_page_form",
787  "Modules" => "/admin/component_page_modules");
788 
789  $qs = ($key) ? "component_page_id=$key" : "";
790  $bar = new TabBar("tabs", $tabs, $qs);
791 
792  return $bar;
793  }
794 
795  static function componentFormTabs($key)
796  {
797  $tabs = array( "Definition" => "/admin/component_form",
798  "Component Pages" => "/admin/component_pages",
799  "Version History" => "/admin/component_versions"
800  );
801 
802  $qs = ($key) ? "component_id=$key" : "";
803  $bar = new TabBar("tabs", $tabs, $qs);
804 
805  return $bar;
806  }
807 
808  static function setDefaults()
809  {
810  trace("ComponentManager::setDefaults", 3);
811  global $config;
812 
813  $defaultPath = $config['uploadbase'] . DIRECTORY_SEPARATOR . "upgrade_output_path";
814  if (!file_exists($defaultPath)) mkdir($defaultPath);
815 
816  Settings::setDefaultValue("component", "upgrade_output_path", $defaultPath, "String");
817  Settings::setDefaultValue("settings", "enable_inline_editing", false, "Boolean", "Turns on or off inline editing capabilities (for those components that support this option)", "General");
818  Settings::setDefaultPermission("settings", "editor_roles", "Roles for whom inline editing controls are to be shown", "admin");
819  }
820 
827  static function getComponentSignature()
828  {
829  $str = "";
830 
832  foreach($components as $component)
833  {
835  $str .= $component->name.":".$version."|";
836  }
837 
838  return sha1($str);
839  }
840 
841 }
842 
844 ?>
$constraint
$tabs
$event
Definition: event_form.inc:46
$handler
Definition: event_form.inc:62
$page
Definition: help.inc:39
$component
Definition: help.inc:38
$out
Definition: page.inc:66
if(! $page) $path
Definition: page.inc:57
$components
Definition: tree.inc:41
$file
Definition: delete.inc:47
$f
Definition: download.inc:46
$name
Definition: upload.inc:54
ComponentManager provides the core functionality for building the component map describing the applic...
static displayPage($identifier, &$continue)
scan($verbosity=0)
Scans the application home directory and PHP include path and builds the component and administration...
static componentPageTabs($key)
static $verbosityLevel
Verbosity level for component scan (same as trace level)
static deleteRole($del_role)
dispatchAction($process=null)
Dispatch an incoming user action to the appropriate component handler script.
static fireEvent($event, $parameter=null, $mustBeConsumed=false)
Fire an event to all subscribers as detailed in their manifests.
static getEventHandlers()
Retrieve the event handler map.
static upgradeComponent($version)
scanAdminPages($component)
Builds the administration page map for the specified component.
dispatchLocalAction($action, $process=null)
static getComponentSignature()
Retrieves a unique signature for the application's enabled components, based on their installed versi...
static compareByPriority($item1, $item2)
Priority comparison callback - not for external use.
static componentFormTabs($key)
static scanTrace($message, $level)
getComponent($component)
Retrieve the component definition record for the specified component.
static setComponentVersion($component_name)
static findComponentPath($name)
Locate the component path for the named component using the standard precedence rules.
static enumerateComponentPages($items)
ComponentManager()
Creates a new ComponentManager object.
static $plainOutput
Set to true for plain text output during component scan.
scanComponents($root, $subdir)
Scan the specified root and sub-directory for components.
scanComponentPages($component)
Scan and build the compoment page map for the specified component.
static fireEventTo($event, $component, $parameter=null)
Fire an event to the specificed component.
static findByIdentifier($identifier, $constraint="")
ComponentPageView generates the page content for a component page, substituting page fields,...
static getLatestVersion($component)
FakoliEarlyExit is an internal exception class used to provide for controlled early exits during page...
Definition: core.inc:62
FakoliEventNotConsumed is thrown when no subscriber has handled an event that was fired with $mustBeC...
Definition: core.inc:69
FakoliException is the base exception class for all Fakoli errors.
Definition: core.inc:53
static coreTraceLevel()
Change to the configured trace level for Fakoli core code.
Definition: core.inc:1346
static getComponents()
Retrieve an array of all the currently enabled components, indexed by component name.
Definition: core.inc:206
static applicationTraceLevel()
Change to the configured trace level for application code.
Definition: core.inc:1338
static using()
Import the datamodels, views and manifest for the specified component(s).
Definition: core.inc:116
static getComponentClassRoot($name)
Retrieves the capitalized camlCase name for the specified component.
Definition: core.inc:752
static $scanning
Semaphore indicating that a component scan is in progress.
Definition: core.inc:82
static storeRedirectPage()
Store the page from which a user has been redirected when prompted to login or create an account.
Definition: login.inc:493
static deleteRoleFromString(&$items, $del_role, $field="")
static setDefaultValue($component, $name, $value, $field_type="String", $annotation="", $category="", $options="", $weight=0)
Sets the default value of the given component setting.
Definition: settings.inc:174
static setDefaultPermission($component, $name, $annotation, $value, $weight=0)
Set a default Permission value indicating which SiteRoles have the given permission.
Definition: settings.inc:230
global $user
if(!checkRole("admin") && $_SERVER["REMOTE_ADDR"] !=$_SERVER["SERVER_ADDR"] && $_SERVER["REMOTE_ADDR"] !=gethostbyname($config['http_host']) && $_SERVER["REMOTE_ADDR"] !="127.0.0.1") if($_SERVER["REMOTE_ADDR"]=="127.0.0.1" &&array_key_exists("clear", $_GET)) $verbosity
Definition: scan.inc:49
$method
Pull out a simple reference to the request method.
Definition: core.inc:1573
if($config["default_content_type"]) $isAction
Definition: core.inc:1584
if(!checkRole("admin")) $c
$root
if(!checkRole($library->allow_access) &&! $library->allowAccess()) if(!checkRole($document->allow_access)) $d
Definition: download.inc:66
$eventMap
Definition: event_map.inc:9
$output
Definition: generate.inc:9
global $config
Definition: import.inc:4
$message
Definition: mail_to.inc:49
$pages
Definition: export.inc:38
$identifier
Definition: rss.inc:37
$process
Definition: run.php:54
$action
Definition: run.php:41
$uri
Definition: tearoff.inc:4