<?php
/************************************************************************
- * MXChange v0.2.1 Start: 04/29/2004 *
- * ================ Last change: 10/29/2004 *
+ * Mailer v0.2.1-FINAL Start: 04/29/2004 *
+ * =================== Last change: 10/29/2004 *
* *
* -------------------------------------------------------------------- *
* File : ext-user.php *
* -------------------------------------------------------------------- *
* Kurzbeschreibung : Ausgelagertes Mitglieder-Management *
* -------------------------------------------------------------------- *
- * *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
* -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder *
- * For more information visit: http://www.mxchange.org *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team *
+ * For more information visit: http://mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
************************************************************************/
// Some security stuff...
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])))
-{
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
- require($INC);
-}
+if (!defined('__SECURITY')) {
+ die();
+} // END - if
// Version number
-$EXT_VERSION = "0.3.3";
-
-// Version history array (add more with , "0.1" and so on)
-$EXT_VER_HISTORY = array("0.0", "0.1", "0.1.1", "0.1.2", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3");
-
-switch ($EXT_LOAD_MODE)
-{
-case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
- // SQL commands to run
- $SQLs[] = "";
-
- // Load CSS-File?
- $EXT_CSS = 'Y';
- break;
-
-case "remove": // Do stuff when removing extension
- // SQL commands to run
- $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='config_user' OR what='user_contct' LIMIT 2";
- break;
-
-case "activate": // Do stuff when admin activates this extension
- // SQL commands to run
- $SQLs[] = "";
- break;
+setThisExtensionVersion('0.6.0');
-case "deactivate": // Do stuff when admin deactivates this extension
- // SQL commands to run
- $SQLs[] = "";
- break;
+// Version history array (add more with , '0.0.1' and so on)
+setExtensionVersionHistory(array('0.0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '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'));
-case "update": // Update an extension
- switch ($EXT_VER)
- {
- case "0.1": // SQL queries for v0.1
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD user_limit int(7) not null default '20'";
+// Keep this extension always active!
+setExtensionAlwaysActive('Y');
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Seitenweises Anzeigen der User-Liste ist nun möglich.";
+switch (getExtensionMode()) {
+ case 'setup': // Do stuff when installation is running
+ // This has been moved to inc/extensions/user/mode-setup.php
break;
- case "0.1.1": // SQL queries for v0.1.1
- $SQLs[] = "UPDATE "._MYSQL_PREFIX."_extensions SET ext_has_css='Y' WHERE ext_name='user' AND ext_has_css='N' LIMIT 1";
-
- // This update depends on sql_patches update!
- $EXT_UPDATE_DEPENDS = "sql_patches";
-
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "CSS-Datei kann per Admin-Bereich ein- und ausgeschaltet werden.";
-
- case "0.1.2": // SQL queries for v0.1.2
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD mails_confirmed bigint(20) not null default '0'";
-
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Dem Mitglied wird nun angezeigt, wie viele Mails er bestätigt hat. Alle vor dieser Version best. Mails werden leider nicht mehr berücksichtigt! Bitte teilen Sie dies Ihren Mitgliedern mit.";
+ case 'remove': // Do stuff when removing extension
+ // This has been moved to inc/extensions/user/mode-remove.php
break;
- case "0.1.3": // SQL queries for v0.1.3
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Den Pfad <I>Sie sind hier</I> im Menüpunkt <U>Online-Liste</U> erweitert.";
+ case 'activate': // Do stuff when admin activates this extension
+ // SQL commands to run
+ addExtensionSql('');
break;
- case "0.1.4": // SQL queries for v0.1.4
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD emails_received bigint(20) not null default '0'";
-
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Anzahl empfangener Mails wird angezeigt. <BIG>Diese Anzeige kann fehlerhaft sein, wenn Sie bereits Mitglieder in Ihrem {!MT_WORD!} haben sollen!</BIG>";
+ case 'deactivate': // Do stuff when admin deactivates this extension
+ // SQL commands to run
+ addExtensionSql('');
break;
- case "0.1.5": // SQL queries for v0.1.5
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+ case 'update': // Update an extension
+ // This has been moved to inc/extensions/user/mode-update.php
break;
- case "0.1.6": // SQL queries for v0.1.6
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+ case 'modify': // When the extension got modified
break;
- case "0.1.7": // SQL queries for v0.1.7
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Erweiterung bleibt wegen integrierten Schalters immer aktiv.";
- break;
-
- case "0.1.8": // SQL queries for v0.1.8
- // 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> überflüssige HTML-Tags entfernt.";
- break;
-
- case "0.1.9": // SQL queries for v0.1.9
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Link zum Mitgliedsprofil in Funktion <U>ADMIN_USER_PROFILE_LINK()</U> ausgelagert.";
- break;
-
- case "0.2.0": // SQL queries for v0.2.0
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "User-Liste ausgelagert in Templates und überbreite Zeile in 2er-Zeile umgewandelt.";
- break;
-
- case "0.2.1": // SQL queries for v0.2.1
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD user_alpha tinyint(4) not null default '10'";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, descr, sort) VALUES('setup', 'config_user', 'Mitgliederliste', 'Anzahl Mitglieder pro Seite, Anzahl Buchstaben pro Zeile usw.', 8)";
-
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "User-Liste ist konfigurierbar: Anzahl Mitglieder pro Seite und Anzahl Buchstaben pro Zeile; Template-Fehler beseitigt.";
- break;
-
- case "0.2.2": // SQL queries for v0.2.2
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data CHANGE sex sex enum('M', 'F', 'C') not null default 'M'";
-
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Anrede "Firma" hinzugefügt.";
+ case 'test': // For testing purposes
break;
- case "0.2.3": // SQL queries for v0.2.3
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Datumsformat festgelegt auf ausführlich.";
+ case 'init': // Do stuff when extension is initialized
break;
- case "0.2.4": // SQL queries for v0.2.4
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Wörter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.";
+ default: // Unknown extension mode
+ reportBug(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));
break;
+} // END - switch
- case "0.2.5": // SQL queries for v0.2.5
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "SQL-Anweisungen abgesichert.";
- break;
-
- case "0.2.6": // SQL queries for v0.2.6
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
- break;
-
- case "0.2.7": // SQL queries for v0.2.7
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Sicherheitsupdate für die Include-Befehle.";
- break;
-
- case "0.2.8": // SQL queries for v0.2.8
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "if-Anweisungen auf Funktion <STRONG>empty()</STRONG> umgestellt.";
- break;
-
- case "0.2.9": // SQL queries for v0.2.9
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, descr, sort) VALUES('user', 'user_contct', 'Mitglied kontaktieren', 'Kontaktieren Sie hier Ihre Mitglieder ganz direkt über ein Webformular. Sie brauchen somit kein EMail-Programm mehr starten!', 8)";
-
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Admin-Kontaktformular hinzugefügt.";
- break;
-
- case "0.3.0": // SQL queries for v0.3.0
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Hash-Erstellung von <STRONG>md5()</STRONG> auf bessere Funktion <STRONG>generateHash()</STRONG> umgestellt.<br />Diverse Fixes für <em>0.2.1-Beta1</em> Release.";
- break;
-
- case "0.3.1": // SQL queries for v0.3.1
- $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Mitglieder-Management' WHERE action = 'user' AND what='' LIMIT 1";
-
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Verwaltung auf Management umgestellt";
- break;
-
- case "0.3.2": // SQL queries for v0.3.2
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "PHP-Hinweis in Userauflistung gefixt (trat bei fehlender nickname-Erweiterung auf) und Darstellungsfehler von <strong>0.00000</strong> unbestätigten Mails gefixt.";
- break;
-
- case "0.3.3": // SQL queries for v0.3.3
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Mitglieder sind nun per Formular kontaktierbar (es wird eine EMail versendet), gesperrte und bestätigte Mitglieder-Accounts sind seperat oder gemeinsam auflistbar (seperat nur mit der Erweiterung <em>task</em>!)";
- break;
- }
- break;
-
-default: // Do stuff when extension is loaded
- $DUMMY = LOAD_CONFIG("0");
- $_CONFIG['user_limit'] = $DUMMY['user_limit'];
- $_CONFIG['user_alpha'] = $DUMMY['user_alpha'];
- unset($DUMMY);
- break;
-}
-// Language file prefix
-$EXT_LANG_PREFIX = "user";
-
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = 'Y';
-
-//
+// [EOF]
?>