Changeset 98 for trunk/src/grails-app/controllers/AppCoreController.groovy
- Timestamp:
- Apr 4, 2009, 6:41:25 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/grails-app/controllers/AppCoreController.groovy
r91 r98 27 27 if (request.method == 'POST') { 28 28 def personInstance = Person.get(authenticateService.userDomain().id) 29 30 personInstance.pass = params.pass31 personInstance.password = authenticateService.encodePassword(personInstance.pass)32 29 33 if (!personInstance.hasErrors() && personInstance.save()) { 34 //userCache.removeUserFromCache(personInstance.loginName) 35 flash.message = "Password changed successfully." 36 redirect(action:options) 30 if(params.repeatPass == params.pass) { 31 personInstance.pass = params.pass 32 personInstance.password = authenticateService.encodePassword(personInstance.pass) 33 34 if (!personInstance.hasErrors() && personInstance.save()) { 35 //userCache.removeUserFromCache(personInstance.loginName) 36 flash.message = "Password changed successfully." 37 redirect(action:options) 38 } 39 else { 40 render(view:'changePassword',model:[personInstance:personInstance]) 41 } 37 42 } 38 43 else { 44 flash.message = "Passwords must match." 45 // personInstance.addToErrors("Passwords must match.") 39 46 render(view:'changePassword',model:[personInstance:personInstance]) 40 } 47 } 48 41 49 } 42 50 }
Note: See TracChangeset
for help on using the changeset viewer.