Changeset 1159 for trunk/grails-app/controllers/dbnp/authentication/UserRegistrationController.groovy
- Timestamp:
- Nov 17, 2010, 4:20:33 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/authentication/UserRegistrationController.groovy
r1147 r1159 15 15 package dbnp.authentication 16 16 import grails.plugins.springsecurity.Secured 17 import org.codehaus.groovy.grails.commons.GrailsApplication 18 import grails.util.GrailsUtil 17 19 18 20 class UserRegistrationController { … … 125 127 def adminLink = createLink( controller: 'userRegistration', action: 'confirmAdmin', params: [code: adminCode.token], absolute: true ) 126 128 129 // If we are in production, send the mails to all administrators 130 // Otherwise, send it to a default (spam) mail address 131 def adminMail = "gscfproject@gmail.com"; 132 if ( GrailsUtil.getEnvironment().equals(GrailsApplication.ENV_PRODUCTION) ) { 133 def administrators = SecRole.findUsers( 'ROLE_ADMIN' ); 134 if( administrators.size() > 0 ) { 135 adminMail = administrators.email.toArray(); 136 } 137 } 138 127 139 // Send an email to the administrators 128 140 try { 129 141 // Determine administrator email addresses 130 142 sendMail { 131 to "gscfproject@gmail.com"143 to adminMail 132 144 subject "New user (" + user.username + ") at GSCF" 133 145 html g.render(template:"/email/registrationConfirmationAdmin", model:[username: user.username, email: user.email, link: adminLink])
Note: See TracChangeset
for help on using the changeset viewer.