X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Flibs%2Fadmins_functions.php;h=795287883c88ede21d651d83a0748db02effc1f4;hp=12727422c0e232ec43115564f84d0c15202696fe;hb=de5910b8e5deb9285a7ac57c26ebd894f4e1afbf;hpb=c3f2beb3f1d47c9593d262d7f5dac47640b4aa52 diff --git a/inc/libs/admins_functions.php b/inc/libs/admins_functions.php index 12727422c0..795287883c 100644 --- a/inc/libs/admins_functions.php +++ b/inc/libs/admins_functions.php @@ -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; }