]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/admins_functions.php
Further fixes for non-working admin login and debug lines commented out
[mailer.git] / inc / libs / admins_functions.php
index 12727422c0e232ec43115564f84d0c15202696fe..795287883c88ede21d651d83a0748db02effc1f4 100644 (file)
@@ -658,6 +658,9 @@ function FILTER_RESET_ADMINS_LOGIN_FAILURES ($data) {
        // Change it in the admin
        adminsChangeAdminAccount($postData);
 
+       // Always make sure the cache is destroyed
+       rebuildCache('admin');
+
        // Return the data for further processing
        return $data;
 }
@@ -672,6 +675,32 @@ function FILTER_COUNT_ADMINS_LOGIN_FAILURE ($data) {
        // Change it in the admin
        adminsChangeAdminAccount($postData);
 
+       // Always make sure the cache is destroyed
+       rebuildCache('admin');
+
+       // Return the data for further processing
+       return $data;
+}
+
+// Rehashes the given plain admin password and stores it the database
+function FILTER_REHASH_ADMINS_PASSWORD ($data) {
+       // Generate new hash
+       $newHash = generateHash($data['plain_pass']);
+
+       // Prepare update data
+       $postData['login'][getCurrentAdminId()]    = $data['login'];
+       $postData['password'][getCurrentAdminId()] = $newHash;
+
+       // Change it in the admin
+       adminsChangeAdminAccount($postData);
+
+       // Update cookie/session and data array
+       setSession('admin_md5', encodeHashForCookie($newHash));
+       $data['pass_hash'] = $newHash;
+
+       // Always make sure the cache is destroyed
+       rebuildCache('admin');
+
        // Return the data for further processing
        return $data;
 }