Skip to content

Commit

Permalink
Closes #14
Browse files Browse the repository at this point in the history
- Add postLoginUrl configuration options
- Fix an error with principalLink tag
- Change colors of button group on show user screen
  • Loading branch information
Sudhir Nimavat committed Aug 13, 2013
1 parent acc91da commit 28d2e4e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions grails-app/conf/DefaultNimbleConfig.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ nimble {
validregex = '[a-zA-Z0-9]*'
}
provision { active = false }

authentication {
postLoginUrl = "/"
}

}

fields {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class AuthController {
SecurityUtils.subject.login(authToken)
userService.createLoginRecord(request)

def targetUri = session.getAttribute(AuthController.TARGET) ?: "/"
def targetUri = session.getAttribute(AuthController.TARGET) ?: nimbleConfig.localusers.authentication.postLoginUrl
session.removeAttribute(AuthController.TARGET)

log.info("Authenticated user, $username")
Expand Down
2 changes: 1 addition & 1 deletion grails-app/taglib/NimbleAuthTagLib.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class NimbleAuthTagLib {
def principalLink = {attrs, body ->
def user = getUser()
if (user) {
new MarkupBuilder(out).a('href': createLink(controller: 'user', action: 'show', id: id), 'class': 'icon icon_user', body()) {}
new MarkupBuilder(out).a('href': createLink(controller: 'user', action: 'show', id: user.id), body()) {}
}
}

Expand Down
6 changes: 3 additions & 3 deletions grails-app/views/user/show.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@
<g:message code="nimble.link.edit" />
</g:link>
<g:if test="${user.external}">
<g:link controller="user" action="changelocalpassword" id="${user.id}" class="btn btn-small btn-info">
<g:link controller="user" action="changelocalpassword" id="${user.id}" class="btn btn-small btn-success">
<g:message code="nimble.link.changelocalpassword" />
</g:link>
</g:if>
<g:else>
<g:link controller="user" action="changepassword" id="${user.id}" class="btn btn-small btn-info">
<g:link controller="user" action="changepassword" id="${user.id}" class="btn btn-small btn-success">
<g:message code="nimble.link.changepassword" />
</g:link>
</g:else>
<a href="#" class="btn btn-warning btn-small dropdown-toggle" data-toggle="dropdown">
<a href="#" class="btn btn-info btn-small dropdown-toggle" data-toggle="dropdown">
<g:message code="nimble.link.more" default="More"/>
<span class="caret"></span>
</a>
Expand Down

0 comments on commit 28d2e4e

Please sign in to comment.