Ignore:
Timestamp:
Mar 14, 2009, 10:04:39 AM (15 years ago)
Author:
gav
Message:

Add changePassword under options view so that users can change their own password.
Adjust for password validation, userCache etc. Only a small bug during "edit" is left on second "update" command.

Location:
branches/TaskRewrite/src/grails-app/conf
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/TaskRewrite/src/grails-app/conf/BootStrap.groovy

    r71 r73  
    7272           
    7373        //Person
    74         def passwordEncoded = authenticateService.encodePassword("pass")
     74        def passClearText = "pass"
     75        def passwordEncoded = authenticateService.encodePassword(passClearText)
    7576        def personInstance
    7677
     
    7879                                    firstName:"Admin",
    7980                                    lastName:"Powers",
     81                                    pass:passClearText,
    8082                                    password:passwordEncoded,
    8183                                    email:"admin@example.com")
     84        BootStrapSaveAndTest(personInstance)
     85        personInstance.addToAuthorities(Authority.get(1))
     86        personInstance.addToAuthorities(Authority.get(2))
     87        personInstance.addToPersonGroups(PersonGroup.findByName("gnuMims"))
     88
     89        personInstance = new Person(loginName:"admin2",
     90                                    firstName:"Admin2",
     91                                    lastName:"Powers2",
     92                                    pass:passClearText,
     93                                    password:passwordEncoded,
     94                                    email:"admin2@example.com")
    8295        BootStrapSaveAndTest(personInstance)
    8396        personInstance.addToAuthorities(Authority.get(1))
     
    88101                                    firstName:"Demo",
    89102                                    lastName:"Danza",
     103                                    pass:passClearText,
    90104                                    password:passwordEncoded,
    91105                                    email:"user@example.com")
     
    97111                                    firstName:"Craig",
    98112                                    lastName:"SuperTech",
     113                                    pass:passClearText,
    99114                                    password:passwordEncoded,
    100115                                    email:"user@example.com")
     
    103118        personInstance.addToPersonGroups(PersonGroup.findByName("Electrical"))
    104119
    105         personInstance = new Person(loginName:"joe",
    106                                     firstName:"Joe",
     120        personInstance = new Person(loginName:"john",
     121                                    firstName:"John",
    107122                                    lastName:"Samples",
     123                                    pass:passClearText,
    108124                                    password:passwordEncoded,
    109125                                    email:"user@example.com")
     
    115131                                    firstName:"Production",
    116132                                    lastName:"Mann",
     133                                    pass:passClearText,
    117134                                    password:passwordEncoded,
    118135                                    email:"user@example.com")
  • branches/TaskRewrite/src/grails-app/conf/SecurityConfig.groovy

    r71 r73  
    4646    alwaysUseDefaultTargetUrl = true
    4747
     48    //User caching, turned this off so that password changes take effect.
     49    //It would appear that user is still in the session as logout/login
     50    // is still required for role changes to take effect.
     51    //If this option causes high database load try:
     52    //  import org.acegisecurity.providers.dao.DaoAuthenticationProvider
     53    //  import org.acegisecurity.context.SecurityContextHolder
     54    //  DaoAuthenticationProvider daoAuthenticationProvider
     55    //  def user = SecurityContextHolder.context.authentication.principal.username
     56    //  daoAuthenticationProvider.userCache.removeUserFromCache(user)
     57    //  in logout controller and perhaps on password change and role change.
     58    cacheUsers = false
     59
    4860}
Note: See TracChangeset for help on using the changeset viewer.