[evolvis-commits] r17643: [#2030] theme-evolvis pending merges:↵ Thorsten Glaser 2011-10-26 check for plugins listening on disallowed hooks (quota_*_project_admin, u...

mirabilos at evolvis.org mirabilos at evolvis.org
Wed Oct 26 15:36:05 CEST 2011


Author: mirabilos
Date: 2011-10-26 15:36:05 +0200 (Wed, 26 Oct 2011)
New Revision: 17643

Modified:
   trunk/gforge_base/evolvisforge-5.1/src/common/include/PluginManager.class.php
Log:
[#2030] theme-evolvis pending merges:
  Thorsten Glaser 2011-10-26 check for plugins listening on disallowed hooks (quota_*_project_admin, u...


Modified: trunk/gforge_base/evolvisforge-5.1/src/common/include/PluginManager.class.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/common/include/PluginManager.class.php	2011-10-26 13:36:00 UTC (rev 17642)
+++ trunk/gforge_base/evolvisforge-5.1/src/common/include/PluginManager.class.php	2011-10-26 13:36:05 UTC (rev 17643)
@@ -26,6 +26,12 @@
 	var $hooks_to_plugins ;
 	var $returned_value = array();
 
+	var $disallowed_hooks = array(
+		'quota_label_project_admin',
+		'quota_link_project_admin',
+		'usermenu',
+	    );
+
 	/**
 	 * PluginManager() - constructor
 	 *
@@ -200,6 +206,11 @@
 				if (!isset ($this->hooks_to_plugins[$hook_name])) {
 					$this->hooks_to_plugins[$hook_name] = array () ;
 				}
+				if (in_array($hook_name, $this->disallowed_hooks)) {
+					ffDebug('error', 'plugin "' . $p_name .
+					    '" listens on disallowed hook "' .
+					    $hook_name . '"; please fix!', '');
+				}
 				$this->hooks_to_plugins[$hook_name][] = $p_name ;
 			}
 		}



More information about the evolvis-commits mailing list