]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/admin-inc.php
Variable naming convention applied, previous fix fixed ;)
[mailer.git] / inc / modules / admin / admin-inc.php
index 4d3cde5ab730a03bba13a61e79b3832635ce4f97..2fc9b17210f64f4a2e8239b30a437c47fc30c500 100644 (file)
@@ -96,6 +96,7 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password)
        $salt = __SALT;
 
        // Check if password is same
+       //* DEBUG: */ echo "*".$ret.",".$pass.",".$password.",".$salt."*<br >\n";
        if (($ret == "pass") && ($pass == generateHash($password, $salt)) && (!empty($salt)))   {
                // Change the passord hash here
                $pass = generateHash($password);
@@ -120,9 +121,16 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password)
        } elseif ((empty($salt)) && ($ret == "pass")) {
                // Something bad went wrong
                $ret = "failed";
+       } elseif ($ret == "done") {
+               // Try to login here if we have the old hashing way (sql_patches not installed?)
+               if (!LOGIN_ADMIN($admin_login, $pass)) {
+                       // Something went wrong
+                       $ret = "failed";
+               }
        }
 
        // Return the result
+       //* DEBUG: */ die("RETURN=".$ret);
        return $ret;
 }
 
@@ -829,5 +837,23 @@ function ADMIN_DELETE_ENTRIES_CONFIRM ($IDs, $table, $row, $columns = array(), $
                }
        }
 }
+// Checks proxy settins by fetching check-updates2.php from www.mxchange.org
+function ADMIN_TEST_PROXY_SETTINGS ($settingsArray) {
+       global $_CONFIG;
+       // By default they are invalid
+       $valid = false;
+
+       // Set temporary the new settings
+       $_CONFIG = array_merge($_CONFIG, $settingsArray);
+
+       // Now get the test URL
+       $content = MXCHANGE_OPEN("check-updates2.php");
+
+       // Is the first line with "200 OK"?
+       $valid = ereg("200 OK", $content[0]);
+
+       // Return result
+       return $valid;
+}
 //
 ?>