Skip to content

Remove direct user adding to organization members #2641

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
40 changes: 0 additions & 40 deletions routers/org/members.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
2 changes: 0 additions & 2 deletions routers/routes/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 *****
Expand Down
5 changes: 0 additions & 5 deletions templates/org/home.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
22 changes: 0 additions & 22 deletions templates/org/member/invite.tmpl

This file was deleted.

6 changes: 0 additions & 6 deletions templates/org/member/members.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down