Ignore:
Timestamp:
Jan 29, 2009, 8:31:15 PM (16 years ago)
Author:
gav
Message:

Added login page and adjusted Person domain/views/controller and BootStrap?.
Add beforeInterceptor() to all controllers.
Added BaseController?.
Added adminmenubar adjust layout and css to suite.

Location:
trunk/src/grails-app/controllers
Files:
1 added
9 edited

Legend:

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

    r21 r40  
    1 class EntryController {
    2    
     1class EntryController extends BaseController {
     2
     3    def beforeInterceptor = [action:this.&auth]
     4
    35    def index = { redirect(action:list,params:params) }
    46
  • trunk/src/grails-app/controllers/EntryTypeController.groovy

    r21 r40  
    1 class EntryTypeController {
    2    
     1class EntryTypeController extends BaseController {
     2
     3    def beforeInterceptor = [action:this.&auth]
     4
    35    def index = { redirect(action:list,params:params) }
    46
  • trunk/src/grails-app/controllers/ModificationController.groovy

    r21 r40  
    1 class ModificationController {
    2    
     1class ModificationController extends BaseController {
     2
     3    def beforeInterceptor = [action:this.&auth]
     4
    35    def index = { redirect(action:list,params:params) }
    46
  • trunk/src/grails-app/controllers/ModificationTypeController.groovy

    r21 r40  
    1 class ModificationTypeController {
    2    
     1class ModificationTypeController extends BaseController {
     2
     3    def beforeInterceptor = [action:this.&auth]
     4
    35    def index = { redirect(action:list,params:params) }
    46
  • trunk/src/grails-app/controllers/PersonController.groovy

    r21 r40  
    1 class PersonController {
    2    
     1class PersonController extends BaseController {
     2
     3    def beforeInterceptor = [action:this.&auth,except:['login', 'logout']]
     4
    35    def index = { redirect(action:list,params:params) }
    46
     
    8082        }
    8183    }
     84
     85    def login = {
     86        if (request.method == "GET") {
     87            session.userId = null
     88            def person = new Person()
     89        }
     90        else {
     91            def person = Person.findByUserIdAndPassword(params.userId,params.password)
     92            if (person) {
     93                    session.userId = person.userId
     94                    def redirectParams =
     95                        session.originalRequestParams ?
     96                        session.originalRequestParams : [controller:'task']
     97                    redirect(redirectParams)
     98            }
     99            else {
     100         flash['message'] = 'Please enter a valid user ID and password'
     101            }
     102        }
     103    }
     104
     105    def logout = {
     106        session.userId = null
     107        flash['message'] = 'Successfully logged out'
     108        redirect(controller:'person', action:'login')
     109    }
     110
     111    def admin = {
     112        render(view:'admin')
     113    }
     114
    82115}
  • trunk/src/grails-app/controllers/PersonGroupController.groovy

    r19 r40  
    1 class PersonGroupController {
    2    
     1class PersonGroupController extends BaseController {
     2
     3    def beforeInterceptor = [action:this.&auth]
     4
    35    def index = { redirect(action:list,params:params) }
    46
  • trunk/src/grails-app/controllers/PersonGroupTypeController.groovy

    r21 r40  
    1 class PersonGroupTypeController {
    2    
     1class PersonGroupTypeController extends BaseController {
     2
     3    def beforeInterceptor = [action:this.&auth]
     4
    35    def index = { redirect(action:list,params:params) }
    46
  • trunk/src/grails-app/controllers/TaskController.groovy

    r21 r40  
    1 class TaskController {
    2    
     1class TaskController extends BaseController {
     2
     3    def beforeInterceptor = [action:this.&auth]
     4
    35    def index = { redirect(action:list,params:params) }
    46
  • trunk/src/grails-app/controllers/TaskGroupController.groovy

    r21 r40  
    1 class TaskGroupController {
    2    
     1class TaskGroupController extends BaseController {
     2
     3    def beforeInterceptor = [action:this.&auth]
     4
    35    def index = { redirect(action:list,params:params) }
    46
Note: See TracChangeset for help on using the changeset viewer.