]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/admins_functions.php
Some fixes for bug-mails
[mailer.git] / inc / libs / admins_functions.php
index 12727422c0e232ec43115564f84d0c15202696fe..f86d80446e3003863557f790cbc8e78204b76d2a 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 *
@@ -658,6 +659,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 +676,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;
 }