if ($active == 1) {
// Run embeded SQL commands
EXTENSION_RUN_SQLS($id, "remove");
-
- // Delete this extension (remember to remove it from your server *before* you click on welcome!
- $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_extensions WHERE id=%d LIMIT 1",
- array($id), __FILE__, __LINE__);
} // END - if
} // END - foreach
} elseif (!empty($_GET['do']) && (!IS_DEMO())) {
// ... so we can finally register and load it in registration mode
$status = EXTENSION_REGISTER($ext_name, $id);
if ($status == true) {
- // Is this sql_patches? Then we need to auto-logout!
- if ($ext_name == "sql_patches") {
- // Auto-logout here
- LOAD_URL("modules.php?module=admin&logout=1&install=sql_patches");
- }
-
// Extension was found and successfully registered
LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_EXTENSION_REGISTERED);
// Do we need to update cache file?
if ((EXT_IS_ACTIVE("cache")) && ($cacheMode != "no")) {
// Remove cache file (will be auto-created again!)
+ if ($cacheInstance->cache_file("config" , true)) $cacheInstance->cache_destroy();
if ($cacheInstance->cache_file("extensions", true)) $cacheInstance->cache_destroy();
+ if ($cacheInstance->cache_file("mod_reg" , true)) $cacheInstance->cache_destroy();
}
+ } elseif (GET_EXT_VERSION($ext_name) != "") {
+ // Motify the admin that we have a problem here...
+ LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_REG_FAILED_ALREADY);
} else {
// Motify the admin that we have a problem here...
LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_REG_FAILED_404);