- Timestamp:
- Mar 14, 2009, 10:04:39 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/TaskRewrite/src/grails-app/controllers/PersonController.groovy
r72 r73 96 96 } 97 97 98 def oldPassword = person.password99 98 person.properties = params 100 if (!params.password.equals(oldPassword)) { 101 person.password = authenticateService.encodePassword(params.password) 102 } 103 if (person.save()) { 104 Authority.findAll().each { it.removeFromPersons(person) } 105 addRoles(person) 106 redirect action: show, id: person.id 107 } 108 else { 109 render view: 'edit', model: buildPersonModel(person) 110 } 99 100 if (person.pass != "") { 101 if (!person.hasErrors()) { 102 person.password = authenticateService.encodePassword(params.pass) 103 } 104 } 105 else { 106 person.pass = "NothingToClearValidation" 107 } 108 109 if (!person.hasErrors() && person.save()) { 110 Authority.findAll().each { it.removeFromPersons(person) } 111 addRoles(person) 112 redirect action: show, id: person.id 113 } 114 else { 115 render view: 'edit', model: buildPersonModel(person) 116 } 117 111 118 } 112 119 … … 122 129 def person = new Person() 123 130 person.properties = params 124 person.password = authenticateService.encodePassword(params.pass word)131 person.password = authenticateService.encodePassword(params.pass) 125 132 if (person.save()) { 126 133 addRoles(person)
Note: See TracChangeset
for help on using the changeset viewer.