Changeset 59 for branches/TaskRewrite/src/grails-app
- Timestamp:
- Feb 8, 2009, 11:28:04 PM (16 years ago)
- Location:
- branches/TaskRewrite/src/grails-app
- Files:
-
- 25 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/TaskRewrite/src/grails-app/conf/BootStrap.groovy
r58 r59 46 46 // name:"gnuMims").save() 47 47 48 //Authority 49 def authInstance 50 51 authInstance = new Authority(description:"Application Admin", 52 authority:"ROLE_ADMIN") 53 BootStrapSaveAndTest(authInstance) 54 55 authInstance = new Authority(description:"Application Admin", 56 authority:"ROLE_USER") 57 BootStrapSaveAndTest(authInstance) 48 58 49 59 //Person 50 // def passwordEncoded = authenticateService.encodePassword("pass") 60 def passwordEncoded = authenticateService.encodePassword("pass") 61 def personInstance 51 62 52 defpersonInstance = new Person(loginName:"admin",63 personInstance = new Person(loginName:"admin", 53 64 firstName:"Admin", 54 65 lastName:"Powers", 55 password: authenticateService.encodePassword("pass"),66 password:passwordEncoded, 56 67 email:"admin@example.com") 57 68 BootStrapSaveAndTest(personInstance) 69 personInstance.addToAuthorities(Authority.get(1)) 70 personInstance.addToAuthorities(Authority.get(2)) 58 71 59 //Role 60 def authInstance = new Authority(description:"Application Admin", 61 authority:"ROLE_ADMIN") 62 authInstance.addToPersons(personInstance) 63 authInstance.save() 72 personInstance = new Person(loginName:"user", 73 firstName:"Demo", 74 lastName:"Danza", 75 password:passwordEncoded, 76 email:"user@example.com") 77 BootStrapSaveAndTest(personInstance) 78 personInstance.addToAuthorities(Authority.get(2)) 64 79 65 // new Person(username:"admin", 66 // userRealName:"Admin Powers", 67 // enabled:true, 68 // 69 // new Person(personGroup:PersonGroup.get(3), 70 // firstName:"Admin", 71 // lastName:"Powers", 72 // userId:"admin", 73 // password:"pass").save() 74 // new Person(personGroup:PersonGroup.get(1), 75 // firstName:"Demo", 76 // lastName:"Danza", 77 // userId:"user", 78 // password:"pass").save() 80 personInstance = new Person(loginName:"craig", 81 firstName:"Craig", 82 lastName:"SuperTech", 83 password:passwordEncoded, 84 email:"user@example.com") 85 BootStrapSaveAndTest(personInstance) 86 personInstance.addToAuthorities(Authority.get(2)) 79 87 88 personInstance = new Person(loginName:"joe", 89 firstName:"Joe", 90 lastName:"Samples", 91 password:passwordEncoded, 92 email:"user@example.com") 93 BootStrapSaveAndTest(personInstance) 94 personInstance.addToAuthorities(Authority.get(2)) 80 95 81 // new Person(personGroup:PersonGroup.get(1), 82 // firstName:"Craig", 83 // lastName:"SuperTech", 84 // userId:"craig", 85 // password:"pass").save() 86 // new Person(personGroup:PersonGroup.get(2), 87 // firstName:"Joe", 88 // lastName:"Samples", 89 // userId:"joe", 90 // password:"pass").save() 91 // new Person(personGroup:PersonGroup.get(1), 92 // firstName:"Production", 93 // lastName:"Mann", 94 // userId:"Mann", 95 // password:"pass").save() 96 personInstance = new Person(loginName:"mann", 97 firstName:"Production", 98 lastName:"Mann", 99 password:passwordEncoded, 100 email:"user@example.com") 101 BootStrapSaveAndTest(personInstance) 102 personInstance.addToAuthorities(Authority.get(2)) 103 96 104 97 105 //TaskGroup -
branches/TaskRewrite/src/grails-app/controllers/AuthorityController.groovy
r58 r59 1 2 3 4 /** 5 * Authority Controller. 6 */ 1 @Secured(['ROLE_ADMIN']) 7 2 class AuthorityController { 8 3 -
branches/TaskRewrite/src/grails-app/controllers/LoginController.groovy
r58 r59 38 38 } 39 39 } 40 41 def loggedOut = { 42 flash['message'] = 'Successfully logged out' 43 auth() 44 } 40 45 41 46 /** -
branches/TaskRewrite/src/grails-app/controllers/LogoutController.groovy
r58 r59 9 9 def index = { 10 10 // TODO put any pre-logout code here 11 redirect(uri: '/j_spring_security_logout') 11 12 redirect(uri: '/j_spring_security_logout?logoutSuccessUrl=/login/loggedOut') 12 13 } 13 14 } -
branches/TaskRewrite/src/grails-app/controllers/PersonController.groovy
r58 r59 5 5 * User controller. 6 6 */ 7 @Secured(['ROLE_ADMIN']) 7 8 class PersonController { 8 9 -
branches/TaskRewrite/src/grails-app/domain/Person.groovy
r58 r59 1 1 class Person { 2 2 static transients = ['pass'] 3 static hasMany = [authorities: Authority] 4 static belongsTo = Authority 3 static hasMany = [authorities: Authority, 4 personGroups: PersonGroup] 5 // modifications: Modification, 6 // entries: Entry, 7 // tasks: Task] 8 9 static belongsTo = [Authority, PersonGroup] 5 10 6 11 String loginName … … 25 30 26 31 static constraints = { 27 loginName(blank: false, unique: true) 32 loginName(blank: false, unique: true)//minSize:7 28 33 firstName(blank: false) 29 34 lastName(blank: false) 30 password(blank: false) 35 password(blank: false) //minSize:7 31 36 employeeID(blank: true, nullable:true) 32 37 } -
branches/TaskRewrite/src/grails-app/views/layouts/main.gsp
r56 r59 1 1 <html> 2 2 <head> 3 <title><g:layoutTitle default=" Grails" /></title>3 <title><g:layoutTitle default="gnuMims" /></title> 4 4 <link rel="stylesheet" href="${createLinkTo(dir:'css',file:'main.css')}" /> 5 <link rel="shortcut icon" href="${createLinkTo(dir:'images',file:' favicon.ico')}" type="image/x-icon" />5 <link rel="shortcut icon" href="${createLinkTo(dir:'images',file:'gnuMimsIcon.ico')}" type="image/x-icon" /> 6 6 <g:layoutHead /> 7 <g:javascript library="application" /> 7 <g:javascript library="application" /> 8 8 </head> 9 9 <body> 10 <div id="wrapper" style="height: 100%;"> 11 <div id="top"> 12 </div> 13 <div id="content" align="center"> 10 14 <div id="spinner" class="spinner" style="display:none;"> 11 <img src="${createLinkTo(dir:'images',file:'spinner. gif')}" alt="Spinner" />15 <img src="${createLinkTo(dir:'images',file:'spinner.png')}" alt="Spinner" /> 12 16 </div> 13 <div class="logo"><img src="${createLinkTo(dir:'images',file:'grails_logo.jpg')}" alt="Grails" /></div> 14 <g:layoutBody /> 17 <!-- <div class="logo" style="text-align: center; width: 980px; height: 220px"> 18 <img src="${createLinkTo(dir:'images',file:'logo.png')}" 19 alt="gnuMims" /> 20 <g:render template="/adminmenubar" /> 21 22 </div> --> 23 <div id="Header"> 24 </div> 25 <div class="appControl"> 26 <g:render template="/adminmenubar" /> 27 </div> 28 <!-- Body wrapper div for IE --> 29 <div style="text-align: center; width: 980px"> 30 <g:layoutBody /> 31 </div> 32 </div> 33 <div id="bottom"> 34 </div> 35 </div> 15 36 </body> 16 37 </html>
Note: See TracChangeset
for help on using the changeset viewer.