Skip to content

Commit

Permalink
June, 2015 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
sgates committed Jun 5, 2015
1 parent 169c74e commit aff1a02
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 299 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

Syndication Media Services - Jun 04, 2015
Syndication Media Services - Jun 05, 2015
======================

This release includes the following applications:

- syndication_grails v3.10.1_RC2
- syndication_admin v3.10.3
- syndication_admin v3.10.5
- syndication_storefront v1.8.1
- syndication_model v2.0.4
- syndication_content_extraction_services v1.4.9
Expand All @@ -16,4 +16,5 @@ This release includes the following applications:
- syndication_delivery_handler v0.3.0
- syndication_commons v1.1.7
- syndication_desktop_client v1.1.0
- syndication-client-drupal7-module v1.15.5.29

Binary file not shown.
2 changes: 1 addition & 1 deletion syndication_admin/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
app.grails.version=2.4.5
app.name=SyndicationAdmin
app.servlet.version=3.0
app.version=3.10.3
app.version=3.10.5
2 changes: 1 addition & 1 deletion syndication_admin/grails-app/conf/BuildConfig.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ grails.project.dependency.resolution = {

plugins {
// plugins for the compile step ----------------------------------------------------
compile "org.grails.plugins:syndication-model:2.0.3" //Syndication domain classes
compile "org.grails.plugins:syndication-model:2.0.4" //Syndication domain classes
compile "org.grails.plugins:content-extraction-services:1.4.8" //syndication content extraction tools
compile "org.grails.plugins:solr-operations:1.2" //syndication solr stuff

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class UserController {
def userService
def springSecurityService
def cmsManagerKeyService
def passwordService

static allowedMethods = [save: "POST", update: "PUT", delete: "DELETE"]

Expand Down Expand Up @@ -149,28 +150,19 @@ class UserController {

@Secured(["ROLE_ADMIN", "ROLE_MANAGER"])
@Transactional
def save(UserRegistrationCommand urc) {
urc.passwordRepeat = params.passwordVerify
urc.validate()
if(urc.hasErrors()) {
flash.errors = urc.errors.allErrors.collect{[message:g.message([error : it])]}
if(Role.get(params.authority).authority == "ROLE_PUBLISHER" && !params.subscriberId){flash.errors << [message:"Select a Key"]}
def roles = Role.list()
if(UserRole.findByUser(springSecurityService.currentUser).role.authority == "ROLE_MANAGER"){
roles = Role.findAllByAuthorityInList(userService.getManagersAuthorityRoles())
}
render view:"create", model:[userInstance:new User(params), subscribers:cmsManagerKeyService.listSubscribers(), roles:roles, currentRoleId: params?.authority]
return
}
User userInstance = new User(params)
def save(User userInstance) {
if (userInstance == null) {
notFound()
return
}

def passwordValidationMessage = passwordService.validatePassword(params.password, params.passwordRepeat)
userInstance.validate()
if (userInstance.hasErrors() || (Role.get(params.authority).authority == "ROLE_PUBLISHER" && !params.subscriberId)) {
if (userInstance.hasErrors() || (Role.get(params.authority).authority == "ROLE_PUBLISHER" && !params.subscriberId) || passwordValidationMessage) {
flash.errors = []
if(passwordValidationMessage){
userInstance.errors.rejectValue("password", "password does not follow guidelines", passwordValidationMessage)
}
flash.errors = userInstance.errors.allErrors.collect{[message:g.message([error : it])]}
if(Role.get(params.authority).authority == "ROLE_PUBLISHER" && !params.subscriberId){flash.errors << [message:"Select a Key"]}
def roles = Role.list()
Expand All @@ -182,12 +174,6 @@ class UserController {
return
}

if(params.passwordVerify != params.password){
flash.error = "Both passwords mush match!"
redirect action: 'create', params:params, model: [subscribers:cmsManagerKeyService.listSubscribers()]
return
}

userService.saveUserAndRole(userInstance, params.long('authority'))

request.withFormat {
Expand All @@ -214,31 +200,21 @@ class UserController {
}

@Transactional
def updateMyAccount(UserRegistrationCommand urc){
urc.passwordRepeat = params.passwordVerify
urc.validate()
if(urc.hasErrors()) {
flash.errors = urc.errors.allErrors.collect{[message:g.message([error : it])]}
respond urc.errors, view:"editMyAccount", model:[userInstance: urc]
return
}
User userInstance = springSecurityService.currentUser
userInstance.properties = params
def updateMyAccount(User userInstance){
if (userInstance == null) {
notFound()
return
}

def passwordValidationMessage = passwordService.validatePassword(params.password, params.passwordRepeat)
userInstance.validate()
if (userInstance.hasErrors()) {
if (userInstance.hasErrors() || passwordValidationMessage) {
if(passwordValidationMessage){
userInstance.errors.rejectValue("password", "password does not follow guidelines", passwordValidationMessage)
}
flash.errors = userInstance.errors.allErrors.collect{[message:g.message([error : it])]}
respond userInstance.errors, view: 'editMyAccount'
return
}
if(params.passwordVerify != params.password){
flash.error = "Both passwords mush match!"
userInstance.discard()
respond userInstance.errors, view: 'editMyAccount'
transactionStatus.setRollbackOnly()
return
}

Expand All @@ -250,42 +226,27 @@ class UserController {

@Secured(["ROLE_ADMIN", "ROLE_MANAGER"])
@Transactional
def update(UserRegistrationCommand urc) {
urc.passwordRepeat = params.passwordVerify
urc.validate()
if(urc.hasErrors()) {
flash.errors = urc.errors.allErrors.collect{[message:g.message([error : it])]}
if(Role.get(params.authority).authority == "ROLE_PUBLISHER" && !params.subscriberId){flash.errors << [message:"Select a Key"]}
def roles = Role.list()
if(UserRole.findByUser(springSecurityService.currentUser).role.authority == "ROLE_MANAGER"){
roles = Role.findAllByAuthorityInList(userService.getManagersAuthorityRoles())
}
render view:"edit", model:[userInstance:new User(params), subscribers:cmsManagerKeyService.listSubscribers(), roles:roles, currentRoleId: params?.authority]
return
}
User userInstance = User.read(params.id)
userInstance.properties = params
def update(User userInstance) {
if (userInstance == null) {
notFound()
return
}

if (userInstance.hasErrors() || (Role.get(params.authority).authority == "ROLE_PUBLISHER" && !params.subscriberId)) {
def passwordValidationMessage = passwordService.validatePassword(params.password, params.passwordRepeat)
userInstance.validate()
if (userInstance.hasErrors() || (Role.get(params.authority).authority == "ROLE_PUBLISHER" && !params.subscriberId) || passwordValidationMessage) {
flash.errors = []
if(passwordValidationMessage){
userInstance.errors.rejectValue("password", "password does not follow guidelines", passwordValidationMessage)
}
flash.errors = userInstance.errors.allErrors.collect{[message:g.message([error : it])]}
if(Role.get(params.authority).authority == "ROLE_PUBLISHER" && !params.subscriberId){flash.errors << [message:"Select a Key"]}
userInstance.discard()
redirect action:'edit', id:userInstance.id, model: [subscribers:cmsManagerKeyService.listSubscribers()]
transactionStatus.setRollbackOnly()
return
}

if(params.passwordVerify != params.password){
flash.error = "Both passwords mush match!"
respond userInstance.errors, view: 'edit', model: [subscribers:cmsManagerKeyService.listSubscribers()]
return
}

userInstance.save()
userService.saveUserAndRole(userInstance, params.long('authority'))

request.withFormat {
form multipartForm {
Expand Down Expand Up @@ -325,39 +286,4 @@ class UserController {
'*' { render status: NOT_FOUND }
}
}
}

class UserRegistrationCommand{
String name
String username
String password
String passwordRepeat

def passwordService

static constraints = {
importFrom User
name nullable: false, blank: false
username email: true
password minSize: 8, validator: { passwd, urc ->
def passwordValidation = urc.passwordService.validatePassword(passwd)
if(!passwordValidation.valid){
if(!passwordValidation.uppercaseValid){
return ["requires.uppercase"]
}
if(!passwordValidation.lowercaseValid){
return ["requires.lowercase"]
}
if(!passwordValidation.numberValid){
return ["requires.number"]
}
}
}

passwordRepeat nullable: false, validator: { passwd2, urc ->
if(passwd2 != urc.password){
return ["mismatch"]
}
}
}
}
}

This file was deleted.

2 changes: 1 addition & 1 deletion syndication_admin/grails-app/views/user/_form.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
</label>

<div class="col-sm-8">
<g:passwordField autocomplete="off" name="passwordVerify" placeholder="re-type password" id="pass2" onkeyup="checkPass(); return false;" required="" value="${userInstance?.password}" class="form-control"/>
<g:passwordField autocomplete="off" name="passwordRepeat" placeholder="re-type password" id="pass2" onkeyup="checkPass(); return false;" required="" value="${userInstance?.password}" class="form-control"/>
<span id="confirmMessage" class="confirmMessage"></span>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion syndication_admin/grails-app/views/user/editMyAccount.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
</label>

<div class="col-sm-5">
<g:passwordField autocomplete="off" placeholder="re-type password" id="pass2" onkeyup="checkPass(); return false;" name="passwordVerify" required="" value="${userInstance?.password}" class="form-control"/>
<g:passwordField autocomplete="off" placeholder="re-type password" id="pass2" onkeyup="checkPass(); return false;" name="passwordRepeat" required="" value="${userInstance?.password}" class="form-control"/>
<span id="confirmMessage" class="confirmMessage"></span>
</div>
</div>
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion syndication_storefront/grails-app/conf/BuildConfig.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ grails.project.dependency.resolution = {

plugins {
compile ":rest-client-builder:2.1.1"
compile "org.grails.plugins:syndication-model:2.0.3"
compile "org.grails.plugins:syndication-model:2.0.4"

compile ":bruteforce-defender:1.0.1-spring-security-core-2.0-RC4"
compile ":recaptcha:0.6.9"
Expand Down
Loading

0 comments on commit aff1a02

Please sign in to comment.