| 1 | <cfsetting enablecfoutputonly=true> |
|---|
| 2 | <cfprocessingdirective pageencoding="utf-8"> |
|---|
| 3 | <!--- |
|---|
| 4 | Name : /client/admin/updatepassword.cfm |
|---|
| 5 | Author : Raymond Camden |
|---|
| 6 | Created : 09/14/06 |
|---|
| 7 | Last Updated : |
|---|
| 8 | History : |
|---|
| 9 | ---> |
|---|
| 10 | |
|---|
| 11 | <cfif structKeyExists(form, "cancel")> |
|---|
| 12 | <cflocation url="index.cfm" addToken="false"> |
|---|
| 13 | </cfif> |
|---|
| 14 | |
|---|
| 15 | <cfif structKeyExists(form, "update")> |
|---|
| 16 | <cfset errors = arrayNew(1)> |
|---|
| 17 | |
|---|
| 18 | <cfif not len(trim(form.oldpassword))> |
|---|
| 19 | <cfset arrayAppend(errors, "You must enter your old password.")> |
|---|
| 20 | </cfif> |
|---|
| 21 | <cfif not len(trim(form.newpassword))> |
|---|
| 22 | <cfset arrayAppend(errors, "Your new password cannot be blank.")> |
|---|
| 23 | </cfif> |
|---|
| 24 | <cfif form.newpassword neq form.newpassword2> |
|---|
| 25 | <cfset arrayAppend(errors, "Your new password and the confirmation did not match.")> |
|---|
| 26 | </cfif> |
|---|
| 27 | |
|---|
| 28 | <cfif not arrayLen(errors)> |
|---|
| 29 | <cfset result = application.blog.updatePassword(form.oldpassword, form.newpassword)> |
|---|
| 30 | <cfif result> |
|---|
| 31 | <cfset goodFlag = true> |
|---|
| 32 | <cfelse> |
|---|
| 33 | <cfset errors[1] = "You entered the wrong old password."> |
|---|
| 34 | </cfif> |
|---|
| 35 | </cfif> |
|---|
| 36 | |
|---|
| 37 | </cfif> |
|---|
| 38 | |
|---|
| 39 | <cfmodule template="../tags/adminlayout.cfm" title="Update Password"> |
|---|
| 40 | |
|---|
| 41 | <cfoutput> |
|---|
| 42 | <p> |
|---|
| 43 | Use the form below to update your password. You must enter your old password first. |
|---|
| 44 | </p> |
|---|
| 45 | </cfoutput> |
|---|
| 46 | |
|---|
| 47 | <cfif structKeyExists(variables, "goodFlag")> |
|---|
| 48 | <cfoutput> |
|---|
| 49 | <p> |
|---|
| 50 | Your password was updated. |
|---|
| 51 | </p> |
|---|
| 52 | </cfoutput> |
|---|
| 53 | </cfif> |
|---|
| 54 | |
|---|
| 55 | <cfif structKeyExists(variables, "errors") and arrayLen(errors)> |
|---|
| 56 | <cfoutput> |
|---|
| 57 | <div class="errors"> |
|---|
| 58 | Please correct the following error(s): |
|---|
| 59 | <ul> |
|---|
| 60 | <cfloop index="x" from="1" to="#arrayLen(errors)#"> |
|---|
| 61 | <li>#errors[x]#</li> |
|---|
| 62 | </cfloop> |
|---|
| 63 | </ul> |
|---|
| 64 | </div> |
|---|
| 65 | </cfoutput> |
|---|
| 66 | </cfif> |
|---|
| 67 | |
|---|
| 68 | <cfoutput> |
|---|
| 69 | <p> |
|---|
| 70 | <form action="updatepassword.cfm" method="post"> |
|---|
| 71 | <table> |
|---|
| 72 | <tr> |
|---|
| 73 | <td align="right">old password:</td> |
|---|
| 74 | <td><input type="password" name="oldpassword" value="" class="txtFieldShort" maxlength="255"></td> |
|---|
| 75 | </tr> |
|---|
| 76 | <tr> |
|---|
| 77 | <td align="right">new password:</td> |
|---|
| 78 | <td><input type="password" name="newpassword" value="" class="txtFieldShort" maxlength="255"></td> |
|---|
| 79 | </tr> |
|---|
| 80 | <tr> |
|---|
| 81 | <td align="right">confirm password:</td> |
|---|
| 82 | <td><input type="password" name="newpassword2" value="" class="txtFieldShort" maxlength="255"></td> |
|---|
| 83 | </tr> |
|---|
| 84 | <tr> |
|---|
| 85 | <td> </td> |
|---|
| 86 | <td><input type="submit" name="cancel" value="Cancel"> <input type="submit" name="update" value="Update"></td> |
|---|
| 87 | </tr> |
|---|
| 88 | </table> |
|---|
| 89 | </form> |
|---|
| 90 | </p> |
|---|
| 91 | </cfoutput> |
|---|
| 92 | |
|---|
| 93 | </cfmodule> |
|---|
| 94 | |
|---|
| 95 | <cfsetting enablecfoutputonly=false> |
|---|