+ // 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');
+