summaryrefslogtreecommitdiffstats
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
parentf42dbdbae59600266d03357f9693c659adc9cab3 (diff)
downloadgitea-32ca299650277829b93994eca1508f9d84a5b667.tar.gz
gitea-32ca299650277829b93994eca1508f9d84a5b667.zip
Remove direct user adding to organization members (#2641)
-rw-r--r--options/locale/locale_en-US.ini2
-rw-r--r--routers/org/members.go40
-rw-r--r--routers/routes/routes.go2
-rw-r--r--templates/org/home.tmpl5
-rw-r--r--templates/org/member/invite.tmpl22
-rw-r--r--templates/org/member/members.tmpl6
6 files changed, 0 insertions, 77 deletions
diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini
index 9b5bd6dc51..dd9d05c1aa 100644
--- a/options/locale/locale_en-US.ini
+++ b/options/locale/locale_en-US.ini
@@ -274,7 +274,6 @@ enterred_invalid_password = Please ensure the that password you entered is corre
user_not_exist = The user does not exist.
last_org_owner = Removing the last user from the owner team is not allowed because there must always be at least one owner in any given organization.
cannot_add_org_to_team = Organization cannot be added as a team member.
-cannot_invite_org_to_org = Organization cannot be invited as an organization member.
invalid_ssh_key = Sorry, we were not able to verify your SSH key: %s
invalid_gpg_key = Sorry, we were not able to verify your GPG key: %s
@@ -1070,7 +1069,6 @@ org_name_helper = Great organization names are short and memorable.
create_org = Create Organization
repo_updated = Updated
people = People
-invite_someone = Invite Someone
teams = Teams
lower_members = members
lower_repositories = repositories
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)
-}
diff --git a/routers/routes/routes.go b/routers/routes/routes.go
index e6079445bb..ac71b5eba3 100644
--- a/routers/routes/routes.go
+++ b/routers/routes/routes.go
@@ -407,8 +407,6 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Route("/delete", "GET,POST", org.SettingsDelete)
})
-
- m.Route("/invitations/new", "GET,POST", org.Invitation)
}, context.OrgAssignment(true, true))
}, reqSignIn)
// ***** END: Organization *****
diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl
index 9b8b311666..18782e3981 100644
--- a/templates/org/home.tmpl
+++ b/templates/org/home.tmpl
@@ -52,11 +52,6 @@
{{end}}
{{end}}
</div>
- {{if .IsOrganizationOwner}}
- <div class="ui bottom attached segment">
- <a class="ui blue small button" href="{{.OrgLink}}/invitations/new">{{.i18n.Tr "org.invite_someone"}}</a>
- </div>
- {{end}}
{{if .IsOrganizationMember}}
<div class="ui top attached header">
diff --git a/templates/org/member/invite.tmpl b/templates/org/member/invite.tmpl
deleted file mode 100644
index e5d1575939..0000000000
--- a/templates/org/member/invite.tmpl
+++ /dev/null
@@ -1,22 +0,0 @@
-{{template "base/head" .}}
-<div class="organization invite">
- {{template "org/header" .}}
- <div class="ui container">
- <div id="invite-box">
- {{template "base/alert" .}}
- <h2>{{.i18n.Tr "org.members.invite_desc" .Org.DisplayName}}</h2>
- <form class="ui form" action="{{.Link}}" method="post">
- {{.CsrfTokenHtml}}
- <div class="inline field ui left">
- <div id="search-user-box" class="ui search">
- <div class="ui input">
- <input class="prompt" name="uname" placeholder="{{.i18n.Tr "repo.settings.search_user_placeholder"}}" autocomplete="off" autofocus required>
- </div>
- </div>
- </div>
- <button class="ui blue button">{{.i18n.Tr "org.members.invite_now"}}</button>
- </form>
- </div>
- </div>
-</div>
-{{template "base/footer" .}}
diff --git a/templates/org/member/members.tmpl b/templates/org/member/members.tmpl
index d7514d8ba7..e47008c89a 100644
--- a/templates/org/member/members.tmpl
+++ b/templates/org/member/members.tmpl
@@ -3,12 +3,6 @@
{{template "org/header" .}}
<div class="ui container">
{{template "base/alert" .}}
- {{if .IsOrganizationOwner}}
- <div class="text right">
- <a class="ui blue button" href="{{.OrgLink}}/invitations/new"><i class="octicon octicon-repo-create"></i> {{.i18n.Tr "org.invite_someone"}}</a>
- </div>
- <div class="ui divider"></div>
- {{end}}
<div class="list">
{{range .Members}}