]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions/ext-repair.php
All database names are now 'back-ticked' and constant _MYSQL_PREFIX is wrapped. Partl...
[mailer.git] / inc / extensions / ext-repair.php
index 56f3b685635cafd32196905c7a0e498d1b6e0f4f..b2172e4c5305f36a5648023f752962254c51ca99 100644 (file)
@@ -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,15 +48,15 @@ $EXT_VER_HISTORY = array("0.0", "0.1", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.
 
 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[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, sort, descr) VALUES ('repair', NULL, 'Reperaturen', '7', 'Repariert u.a. die Kategorie-Auswahlen der Mitglieder usw.')";
-       $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, sort, descr) VALUES ('repair', 'repair_cats', 'Kategorieauswahlen', '1', 'Repariert die Kategorieauswahlen Ihrer Mitglieder.')";
+       $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('repair', NULL, 'Reperaturen','7','Repariert u.a. die Kategorie-Auswahlen der Mitglieder usw.')";
+       $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('repair','repair_cats','Kategorieauswahlen','1','Repariert die Kategorieauswahlen Ihrer Mitglieder.')";
        break;
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
-       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='repair' LIMIT 5";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_admin_menu` WHERE action='repair' LIMIT 5";
        break;
 
 case "activate": // Do stuff when admin activates this extension
@@ -74,9 +73,9 @@ case "update": // Update an extension
        switch ($EXT_VER)
        {
        case "0.1": // SQL queries for v0.1
-               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, sort, descr) VALUES ('repair', 'repair_amenu', 'Admin-Menü', 2, 'Repariert die Gewichtung des Admin-Menü-Systems')";
-               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, sort, descr) VALUES ('repair', 'repair_gmenu', 'Gast-Menü', 3, 'Repariert die Gewichtung des Gäste-Menü-Systems')";
-               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, sort, descr) VALUES ('repair', 'repair_mmenu', 'Mitglied-Menü', 4, 'Repariert die Gewichtung des Mitglieder-Menü-Systems')";
+               $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('repair','repair_amenu','Admin-Menü', 2, 'Repariert die Gewichtung des Admin-Menü-Systems')";
+               $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('repair','repair_gmenu','Gast-Menü', 3, 'Repariert die Gewichtung des Gäste-Menü-Systems')";
+               $SQLs[] = "INSERT INTO `{!MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('repair','repair_mmenu','Mitglied-Menü', 4, 'Repariert die Gewichtung des Mitglieder-Menü-Systems')";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Fügt ein Menüpunkt zur Reperatur der Gewichtung des Admin-Menüs hinzu.";
@@ -89,16 +88,12 @@ case "update": // Update an extension
 
        case "0.1.2": // SQL queries for v0.1.2
                // Update notes (these will be set as task text!)
-               $UPDATE_NOTES = "Seit <A href=\"".SERVER_URL."/patches/340-Gast_Mitgliedsmenue_Deaktivieren.zip\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
+               $UPDATE_NOTES = "Seit <a href=\"#\">Patch 340</a> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
                break;
 
        case "0.1.3": // SQL queries for v0.1.3
-               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET what='repair_amnu' WHERE what='repair_amenu' LIMIT 1";
-               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET what='repair_gmnu' WHERE what='repair_gmenu' LIMIT 1";
-               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET what='repair_mmnu' WHERE what='repair_mmenu' LIMIT 1";
-
                // Update notes (these will be set as task text!)
-               $UPDATE_NOTES = "Konflikt mit Men&uuml;-Erweiterung und dieser behoben. Dateien what-repair_*menu.php sind <U>obsulete</U> (veraltet, bitte l&ouml;schen!)";
+               $UPDATE_NOTES = "Ung&uuml;tiges Update nach neuster Konvention (Erweiterung <strong>menu</strong> ist ung&uum;ltig).";
                break;
 
        case "0.1.4": // SQL queries for v0.1.4
@@ -113,14 +108,12 @@ 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
        break;
 }
-// Language file prefix
-$EXT_LANG_PREFIX = "repair";
-
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
 
 //
 ?>