summaryrefslogtreecommitdiffstats
path: root/routers/org
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2017-10-15 05:24:24 +0300
committerLunny Xiao <xiaolunwen@gmail.com>2017-10-15 10:24:24 +0800
commit32ca299650277829b93994eca1508f9d84a5b667 (patch)
tree65cabe4bb9d3cefb9c253b73c087b2439c13ae2c /routers/org
parentf42dbdbae59600266d03357f9693c659adc9cab3 (diff)
downloadgitea-32ca299650277829b93994eca1508f9d84a5b667.tar.gz
gitea-32ca299650277829b93994eca1508f9d84a5b667.zip
Remove direct user adding to organization members (#2641)
Diffstat (limited to 'routers/org')
-rw-r--r--routers/org/members.go40
1 files changed, 0 insertions, 40 deletions
diff --git a/routers/org/members.go b/routers/org/members.go
index 1b74b5f740..aa3646d1e0 100644
--- a/routers/org/members.go
+++ b/routers/org/members.go
@@ -17,8 +17,6 @@ import (
const (
// tplMembers template for organization members page
tplMembers base.TplName = "org/member/members"
- // tplMemberInvite template for orgnization invite page
- tplMemberInvite base.TplName = "org/member/invite"
)
// Members render orgnization users page
@@ -94,41 +92,3 @@ func MembersAction(ctx *context.Context) {
ctx.Redirect(setting.AppSubURL + "/")
}
}
-
-// Invitation render organization invitation page
-func Invitation(ctx *context.Context) {
- org := ctx.Org.Organization
- ctx.Data["Title"] = org.FullName
- ctx.Data["PageIsOrgMembers"] = true
-
- if ctx.Req.Method == "POST" {
- uname := ctx.Query("uname")
- u, err := models.GetUserByName(uname)
- if err != nil {
- if models.IsErrUserNotExist(err) {
- ctx.Flash.Error(ctx.Tr("form.user_not_exist"))
- ctx.Redirect(ctx.Org.OrgLink + "/invitations/new")
- } else {
- ctx.Handle(500, " GetUserByName", err)
- }
- return
- }
-
- if u.IsOrganization() {
- ctx.Flash.Error(ctx.Tr("form.cannot_invite_org_to_org"))
- ctx.Redirect(ctx.Org.OrgLink + "/invitations/new")
- return
- }
-
- if err = org.AddMember(u.ID); err != nil {
- ctx.Handle(500, " AddMember", err)
- return
- }
-
- log.Trace("New member added(%s): %s", org.Name, u.Name)
- ctx.Redirect(ctx.Org.OrgLink + "/members")
- return
- }
-
- ctx.HTML(200, tplMemberInvite)
-}