Changeset 127 for trunk/grails-app/controllers
- Timestamp:
- May 6, 2009, 3:40:07 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/AppCoreController.groovy
r106 r127 10 10 //def allowedMethods = [delete:'POST', save:'POST', update:'POST'] 11 11 12 def welcome = { 13 def personInstance = Person.get(authenticateService.userDomain().id) 14 flash.message = "Welcome, ${personInstance.firstName} ${personInstance.lastName}." 15 16 def sess = getSession() 17 sess.setMaxInactiveInterval(personInstance.sessionTimeout) 18 redirect(action:home) 19 } 20 12 21 def home = { 13 22 } … … 15 24 def options = { 16 25 } 26 27 def changeSessionTimeout = { 28 if (request.method == 'GET') { 29 def personInstance = Person.get(authenticateService.userDomain().id) 30 return [ personInstance : personInstance ] 31 } 32 if (request.method == 'POST') { 33 def personInstance = Person.get(authenticateService.userDomain().id) 34 // personInstance.sessionTimeout = params.sessionTimeout.toInteger() 35 personInstance.properties = params 36 if (!personInstance.hasErrors() && personInstance.save()) { 37 def sess = getSession() 38 sess.setMaxInactiveInterval(personInstance.sessionTimeout) 39 flash.message = "Session timeout changed." 40 redirect(action:options) 41 } 42 else { 43 render(view:'changeSessionTimeout',model:[personInstance:personInstance]) 44 } 45 } 46 } 17 47 18 48 def changePassword = {
Note: See TracChangeset
for help on using the changeset viewer.