summaryrefslogtreecommitdiffstats
path: root/routers/repo/setting.go
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-08-27 16:39:36 +0800
committerUnknwon <joe2010xtmf@163.com>2014-08-27 16:39:36 +0800
commit9baf2b38d025eaf1d9bbb10a4616c71813ea7054 (patch)
treea6b8f31a638f2ca286e2c99e1c43c48e59e9c9c6 /routers/repo/setting.go
parent50de06056be67ab8433fa796608e38004f2e8733 (diff)
downloadgitea-9baf2b38d025eaf1d9bbb10a4616c71813ea7054.tar.gz
gitea-9baf2b38d025eaf1d9bbb10a4616c71813ea7054.zip
Bug fix on organization
Diffstat (limited to 'routers/repo/setting.go')
-rw-r--r--routers/repo/setting.go19
1 files changed, 16 insertions, 3 deletions
diff --git a/routers/repo/setting.go b/routers/repo/setting.go
index 866c0cd936..24c1b13a5e 100644
--- a/routers/repo/setting.go
+++ b/routers/repo/setting.go
@@ -119,9 +119,22 @@ func SettingsPost(ctx *middleware.Context, form auth.RepoSettingForm) {
if ctx.Repo.Repository.Name != form.RepoName {
ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_repo_name"), SETTINGS_OPTIONS, nil)
return
- } else if !ctx.Repo.Owner.ValidtePassword(ctx.Query("password")) {
- ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_password"), SETTINGS_OPTIONS, nil)
- return
+ }
+
+ if ctx.Repo.Owner.IsOrganization() {
+ if !ctx.Repo.Owner.IsOrgOwner(ctx.User.Id) {
+ ctx.Error(404)
+ return
+ }
+ if !ctx.User.ValidtePassword(ctx.Query("password")) {
+ ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_password"), SETTINGS_OPTIONS, nil)
+ return
+ }
+ } else {
+ if !ctx.Repo.Owner.ValidtePassword(ctx.Query("password")) {
+ ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_password"), SETTINGS_OPTIONS, nil)
+ return
+ }
}
if err := models.DeleteRepository(ctx.Repo.Owner.Id, ctx.Repo.Repository.Id, ctx.Repo.Owner.Name); err != nil {