Ignore:
Timestamp:
Nov 10, 2009, 9:56:28 PM (14 years ago)
Author:
gav
Message:

Small refactor to use personService where appropriate.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/AppCoreController.groovy

    r178 r185  
    33class AppCoreController extends BaseController {
    44
    5     def authenticateService
     5    def personService
    66    def createDataService
    77
     
    1717    */
    1818    def welcome = {
    19         def personInstance = Person.get(authenticateService.userDomain().id)
     19        def personInstance = personService.currentUser()
    2020        flash.message = "Welcome, ${personInstance.firstName} ${personInstance.lastName}."
    2121
     
    3030    def changeSessionTimeout = {
    3131        if (request.method == 'GET') {
    32             def personInstance = Person.get(authenticateService.userDomain().id)
     32            def personInstance = personService.currentUser()
    3333            return [ personInstance : personInstance ]       
    3434        }
    3535        if (request.method == 'POST') {
    36             def personInstance = Person.get(authenticateService.userDomain().id)
     36            def personInstance = personService.currentUser()
    3737                personInstance.properties = params
    3838                if (!personInstance.hasErrors() && personInstance.save(flush: true)) {
     
    5353
    5454        if (request.method == 'GET') {
    55             def personInstance = Person.get(authenticateService.userDomain().id)
     55            def personInstance = personService.currentUser()
    5656            return [ personInstance : personInstance ]       
    5757        }
    5858
    5959        if (request.method == 'POST') {
    60             def personInstance = Person.get(authenticateService.userDomain().id)
     60            def personInstance = personService.currentUser()
    6161
    6262            if(params.confirmPass == params.pass) {
Note: See TracChangeset for help on using the changeset viewer.