Security line in all includes changed
[mailer.git] / inc / extensions.php
index c7d794ada47167ae081470ed02337af3dd84d39d..969d8617098e9d2986b63d28b083e9a2e63f6721 100644 (file)
  ************************************************************************/
 
 // Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
+
 //
 function EXTENSION_REGISTER ($ext_name, $id, $dry_run=false)
 {
@@ -200,6 +200,9 @@ function EXTENSION_REGISTER ($ext_name, $id, $dry_run=false)
                                // Update task management
                                ADMIN_SOLVE_TASK($id);
 
+                               // @TODO This causes the whole (!) menu cache being purged
+                               CACHE_PURGE_ADMIN_MENU();
+
                                // In normal mode return a true on success
                                $ret = true;
 
@@ -302,6 +305,9 @@ function EXTENSION_RUN_SQLS($id, $EXT_LOAD_MODE) {
                        if ($cacheInstance->cache_file("extensions", true)) $cacheInstance->cache_destroy();
                        if ($cacheInstance->cache_file("mod_reg", true))    $cacheInstance->cache_destroy();
                        if ($cacheInstance->cache_file("config", true))     $cacheInstance->cache_destroy();
+
+                       // @TODO This causes the whole (!) menu cache being purged
+                       CACHE_PURGE_ADMIN_MENU();
                } // END - if
 
                // Is this the sql_patches?