Some typos fixed
[mailer.git] / inc / extensions / ext-admins.php
index 2e3777df55f8f6d1efb550148a7cdb82fda82379..25d50767aea348304920e4b1143867a8077e336b 100644 (file)
@@ -38,19 +38,18 @@ if (!defined('__SECURITY')) {
 }
 
 // Version of this extension
-$EXT_VERSION = "0.7.0";
+$EXT_VERSION = "0.7.2";
 
 // Auto-set extension version
 if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
 
 // Version history array (add more with , "0.1" and so on)
-$EXT_VER_HISTORY = array("0.0", "0.1", "0.2", "0.3", "0.3.1", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4", "0.4.5", "0.4.6", "0.4.7", "0.4.8", "0.4.9", "0.5.0", "0.5.1", "0.5.2", "0.5.3", "0.5.4", "0.5.5", "0.5.6", "0.5.7", "0.5.8", "0.5.9", "0.6.0", "0.6.1", "0.6.2", "0.6.3", "0.6.4", "0.6.5", "0.6.6", "0.6.7", "0.6.8", "0.6.9", "0.7.0");
+$EXT_VER_HISTORY = array("0.0", "0.1", "0.2", "0.3", "0.3.1", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4", "0.4.5", "0.4.6", "0.4.7", "0.4.8", "0.4.9", "0.5.0", "0.5.1", "0.5.2", "0.5.3", "0.5.4", "0.5.5", "0.5.6", "0.5.7", "0.5.8", "0.5.9", "0.6.0", "0.6.1", "0.6.2", "0.6.3", "0.6.4", "0.6.5", "0.6.6", "0.6.7", "0.6.8", "0.6.9", "0.7.0", "0.7.1", "0.7.2");
 
 switch ($EXT_LOAD_MODE)
 {
 case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called)
        // SQL commands to run
-       $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE action='admins' LIMIT 1";
        $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('admins', NULL, 'Admin-Management','Administratoren anlegen, löschen oder Passwort/E-Mail Adresse ändern.','1')";
        $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('admins','admins_add','Admin hinzufügen','Neuen Admin-Account anlegen','0')";
        $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('admins','admins_edit','Admin-Account ändern','Bestehende Admin-Accounts bearbeiten: E-Mail-Adresse, Passwort und/oder Login-Name ändern.','1')";
@@ -58,9 +57,13 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
-       $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE action='admins' LIMIT 5";
-       $SQLs[] = "DROP TABLE "._MYSQL_PREFIX."_admins_acls";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE action='admins' LIMIT 6";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admins_acls";
+       $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_admins_mails";
        $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins DROP default_acl";
+
+       // Remove filters
+       UNREGISTER_FILTER('sql_admin_extra_data', 'ADD_EXTRA_SQL_DATA', true, $dry_run);
        break;
 
 case "activate": // Do stuff when admin activates this extension
@@ -107,7 +110,7 @@ PRIMARY KEY (id)
 ) TYPE=MyISAM";
 
                // Update notes (these will be set as task text!)
-               $UPDATE_NOTES = "Sogn. ACLs werden hinzugef&uuml;gt: <STRONG>A</STRONG>ccess <STRONG>C</STRONG>ontrol <STRONG>L</STRONG>ines sind zu deutsch Zugriffkontrollzeilen, mit denen Sie einstellen k&ouml;nnen, was welcher Admin machen darf oder nicht.";
+               $UPDATE_NOTES = "Sogn. ACLs werden hinzugef&uuml;gt: <strong>A</strong>ccess <strong>C</strong>ontrol <strong>L</strong>ines sind zu deutsch Zugriffkontrollzeilen, mit denen Sie einstellen k&ouml;nnen, was welcher Admin machen darf oder nicht.";
                break;
 
        case "0.3.1": // SQL queries for v0.3.1
@@ -182,7 +185,7 @@ PRIMARY KEY (id)
 
        case "0.5.3": // SQL queries for v0.5.3
                // Update notes (these will be set as task text!)
-               $UPDATE_NOTES = "Seit <A href=\"#\">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.5.4": // SQL queries for v0.5.4
@@ -199,12 +202,12 @@ PRIMARY KEY (id)
                $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_admin_menu` SET what='admins_contct' WHERE what='admins_contact' LIMIT 1";
 
                // Update notes (these will be set as task text!)
-               $UPDATE_NOTES = "Namenskonflikt zwischen den Erweiterungen <STRONG>admins</STRONG> und (kommender) <STRONG>contact</STRONG>.";
+               $UPDATE_NOTES = "Namenskonflikt zwischen den Erweiterungen <strong>admins</strong> und (kommender) <strong>contact</strong>.";
                break;
 
        case "0.5.7": // SQL queries for v0.5.7
                // Update notes (these will be set as task text!)
-               $UPDATE_NOTES = "Links wegen <STRONG>what=admins_contct</STRONG> ge&auml;ndert.";
+               $UPDATE_NOTES = "Links wegen <strong>what=admins_contct</strong> ge&auml;ndert.";
                break;
 
        case "0.5.8": // SQL queries for v0.5.8
@@ -253,19 +256,19 @@ PRIMARY KEY (id)
                $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_admin_menu` SET what='admins_contct' WHERE what='admins_contact' LIMIT 1";
 
                // Update notes (these will be set as task text!)
-               $UPDATE_NOTES = "Namenskonflikt zwischen den Erweiterungen <STRONG>admins</STRONG> und (kommender) <STRONG>contact</STRONG>.";
+               $UPDATE_NOTES = "Namenskonflikt zwischen den Erweiterungen <strong>admins</strong> und (kommender) <strong>contact</strong>.";
                break;
 
        case "0.6.7": // SQL queries for v0.6.7
                $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins ADD la_mode ENUM('global','OLD','NEW') NOT NULL DEFAULT 'global'";
 
                // Update notes (these will be set as task text!)
-               $UPDATE_NOTES = "Namenskonflikt zwischen den Erweiterungen <STRONG>admins</STRONG> und (kommender) <STRONG>contact</STRONG>. Beseitigung eines Fehlers <STRONG>HTTP_POSR_VARS</STRONG> beim &Auml;ndern von Administratoren.";
+               $UPDATE_NOTES = "Namenskonflikt zwischen den Erweiterungen <strong>admins</strong> und (kommender) <strong>contact</strong>. Beseitigung eines Fehlers <strong>HTTP_POSR_VARS</strong> beim &Auml;ndern von Administratoren.";
                break;
 
        case "0.6.8": // SQL queries for v0.6.8
                // Update notes (these will be set as task text!)
-               $UPDATE_NOTES = "<STRONG>set_session()</STRONG> mit @-Zeichen gegen ungewollte Ausgaben abgesichert.";
+               $UPDATE_NOTES = "<strong>set_session()</strong> mit @-Zeichen gegen ungewollte Ausgaben abgesichert.";
                break;
 
        case "0.6.9": // SQL queries for v0.6.9
@@ -276,18 +279,42 @@ PRIMARY KEY (id)
                break;
 
        case "0.7.0": // SQL queries for v0.7.0
-               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins ADD login_failtures BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
-               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins ADD last_failture TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'";
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Veraltetes Update.";
+               break;
+
+       case "0.7.1": // SQL queries for v0.7.1
+               // Update depends on sql_patches
+               $EXT_UPDATE_DEPENDS = "sql_patches";
+
+               // Add filters
+               REGISTER_FILTER('sql_admin_extra_data', 'ADD_EXTRA_SQL_DATA', false, true, $dry_run);
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Filter hinzugef&uuml;gt und ist von <strong>sql_patches</strong> abh&auml;ngig.";
+               break;
+
+       case "0.7.2": // SQL queries for v0.7.2
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins DROP login_failtures";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins DROP last_failture";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins ADD login_failures BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_admins ADD last_failure TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'";
 
                // Update notes (these will be set as task text!)
-               $UPDATE_NOTES = "Fehlgeschlagene Login-Versuche werden nun mitgez&auml;hlt und der letzte vermerkt.";
+               $UPDATE_NOTES = "Schreibweise korregiert.";
                break;
        }
        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;
 }
 
+// Keep this extension always active!
+$EXT_ALWAYS_ACTIVE = "Y";
+
 //
 ?>