summaryrefslogtreecommitdiffstats
path: root/routers/admin/auths.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-03-05 18:08:42 -0500
committerUnknwon <u@gogs.io>2016-03-05 18:08:42 -0500
commit045f14fbd0e3553521f5092cf839be363c74a090 (patch)
tree9c82f5111c5c5262c97bd7936462fa4170e76b4f /routers/admin/auths.go
parent05d8664f15013b0159b3689bda84e89dd7be22fd (diff)
downloadgitea-045f14fbd0e3553521f5092cf839be363c74a090.tar.gz
gitea-045f14fbd0e3553521f5092cf839be363c74a090.zip
#1146 finsih UI work for access mode of collaborators
Collaborators have write access as default, and can be changed via repository collaboration settings page to change between read, write and admin.
Diffstat (limited to 'routers/admin/auths.go')
-rw-r--r--routers/admin/auths.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/routers/admin/auths.go b/routers/admin/auths.go
index c519d5a7e0..b9e86a1ef5 100644
--- a/routers/admin/auths.go
+++ b/routers/admin/auths.go
@@ -5,6 +5,8 @@
package admin
import (
+ "fmt"
+
"github.com/Unknwon/com"
"github.com/go-xorm/core"
@@ -218,11 +220,13 @@ func DeleteAuthSource(ctx *middleware.Context) {
if err = models.DeleteSource(source); err != nil {
switch err {
case models.ErrAuthenticationUserUsed:
- ctx.Flash.Error("form.still_own_user")
- ctx.Redirect(setting.AppSubUrl + "/admin/auths/" + ctx.Params(":authid"))
+ ctx.Flash.Error(ctx.Tr("admin.auths.still_in_used"))
default:
- ctx.Handle(500, "DeleteSource", err)
+ ctx.Flash.Error(fmt.Sprintf("DeleteSource: %v", err))
}
+ ctx.JSON(200, map[string]interface{}{
+ "redirect": setting.AppSubUrl + "/admin/auths/" + ctx.Params(":authid"),
+ })
return
}
log.Trace("Authentication deleted by admin(%s): %d", ctx.User.Name, source.ID)