X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fextensions%2Fext-rewrite.php;h=61f3ab1a18f9abe1b4dad6dab4bb46776a2c9ee6;hb=4ccc02299e123d24c043c917fb16208d0338f300;hp=fc04a655f121b1d32378b5546b37bc25820289b0;hpb=143e78d4231adddd9e706cbf55ec5dd8c1651890;p=mailer.git
diff --git a/inc/extensions/ext-rewrite.php b/inc/extensions/ext-rewrite.php
index fc04a655f1..61f3ab1a18 100644
--- a/inc/extensions/ext-rewrite.php
+++ b/inc/extensions/ext-rewrite.php
@@ -10,7 +10,12 @@
* -------------------------------------------------------------------- *
* Kurzbeschreibung : Schreibt eigene Links um fuer Suchmaschinen *
* -------------------------------------------------------------------- *
- * *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * Needs to be in all Files and every File needs "svn propset *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2008 by Roland Haeder *
* For more information visit: http://www.mxchange.org *
@@ -33,116 +38,143 @@
// Some security stuff...
if (!defined('__SECURITY')) {
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+ $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
require($INC);
}
// Version number
-$EXT_VERSION = "0.1.2";
+EXT_SET_VERSION('0.1.3');
-// Auto-set extension version
-if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+// Version history array (add more with , '0.1.0' and so on)
+EXT_SET_VER_HISTORY(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2', '0.1.3'));
-// Version history array (add more with , "0.1" and so on)
-$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2");
+// This extension is deprecated!
+// Only since 'seo' is ready! EXT_SET_DEPRECATED('Y');
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[] = "";
- break;
-
-case "remove": // Do stuff when removing extension
- // SQL commands to run
- $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='config_rewrite' LIMIT 1";
- break;
-
-case "activate": // Do stuff when admin activates this extension
- // SQL commands to run
- $SQLs[] = "";
- break;
-
-case "deactivate": // Do stuff when admin deactivates this extension
- // SQL commands to run
- $SQLs[] = "";
- break;
-
-case "update": // Update an extension
- switch ($EXT_VER)
- {
- case "0.0.1": // SQL queries for v0.0.1
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Folgende Linkvariablen werden nun auch ausgetauscht: bid, mid, url, page, offset";
- break;
-
- case "0.0.2": // SQL queries for v0.0.2
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Folgende Linkvariablen werden nun auch ausgetauscht: type, do=search";
-
- case "0.0.3": // SQL queries for v0.0.3
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "URLs zu MXChange.org (".SERVER_URL.") sind nun auch wieder gültig.";
- break;
-
- case "0.0.4": // SQL queries for v0.0.4
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Folgende Linkvariablen werden nun auch ausgetausch: sub, home";
- break;
-
- case "0.0.5": // SQL queries for v0.0.5
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Links im Admin- und Mitgliedsbereich werden nicht mehr umgeschrieben. Entsprechend fällt die neue .htaccess-Datei kleiner aus. Bitte anpassen!";
-
- case "0.0.6": // SQL queries for v0.0.6
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Links im Frametester-Modul werden nicht mehr umgeschrieben.";
- break;
-
- case "0.0.7": // SQL queries for v0.0.7
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+ case 'register': // Do stuff when installation is running (modules.php?module=admin&action=login is called)
+ // Check if mod_rewrite is loadeded
+ if (!isApacheModuleLoaded('mod_rewrite')){
+ EXT_SET_REPORTS_FAILURE(true);
+ addFatalMessage(__FILE__, __LINE__, getMessage('MOD_REWRITE_ERROR'));
+ } // END - if
+
+ // SQL commands to run
+ ADD_EXT_SQL('');
break;
- case "0.0.8": // SQL queries for v0.0.8
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
+ case 'remove': // Do stuff when removing extension
+ // SQL commands to run
+ ADD_EXT_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_rewrite'");
break;
- case "0.0.9": // SQL queries for v0.0.9
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD rewrite_skip VARCHAR(255) NOT NULL DEFAULT 'login:admin:frametester:mailid'";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_rewrite','Rewrite-Engine','Stellen Sie hier ein, welche Module übersprungen werden sollen, in denen also kein Umschreiben des HTML-Codes stattfinden soll.', 8)";
-
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Zu überspringende Module können per Admin-Bereich eingestellt werden.";
+ case 'activate': // Do stuff when admin activates this extension
+ // Check if mod_rewrite is loadeded
+ if (!isApacheModuleLoaded('mod_rewrite')) {
+ SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET `ext_active`='N' WHERE `ext_name`='rewrite' LIMIT 1", __FILE__, __LINE__);
+ EXT_SET_REPORTS_FAILURE(true);
+ addFatalMessage(__FILE__, __LINE__, getMessage('MOD_REWRITE_ERROR'));
+ } // END - if
+
+ // SQL commands to run
+ ADD_EXT_SQL('');
+ break;
+
+ case 'deactivate': // Do stuff when admin deactivates this extension
+ // SQL commands to run
+ ADD_EXT_SQL('');
break;
- case "0.1.0": // SQL queries for v0.2.1
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Wörter Mailtausch, Mailtausches und Mailtauscher sind austauschbar.";
+ case 'update': // Update an extension
+ switch ($EXT_VER)
+ {
+ case '0.0.1': // SQL queries for v0.0.1
+ // Update notes (these will be set as task text!)
+ EXT_SET_UPDATE_NOTES("Folgende Linkvariablen werden nun auch ausgetauscht: bid, mid, url, page, offset");
+ break;
+
+ case '0.0.2': // SQL queries for v0.0.2
+ // Update notes (these will be set as task text!)
+ EXT_SET_UPDATE_NOTES("Folgende Linkvariablen werden nun auch ausgetauscht: type, do=search");
+
+ case '0.0.3': // SQL queries for v0.0.3
+ // Update notes (these will be set as task text!)
+ EXT_SET_UPDATE_NOTES("URLs zu MXChange.org ({!SERVER_URL!}) sind nun auch wieder gültig.");
+ break;
+
+ case '0.0.4': // SQL queries for v0.0.4
+ // Update notes (these will be set as task text!)
+ EXT_SET_UPDATE_NOTES("Folgende Linkvariablen werden nun auch ausgetausch: sub, home");
+ break;
+
+ case '0.0.5': // SQL queries for v0.0.5
+ // Update notes (these will be set as task text!)
+ EXT_SET_UPDATE_NOTES("Links im Admin- und Mitgliedsbereich werden nicht mehr umgeschrieben. Entsprechend fällt die neue .htaccess-Datei kleiner aus. Bitte anpassen!");
+
+ case '0.0.6': // SQL queries for v0.0.6
+ // Update notes (these will be set as task text!)
+ EXT_SET_UPDATE_NOTES("Links im Frametester-Modul werden nicht mehr umgeschrieben.");
+ break;
+
+ case '0.0.7': // SQL queries for v0.0.7
+ // Update notes (these will be set as task text!)
+ EXT_SET_UPDATE_NOTES("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
+ break;
+
+ case '0.0.8': // SQL queries for v0.0.8
+ // Update notes (these will be set as task text!)
+ EXT_SET_UPDATE_NOTES("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
+ break;
+
+ case '0.0.9': // SQL queries for v0.0.9
+ ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD rewrite_skip VARCHAR(255) NOT NULL DEFAULT 'login:admin:frametester:mailid'");
+ ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('setup','config_rewrite','Rewrite-Engine','Stellen Sie hier ein, welche Module übersprungen werden sollen, in denen also kein Umschreiben des HTML-Codes stattfinden soll.', 8)");
+
+ // Update notes (these will be set as task text!)
+ EXT_SET_UPDATE_NOTES("Zu überspringende Module können per Admin-Bereich eingestellt werden.");
+ break;
+
+ case '0.1.0': // SQL queries for v0.2.1
+ // Update notes (these will be set as task text!)
+ EXT_SET_UPDATE_NOTES("Wörter Mailtausch, Mailtausches und Mailtauscher sind austauschbar.");
+ break;
+
+ case '0.1.1': // SQL queries for v0.1.1
+ // Update notes (these will be set as task text!)
+ EXT_SET_UPDATE_NOTES("HTML-Code ausgelagert in Templates und SQL-Anweisungen abgesichert.");
+ break;
+
+ case '0.1.2': // SQL queries for v0.1.2
+ // Update notes (these will be set as task text!)
+ EXT_SET_UPDATE_NOTES("Abspeichern von Einstellungen repariert.");
+ break;
+ case '0.1.3':
+ // Check if mod_rewrite is loadeded
+ if (!isApacheModuleLoaded('mod_rewrite')){
+ EXT_SET_REPORTS_FAILURE(true);
+ //addFatalMessage(__FILE__, __LINE__, getMessage('MOD_REWRITE_ERROR'));
+ } // END - if
+ EXT_SET_UPDATE_NOTES("Es wird beim Registrieren und aktivieren geprüft, ob im Apache das Modul mod_rewrite geladen wurde. Wenn mod_rewrite nicht gefunden werden konnte, wird abgebrochen.");
+ break;
+ }
break;
- case "0.1.1": // SQL queries for v0.1.1
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "HTML-Code ausgelagert in Templates und SQL-Anweisungen abgesichert.";
- break;
+ case 'modify': // When the extension got modified
+ break;
- case "0.1.2": // SQL queries for v0.1.2
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
- 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;
+ default: // Do stuff when extension is loaded
+ // Check if mod_rewrite is loadeded
+ if (!isApacheModuleLoaded('mod_rewrite')){
+ EXT_SET_REPORTS_FAILURE(true);
+ SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET `ext_active`='N' WHERE `ext_name`='rewrite' LIMIT 1", __FILE__, __LINE__);
+ if (!IS_ADMIN()) addFatalMessage(__FILE__, __LINE__, getMessage('MOD_REWRITE_ERROR'));
+ } // END - if
+ break;
}
-// Language file prefix
-$EXT_LANG_PREFIX = "rewrite";
-
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
-
//
?>