]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/admin-inc.php
Now, all redirects to index.php points to modules.php?module=index
[mailer.git] / inc / modules / admin / admin-inc.php
index 66e71dc1597fabab8b6131b71bebfce077362659..8b136e04a7204f21d9c43b8242aaee45519840b7 100644 (file)
@@ -197,7 +197,7 @@ function ifAdminLoginDataIsValid ($admin, $password) {
 // Try to login the admin by setting some session/cookie variables
 function doAdminLogin ($adminLogin, $passHash) {
        // Reset failure counter on matching admins version
-       if ((isExtensionInstalledAndNewer('admins', '0.7.0')) && ((isExtensionOlder('sql_patches', '0.3.6')) || (!isExtensionInstalled('sql_patches')))) {
+       if ((isExtensionInstalledAndNewer('admins', '0.7.0')) && ((isExtensionInstalledAndOlder('sql_patches', '0.3.6')) || (!isExtensionInstalled('sql_patches')))) {
                // Reset counter on out-dated sql_patches version
                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admins` SET `login_failures`=0, `last_failure`='0000-00-00 00:00:00' WHERE `login`='%s' LIMIT 1",
                        array($adminLogin), __FUNCTION__, __LINE__);
@@ -208,7 +208,7 @@ function doAdminLogin ($adminLogin, $passHash) {
 
        // Now set all session variables and return the result
        return ((
-               setSession('admin_md5', generatePassString($passHash))
+               setSession('admin_md5', generatePassString(generateHash($passHash, '', false)))
        ) && (
                setSession('admin_login', $adminLogin)
        ) && (
@@ -226,7 +226,7 @@ function ifAdminCookiesAreValid ($admin, $password) {
        $pass = getAdminHash($admin);
        if ($pass != '-1') $ret = 'pass';
 
-       //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):".generatePassString($pass).'('.strlen($pass).")/".$password.'('.strlen($password).")<br />");
+       //* DEBUG: */ outputHtml(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):".generatePassString($pass).'('.strlen($pass).")/".$password.'('.strlen($password).")<br />");
 
        // Check if password matches
        if (($ret == 'pass') && ((generatePassString($pass) == $password) || ($pass == $password) || ((strlen($pass) == 32) && (md5($password) == $pass))) && (isAdmin())) {
@@ -255,7 +255,7 @@ function doAdminAction () {
        }
 
        // Get action value
-       $action = getModeAction(getModule(), $what);
+       $action = getActionFromModuleWhat(getModule(), $what);
 
        // Define admin login name and id number
        $content['login'] = getSession('admin_login');
@@ -347,7 +347,6 @@ ORDER BY
 
        // Do we have entries?
        if (SQL_NUMROWS($result_main) > 0) {
-               $OUT  = '<div style="height:7px" class="seperator">&nbsp;</div>';
                $OUT .= '<ul class="admin_menu_main">';
                // @TODO Rewrite this to $content = SQL_FETCHARRAY()
                while (list($menu, $title, $descr) = SQL_FETCHROW($result_main)) {
@@ -474,8 +473,6 @@ ORDER BY
                                        $OUT .= '</ul>
 </li>';
                                } // END - if
-
-                               $OUT .= '<li style="height:7px" class="seperator">&nbsp;</li>';
                        } // END - if
                } // END - while
 
@@ -584,7 +581,7 @@ function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement
                        convertSelectionsToTimestamp($postData, $tableData, $id, $skip);
 
                        // Shall we process this id? It muss not be empty, of course
-                       if (($skip === false) && (!empty($id)) && (!isset($GLOBALS['skip_config'][$id]))) {
+                       if (($skip === false) && (!empty($id)) && ((!isset($GLOBALS['skip_config'][$id]))) || ($tableName != '_config')) {
                                // Translate the value? (comma to dot!)
                                if ((is_array($translateComma)) && (in_array($id, $translateComma))) {
                                        // Then do it here... :)
@@ -1286,7 +1283,7 @@ function adminUpdateTaskData ($id, $row, $data) {
        // Should be admin!
        if (!isAdmin()) {
                // Not an admin so redirect better
-               redirectToUrl('index.php');
+               redirectToUrl('modules.php?module=index');
        } // END - if
 
        // Is the id not set, then we need a backtrace here... :(