X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fextensions%2Fext-maintenance.php;h=e8990bd30329b7172e407490d819314284d95217;hb=ab92fb7241d00636b0eb940f147449758820cba1;hp=32e7bba2e37347779b0310b7b700451f75264a59;hpb=a99e7f59b96a57db7a2b891d111f4168155433e1;p=mailer.git
diff --git a/inc/extensions/ext-maintenance.php b/inc/extensions/ext-maintenance.php
index 32e7bba2e3..e8990bd303 100644
--- a/inc/extensions/ext-maintenance.php
+++ b/inc/extensions/ext-maintenance.php
@@ -32,8 +32,7 @@
************************************************************************/
// 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);
}
@@ -49,19 +48,15 @@ $EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.
switch ($EXT_LOAD_MODE)
{
-case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called)
// SQL commands to run
- $SQLs[] = "alter table "._MYSQL_PREFIX."_config add maintenance enum('Y', 'N') not null default 'N';";
- if (SQL_NUMROWS(SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_admin_menu WHERE what='maintenance' LIMIT 1", __FILE__, __LINE__)) == 0)
- {
- // Insert menu only when not exists
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, descr, sort) VALUES('setup', 'maintenance', 'Wartungsmodus', 'Schalten Sie den Wartungsmodus ein, nur wenn sehr schwerwiegende Fehler vorliegen, die Sie oder mxchange.org nicht schenll genug beheben können.', '10')";
- }
+ $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD maintenance ENUM('Y','N') NOT NULL DEFAULT 'N';";
+ $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','maintenance','Wartungsmodus','Schalten Sie den Wartungsmodus ein, nur wenn sehr schwerwiegende Fehler vorliegen, die Sie oder mxchange.org nicht schenll genug beheben können.','10')";
break;
case "remove": // Do stuff when removing extension
// SQL commands to run
- $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='maintenance' LIMIT 1";
+ $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='maintenance' LIMIT 1";
break;
case "activate": // Do stuff when admin activates this extension
@@ -94,7 +89,7 @@ case "update": // Update an extension
case "0.0.4": // SQL queries for v0.0.4
// Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Seit Patch 340 überflüssige HTML-Tags entfernt.";
+ $UPDATE_NOTES = "Seit Patch 340 überflüssige HTML-Tags entfernt.";
break;
case "0.0.5": // SQL queries for v0.0.5
@@ -109,17 +104,15 @@ case "update": // Update an extension
}
break;
+case "test": // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
+ break;
+
default: // Do stuff when extension is loaded
- $dummy = LOAD_CONFIG();
- $_CONFIG['maintenance'] = $dummy['maintenance'];
- unset($dummy);
break;
}
-// Language file prefix
-$EXT_LANG_PREFIX = "maintenance";
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = 'Y';
+// Keep this extension always active!
+$EXT_ALWAYS_ACTIVE = "Y";
//
?>