You will have never found the Change or Reset Password activities have been logged into Audit Trail in the web applications that generated by PHPMaker until version 9.0.2. Meanwhile, those activities are very important to monitor in order to know when the last time your users changed their password.
The following customization will make it comes true. I have successfully customized PHPMaker template file in order to log Change and Reset Password activities into the Audit Trail feature. This is very useful if you as Administrator obviously want to monitor the Change and Reset Password activities in your web applications.
Please note that you have to implement the customization that I wrote it in this article before doing customization below.
Updated on July 22, 2012: This customization has been implemented in PHPMaker version 9.0.3, it matches to each other, and as a result, it works properly.
Updated on September 5, 2012: This customization has been implemented in PHPMaker version 9.0.4, it matches to each other, and as a result, it works properly.
Updated on November 29, 2012: This customization has been implemented in PHPMaker version 9.1.0, it matches to each other, and as a result, it works properly.
Updated on February 9, 2013: This customization has been implemented in PHPMaker version 9.2.0, it matches to each other, and as a result, it works properly.
Updated on June 17, 2013: This customization below has been handled by using MasinoChangePwd and MasinoForgotPwd extensions. You don’t need to implement the customization below if you use my extensions together with the original PHPMaker Template and Extension files.
[hidepost]
-
Open your C:\Program Files\PHPMaker 9\languages\english.xml file, and find this code:
</global>
before that line, please insert the following code:
<phrase id="LogChangePassword" value="changed the password"/> <phrase id="LogResetPassword" value="reset the password"/>
Do the same way with your another .xml language file (if any). For example, I am also using Indonesian, then I will add the following code into my C:\Program Files\PHPMaker 9\languages\indonesian.xml file:
<phrase id="LogChangePassword" value="mengganti kata sandi"/> <phrase id="LogResetPassword" value="mereset kata sandi"/>
-
Open your \Script\changepwd.php file, and find this code:
$UserProfile->SaveProfileToDatabase($sUsername);after that line, please insert the following code:
// Begin of modification Log Reset Forgot Password into Audit Trail, by Masino Sinaga, June 6, 2012 ew_WriteAuditTrail("log", ew_StdCurrentDateTime(), ew_ScriptName(), ms_GetCurrentUserID($sUsername)." - ".$sUsername, $Language->Phrase("LogChangePassword"), ew_CurrentUserIP(), "", "", "", ""); // End of modification Log Reset Forgot Password into Audit Trail, by Masino Sinaga, June 6, 2012 -
Open your \Script\activatepassword.php file, and find this code:
$ActivatePassword->setSuccessMessage($Language->Phrase("PwdEmailSent")); // Set success message // Modified by Masino Sinaga, May 23, 2012before that line, please insert the following code:
// Begin of modification Log Reset Forgot Password into Audit Trail, by Masino Sinaga, June 6, 2012 ew_WriteAuditTrail("log", ew_StdCurrentDateTime(), ew_ScriptName(), ms_GetCurrentUserID($sUsername)." - ".$sUsername, $Language->Phrase("LogResetPassword"), ew_CurrentUserIP(), "", "", "", ""); // End of modification Log Reset Forgot Password into Audit Trail, by Masino Sinaga, June 6, 2012 - Finally, re-generate your script files using PHPMaker as always.
[/hidepost]
Leave a Reply
You must be logged in to post a comment.