]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/admin-inc.php
Code moved because it depends on tables created by ext-user
[mailer.git] / inc / modules / admin / admin-inc.php
index e8e468b2be136eb4208b77bc076fea7d1f08d747..76d9c6666c1b3979292b222b13ea4f75786613b0 100644 (file)
@@ -18,6 +18,7 @@
  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -99,8 +100,9 @@ function ifAdminLoginDataIsValid ($adminLogin, $adminPassword) {
 
        // Prepare data array
        $data = array(
-               'login'     => $adminLogin,
-               'pass_hash' => $adminHash
+               'login'      => $adminLogin,
+               'plain_pass' => $adminPassword,
+               'pass_hash'  => $adminHash
        );
 
        // Run a special filter
@@ -122,19 +124,20 @@ function ifAdminCookiesAreValid ($adminLogin, $passHash) {
        if ($adminHash != '-1') {
                // Now, we need to encode the password in the same way the one is encoded in database
                $testHash = encodeHashForCookie($adminHash);
+               //* DEBUG: */ outputHtml('adminLogin='.$adminLogin.',<br />passHash='.$passHash.',<br />adminHash='.$adminHash.',<br />testHash='.$testHash.'<br />');
 
                // If they both match, the login data is valid
                if ($testHash == $passHash) {
                        // All fine
                        $ret = 'done';
                } else {
-
                        // Set status
                        $ret = 'pass';
                }
        } // END - if
 
        // Return status
+       //* DEBUG: */ outputHtml('ret='.$ret);
        return $ret;
 }
 
@@ -143,7 +146,7 @@ function doAdminAction () {
        // Get default what
        $what = getWhat();
 
-       //* DEBUG: */ outputHtml(__LINE__."*".$what.'/'.getModule().'/'.getAction().'/'.getWhat()."*<br />");
+       //* DEBUG: */ outputHtml(__LINE__.'*'.$what.'/'.getModule().'/'.getAction().'/'.getWhat().'*<br />');
 
        // Remove any spaces from variable
        if (empty($what)) {
@@ -493,6 +496,9 @@ function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement
                                if ('' . $val . '' == '' . $test . '') {
                                        // Add numbers
                                        $tableData[] = sprintf("`%s`=%s", $id, $test);
+                               } elseif (is_null($val)) {
+                                       // Add NULL
+                                       $tableData[] = sprintf("`%s`=NULL", $id);
                                } else {
                                        // Add strings
                                        $tableData[] = sprintf("`%s`='%s'", $id, trim($val));
@@ -559,7 +565,7 @@ function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement
        $affected = SQL_AFFECTEDROWS();
 
        // Rebuild cache
-       rebuildCacheFile('config', 'config');
+       rebuildCache('config', 'config');
 
        // Settings saved, so display message?
        if ($displayMessage === true) loadTemplate('admin_settings_saved', false, getMessage('SETTINGS_SAVED'));