define('SERVER_URL', "http://www.mxchange.org");
// This current patch level
-define('CURR_SVN_REVISION', "555");
+define('CURR_SVN_REVISION', "556");
// Take a prime number which is long (if you know a longer one please try it out!)
define('_PRIME', 591623);
function EXTENSION_REGISTER ($ext_name, $id, $dry_run=false)
{
global $NOTES, $_CONFIG, $INC_POOL, $cacheInstance;
+
// We want to register an extension and registration status is by default "failed" (= false)
$EXT_LOAD_MODE = "register"; $ret = false; $SQLs = array();
$INC_POOL = array();
// This shall never do a non-admin user!
if (!IS_ADMIN()) return false;
+ // By default we have no failtures
+ $EXT_REPORTS_FAILURE = true;
+
// Is this extension already installed?
if (EXT_IS_ACTIVE($ext_name)) return false;
// Switch back to register mode
$EXT_LOAD_MODE = "register";
+ // Remains true if extension registration reports no failtures
+ $test = ($test && !$EXT_REPORTS_FAILTURE);
+
// Does everthing before wents ok?
if ($test) {
// "Dry-run-mode" activated?
$SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_rallye_prices";
$SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_rallye_users";
$SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='rallye' LIMIT 4";
- $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_guest_menu WHERE what='rallye' LIMIT 1";
- $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='rallye' LIMIT 1";
+ $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_guest_menu WHERE what='rallyes' LIMIT 1";
+ $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='rallyes' LIMIT 1";
break;
case "activate": // Do stuff when admin activates this extension
case "activate": // Do stuff when admin activates this extension
// SQL commands to run
- $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_member_menu` SET visible='Y' locked='N' WHERE what='refback' LIMIT 1";
+ $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_member_menu` SET visible='Y', locked='N' WHERE what='refback' LIMIT 1";
break;
case "deactivate": // Do stuff when admin deactivates this extension
}
// Version number
-$EXT_VERSION = "0.1.2";
+$EXT_VERSION = "0.1.3";
// 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.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");
+$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", "0.1.3");
switch ($EXT_LOAD_MODE)
{
case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called)
+ // Check if mod_rewrite is loadeded
+ if (!IF_APACHE_MODULE_LOADED('mod_rewrite')){
+ $EXT_REPORTS_FAILURE = true;
+ ADD_FATAL(MOD_REWRITE_ERROR);
+ } // END - if
+
// SQL commands to run
$SQLs[] = "";
break;
break;
case "activate": // Do stuff when admin activates this extension
+ // Check if mod_rewrite is loadeded
+ if (!IF_APACHE_MODULE_LOADED('mod_rewrite')) {
+ $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_extensions SET ext_active='N' WHERE ext_name='rewrite' LIMIT 1", array(), __FILE__, __LINE__);
+ $EXT_REPORTS_FAILURE = true;
+ ADD_FATAL(MOD_REWRITE_ERROR);
+ } // END - if
+
// SQL commands to run
$SQLs[] = "";
break;
// Update notes (these will be set as task text!)
$UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
break;
+ case "0.1.3":
+ // Check if mod_rewrite is loadeded
+ if (!IF_APACHE_MODULE_LOADED('mod_rewrite')){
+ $EXT_REPORTS_FAILURE = true;
+ //ADD_FATAL(MOD_REWRITE_ERROR);
+ } // END - if
+ $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;
default: // Do stuff when extension is loaded
+ // Check if mod_rewrite is loadeded
+ if (!IF_APACHE_MODULE_LOADED('mod_rewrite')){
+ $EXT_REPORTS_FAILURE = true;
+ $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_extensions SET ext_active='N' WHERE ext_name='rewrite' LIMIT 1", array(), __FILE__, __LINE__);
+ if (!IS_ADMIN())ADD_FATAL(MOD_REWRITE_ERROR);
+ } // END - if
break;
}
return @session_destroy();
}
+// Checks if a given apache module is loaded
+function IF_APACHE_MODULE_LOADED ($apacheModule) {
+ // Check it and return result
+ return (in_array($apacheModule, apache_get_modules()));
+}
+
//////////////////////////////////////////////////
// //
// AUTOMATICALLY RE-GENERATED MISSING FUNCTIONS //
define('LOCK_REASON', "Sperrgrund");
define('LOCK_TIMESTAMP', "Sperrzeitpunkt");
define('EXTENSION', "Erweiterung");
+define('MOD_REWRITE_ERROR', "Sie müssen mod_rewrite in Apache aktiviert haben um die Erweiterung rewrite nutzen zu können.");
define('MEMBER_MAIL_BONUS_CONFIRMED_ON', "Sie haben diese Bonusmail <span class=\"data\">%s</span> bestätigt.");
define('MEMBER_MAIL_NORMAL_CONFIRMED_ON', "Sie haben diese Klickmail <span class=\"data\">%s</span> bestätigt.");
unset($_POST['pass']);
} // END - if
- // Let's test the API first (hold your horses here, cowboy! Thanks. :) )
+ // Let's test the API first (hold your horses here, cowboy! Thank you. :) )
if (PRIMERA_TEST_API()) {
// Save settings
ADMIN_SAVE_SETTINGS($_POST);
// First merge temporarily the new API data into the current config
$_CONFIG = array_merge($_CONFIG, $_POST);
- // Let's test the API first (hold your horses here, cowboy! Thanks. :) )
+ // Let's test the API first (hold your horses here, cowboy! Thank you. :) )
if (WERNIS_TEST_API()) {
// Revert german commata
foreach (array('payout_factor', 'withdraw_factor', 'payout_fee_percent', 'withdraw_fee_percent') as $revert) {
if (!defined('__SECURITY')) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
-} elseif (!EXT_IS_ACTIVE("doubler"))
+} elseif (!EXT_IS_ACTIVE("doubler")) {
ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "doubler");
return;
}
// Add message here
if (!empty($_GET['msg'])) {
+ // Default extension is "unknown"
+ $ext = "unknown";
+
+ // Is extension given?
+ if (!empty($_GET['ext'])) $ext = SQL_ESCAPE($_GET['ext']);
+
+ // Which message shall we output?
switch ($_GET['msg']) {
case CODE_LOGOUT_DONE : $msg = LOGOUT_DONE; break;
case CODE_LOGOUT_FAILED : $msg = "<SPAN class=\"guest_failed\">".LOGOUT_FAILED."</SPAN>"; break;
break;
case CODE_EXTENSION_PROBLEM:
- // Default extension is "unknown"
- $ext = "unknown";
-
- // Is extension given?
- if (!empty($_GET['ext'])) $ext = SQL_ESCAPE($_GET['ext']);
$msg = sprintf(EXTENSION_PROBLEM_EXT_INACTIVE, $ext);
break;
case CODE_BEG_SAME_AS_OWN : $msg = BEG_SAME_UID_AS_OWN; break;
case CODE_LOGIN_FAILED : $msg = LOGIN_FAILED_GENERAL; break;
default : $msg = UNKNOWN_MAILID_CODE_1.$_GET['msg'].UNKNOWN_MAILID_CODE_2; break;
- }
+ } // END - switch
// Load message template
LOAD_TEMPLATE("message", false, $msg);
// No debug extension found
print("Please report this error at <a href=\"http://forum.mxchange.org\" target=\"_blank\">forum.mxchange.org</a>:<pre>");
debug_print_backtrace();
- die("</pre>Thanks for your help finding bugs.");
+ die("</pre>Thank you for your help finding bugs.");
}
}