]> git.mxchange.org Git - mailer.git/commitdiff
Fixes for right PATH and URL under Windows, admins cache loader fixed
authorRoland Häder <roland@mxchange.org>
Mon, 3 Nov 2008 19:26:17 +0000 (19:26 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 3 Nov 2008 19:26:17 +0000 (19:26 +0000)
DOCS/de/THANK_YOU.txt
inc/config.php
inc/databases.php
inc/loader/load_cache-admin.php

index d6253ba04fbb36ec1cfa103f5a67ecaaaa80a410..39e93fa9cd8872475bea74ada41f8202b5372bbd 100644 (file)
@@ -29,6 +29,8 @@ Personen:
   (http://www.simplemail.de)
 - AndreasJung aus dem MXChange-Community Forum wegen zahlreicher Bugmeldungen.
   (http://www.onlinewerbebombe.de)
+- Der User profi-concept aus meinem Forum hat mir Patches fuer die config.php
+  zugesandt, die Probleme unter Windows gefixt haben.
 
 Websites / Programmierer / etc.:
 - SF.net: Hosten meine Projektdateien (nur Archive)
index 644925084c15df31741f7d77b89068b68cd9c988..b01adc681041776405c917b509eb36a36a87be96 100644 (file)
@@ -84,10 +84,10 @@ define('MAIN_TITLE', "Your mail-exchanger title");
 // CFG: SLOGAN
 define('SLOGAN', "Your cool slogan here");
 
-// Auto-detection...
-$URL = "http://".getenv('SERVER_NAME').dirname($_SERVER['PHP_SELF']);
+// Auto-detection... (patched by "Stelzi" aka. profi-concept, thanks again!)
+$URL = "http://".getenv('SERVER_NAME') . str_replace("\\", "/", dirname($_SERVER['PHP_SELF']));
 while (substr($URL, -1, 1) == "/") { $URL = substr($URL, 0, -1); }
-$PATH = substr(dirname(__FILE__), 0, -3);
+$PATH = str_replace("\\", "/", substr(dirname(__FILE__), 0, -3));
 
 // CFG: HOST-URL (without trailing '/' !)
 define('URL', $URL);
index 1d2487436dc1deea08be1c0e4f90efeba3a45d0e..e7a61f00a75ac13f2fe08d557c6d26682ce8c989 100644 (file)
@@ -114,7 +114,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // This current patch level
-define('CURR_SVN_REVISION', "522");
+define('CURR_SVN_REVISION', "523");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index 2de94871bceb7ac3a2c929708d53fb2ee867f209..b9cbd32f4ba18e79e689bfe6b42c5a5f8405b72b 100644 (file)
@@ -47,61 +47,33 @@ if (($cacheInstance->cache_file("admins", true) == true) && ($cacheInstance->ext
        if ((is_array($cacheArray['admins']['login'])) && (is_array($cacheArray['admins']['aid']))) {
                // Check count
                if (count($cacheArray['admins']['login']) == count($cacheArray['admins']['aid'])) {
-                       //* DEBUG: */ echo "<PRE>";
-                       //* DEBUG: */ print_r($cacheArray['admins']);
-
-                       // The cache file seems to be fine
-                       foreach ($cacheArray['admins']['login'] as $k => $login) {
-                               // Rewrite admin id
-                               $cacheArray['admins']['aid'][$login]    = $cacheArray['admins']['aid'][$k];
-
-                               // Shortcut admin id
-                               $aid = $cacheArray['admins']['aid'][$login];
-
-                               // Rewrite others...
-                               $cacheArray['admins']['password'][$aid] = $cacheArray['admins']['password'][$k];
-                               $cacheArray['admins']['email'][$aid]    = $cacheArray['admins']['email'][$k];
-
-                               // Some extra data depending on version
-                               if (GET_EXT_VERSION("admins") >= "0.3") {
-                                       // Default ACL
-                                       $cacheArray['admins']['def_acl'][$aid]  = $cacheArray['admins']['def_acl'][$k];
-                                       if (GET_EXT_VERSION("admins") >= "0.6.7") {
-                                               // "Logical Area" mode
-                                               $cacheArray['admins']['la_mode'][$aid]  = $cacheArray['admins']['la_mode'][$k];
-                                               if (GET_EXT_VERSION("admins") >= "0.7.0") {
-                                                       // Login failtures
-                                                       $cacheArray['admins']['login_failtures'][$aid] = $cacheArray['admins']['login_failtures'][$k];
-                                                       $cacheArray['admins']['last_failture'][$aid]   = $cacheArray['admins']['last_failture'][$k];
-                                               } // END - if
+                       // Get "id map"
+                       $idMap = $cacheArray['admins']['aid'];
+
+                       // Rewrite the cache array
+                       for ($idx = (count($idMap) - 1); $idx >= 0; $idx--) {
+                               // Rewrite all entries
+                               foreach ($cacheArray['admins'] as $key=>$entryArray) {
+                                       // Rewrite the entry
+                                       if ($key == "aid") {
+                                               // Rewrite admin id (use login name as index)
+                                               $cacheArray['admins']['aid'][$cacheArray['admins']['login'][$idx]] = $entryArray[$idx];
+                                       } else {
+                                               // Rewrite regular entry
+                                               $cacheArray['admins'][$key][$idMap[$idx]] = $entryArray[$idx];
+                                       }
+
+                                       // Is the last entry reached?
+                                       if ($idx == 0) {
+                                               // Remove it
+                                               unset($cacheArray['admins'][$key][0]);
                                        } // END - if
                                } // END - if
-
-                               //* DEBUG: */ print_r($cacheArray['admins']);
-
-                               // Clear array
-                               foreach (array('aid', 'def_acl', 'la_mode', 'password', 'email', 'login_failtures', 'last_failture') as $rem) {
-                                       if (isset($cacheArray['admins'][$rem][$k])) unset($cacheArray['admins'][$rem][$k]);
-                               } // END - foreach
-                       } // END - if
-
-                       //* DEBUG: */ print_r($cacheArray['admins']);
-
-                       // Rewrite Login
-                       foreach ($cacheArray['admins']['login'] as $k => $login) {
-                               $cacheArray['admins']['login'][$cacheArray['admins']['aid'][$login]] = $login;
-                               if (!in_array($k, $cacheArray['admins']['aid'])) {
-                                       unset($cacheArray['admins']['login'][$k]);
-                               } // END - if
-                       } // END - foreach
-
-                       //* DEBUG: */ echo "****\n";
-                       //* DEBUG: */ print_r($cacheArray['admins']);
-                       //* DEBUG: */ echo "</PRE>";
-                       //* DEBUG: */ die();
+                       } // END - for
                } else {
                        // Nope, cache file is corrupted!
                        $cacheInstance->cache_destroy();
+                       unset($cacheArray['admins']);
                }
        } else {
                // Nope, cache file is corrupted!