]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/admin-inc.php
Double->single rewrites and possible fixes for revision data
[mailer.git] / inc / modules / admin / admin-inc.php
index 0f8382245ef2321f0168b94c15c92d956985d20a..28dc8a33f192bbf8fcb2f2eb511ad111df8600e3 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())) {
@@ -584,7 +584,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... :)
@@ -827,7 +827,7 @@ function sendAdminBuildMails ($mode, $table, $content, $id, $subjectPart = '') {
        } // END - if
 
        // Is the raw userid set?
-       if (postRequestElement('userid_raw', $id) > 0) {
+       if (postRequestParameter('userid_raw', $id) > 0) {
                // Generate subject
                $subjectLine = getMessage('MEMBER_'.strtoupper($subject).'_'.strtoupper($table).'_SUBJECT');
 
@@ -839,7 +839,7 @@ function sendAdminBuildMails ($mode, $table, $content, $id, $subjectPart = '') {
                }
 
                // Send email out
-               sendEmail(postRequestElement('userid_raw', $id), $subjectLine, $mail);
+               sendEmail(postRequestParameter('userid_raw', $id), $subjectLine, $mail);
        } // END - if
 
        // Generate subject
@@ -847,9 +847,9 @@ function sendAdminBuildMails ($mode, $table, $content, $id, $subjectPart = '') {
 
        // Send admin notification out
        if (!empty($subjectPart)) {
-               sendAdminNotification($subjectLine, 'admin_' . $mode . '_' . strtolower($subjectPart) . '_' . $table, $content, postRequestElement('userid_raw', $id));
+               sendAdminNotification($subjectLine, 'admin_' . $mode . '_' . strtolower($subjectPart) . '_' . $table, $content, postRequestParameter('userid_raw', $id));
        } else {
-               sendAdminNotification($subjectLine, 'admin_' . $mode . '_' . $table, $content, postRequestElement('userid_raw', $id));
+               sendAdminNotification($subjectLine, 'admin_' . $mode . '_' . $table, $content, postRequestParameter('userid_raw', $id));
        }
 }
 
@@ -1007,7 +1007,7 @@ function adminDeleteEntriesConfirm ($IDs, $table, $columns=array(), $filterFunct
                        $idList = '';
                        foreach ($IDs as $id => $sel) {
                                // Is there a userid?
-                               if (isPostRequestElementSet('userid_raw', $id)) {
+                               if (isPostRequestParameterSet('userid_raw', $id)) {
                                        // Load all data from that id
                                        $result = SQL_QUERY_ESC("SELECT * FROM `{?_MYSQL_PREFIX?}_%s` WHERE %s=%s LIMIT 1",
                                        array($table, $idColumn, $id), __FUNCTION__, __LINE__);
@@ -1395,7 +1395,7 @@ function doVerifyExpertSettings () {
                                // Ask for them
                                if (isFormSent()) {
                                        // Is the element set, then we need to change the admin
-                                       if (isPostRequestElementSet('expert_settings')) {
+                                       if (isPostRequestParameterSet('expert_settings')) {
                                                // Get it and prepare final post data array
                                                $postData['login'][getCurrentAdminId()] = getAdminLogin(getCurrentAdminId());
                                                $postData['expert_warning'][getCurrentAdminId()] = 'N';
@@ -1404,7 +1404,7 @@ function doVerifyExpertSettings () {
                                                adminsChangeAdminAccount($postData, 'expert_warning');
 
                                                // Clear form
-                                               unsetPostRequestElement('ok');
+                                               unsetPostRequestParameter('ok');
                                        } // END - if
 
                                        // All fine!