changed logger level for some if clauses.

This commit is contained in:
kunw 2016-04-05 11:29:47 +08:00
parent 69846a7a7c
commit 290cdebc42

View File

@ -34,7 +34,7 @@ type RegisterController struct {
func (rc *RegisterController) Get() { func (rc *RegisterController) Get() {
if !rc.SelfRegistration { if !rc.SelfRegistration {
log.Error("Registration is disabled when self-registration is off.\n") log.Warning("Registration is disabled when self-registration is off.")
rc.Redirect("/signIn", http.StatusFound) rc.Redirect("/signIn", http.StatusFound)
} }
@ -54,7 +54,7 @@ type AddUserController struct {
func (ac *AddUserController) Get() { func (ac *AddUserController) Get() {
if !ac.IsAdmin { if !ac.IsAdmin {
log.Error("Add user can only be used by admin role user.\n") log.Warning("Add user can only be used by admin role user.")
ac.Redirect("/signIn", http.StatusFound) ac.Redirect("/signIn", http.StatusFound)
} }
@ -73,7 +73,7 @@ func (cc *CommonController) SignUp() {
} }
if !(cc.SelfRegistration || cc.IsAdmin) { if !(cc.SelfRegistration || cc.IsAdmin) {
log.Error("Registration can only be used by admin role user when self-registration is off.\n") log.Warning("Registration can only be used by admin role user when self-registration is off.")
cc.CustomAbort(http.StatusForbidden, "") cc.CustomAbort(http.StatusForbidden, "")
} }