Allow plugins to hook in under other name
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 14 Oct 2006 15:15:52 +0000 (15:15 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 14 Oct 2006 15:15:52 +0000 (15:15 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11915 7612ce4b-ef26-0410-bec9-ea0150e637f0

config/conf.pl

index 38e29299466b2a9407cb4f60b98db6beda9d2f52..8f75be145bb66c517d745a82a3337f3c4b1028e6 100755 (executable)
@@ -5149,15 +5149,22 @@ PLUGIN: for ( $ct = 0 ; $ct <= $#plugins ; $ct++ ) {
                     if ( $options[0] =~ /^squirrelmail_plugin_hooks\s*\[\s*['"]([a-z0-9._-]+)['"]\s*\]\s*\[\s*['"]([0-9a-z._-]+)['"]\s*\]/i ) {
                         $hook_name = $1;
                         $hooked_plugin_name = $2;
-# FIXME: what to do with this?  shouldn't ever be necessary, but...
-if ($hooked_plugin_name ne $plugins[$ct]) {
-    print "ummmm, plugin is tring to hook in under different name....  what do we do with this???\n";
-}
+                        # Note: if we wanted to stop plugins from registering
+                        #       a *different* plugin on a hook, we could catch
+                        #       it here, however this has actually proven to be
+                        #       a useful *feature*
+                        #if ($hooked_plugin_name ne $plugins[$ct]) {
+                        #    print "...plugin is tring to hook in under different name...\n";
+                        #}
 
 #FIXME: do we want to count the number of hook registrations for each plugin and warn if a plugin doesn't have any?
                         # hook registration has been found!
                         if ($verbose) {
-                            print "   registering on hook \"" . $hook_name . "\"\n";
+                            if ($hooked_plugin_name ne $plugins[$ct]) {
+                                print "   registering on hook \"" . $hook_name . "\" (as \"$hooked_plugin_name\" plugin)\n";
+                            } else {
+                                print "   registering on hook \"" . $hook_name . "\"\n";
+                            }
                         }
                         $line =~ s/ {2,}/ /g;
                         $line =~ s/=/\n    =/;