diff options
author | Martin van Beurden <chadoe@gmail.com> | 2014-09-14 19:35:22 +0200 |
---|---|---|
committer | Martin van Beurden <chadoe@gmail.com> | 2014-09-18 20:50:48 +0200 |
commit | 0055cbd3651ebde0f8b6cc70c9c44de56dc38830 (patch) | |
tree | 64a9ea617ba1f704139881c3960fa2425dad9018 /routers/org | |
parent | 4f74b4e6578be4251af65cd08daa37c884e431a0 (diff) | |
download | gitea-0055cbd3651ebde0f8b6cc70c9c44de56dc38830.tar.gz gitea-0055cbd3651ebde0f8b6cc70c9c44de56dc38830.zip |
Allow Gogs to run from a suburl behind a reverse proxy. e.g. http://mydomain.com/gogs/
Conflicts:
modules/setting/setting.go
Conflicts:
templates/repo/release/list.tmpl
templates/user/dashboard/dashboard.tmpl
Conflicts:
routers/repo/setting.go
Diffstat (limited to 'routers/org')
-rw-r--r-- | routers/org/members.go | 3 | ||||
-rw-r--r-- | routers/org/org.go | 3 | ||||
-rw-r--r-- | routers/org/setting.go | 9 |
3 files changed, 9 insertions, 6 deletions
diff --git a/routers/org/members.go b/routers/org/members.go index 823daec948..d3bd51eae8 100644 --- a/routers/org/members.go +++ b/routers/org/members.go @@ -11,6 +11,7 @@ import ( "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/middleware" + "github.com/gogits/gogs/modules/setting" ) const ( @@ -86,7 +87,7 @@ func MembersAction(ctx *middleware.Context) { if ctx.Params(":action") != "leave" { ctx.Redirect(ctx.Org.OrgLink + "/members") } else { - ctx.Redirect("/") + ctx.Redirect(setting.AppRootSubUrl + "/") } } diff --git a/routers/org/org.go b/routers/org/org.go index 27ccf02d3f..cea70823af 100644 --- a/routers/org/org.go +++ b/routers/org/org.go @@ -10,6 +10,7 @@ import ( "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/middleware" + "github.com/gogits/gogs/modules/setting" ) const ( @@ -82,5 +83,5 @@ func CreatePost(ctx *middleware.Context, form auth.CreateOrgForm) { } log.Trace("Organization created: %s", org.Name) - ctx.Redirect("/org/" + form.OrgName + "/dashboard") + ctx.Redirect(setting.AppRootSubUrl + "/org/" + form.OrgName + "/dashboard") } diff --git a/routers/org/setting.go b/routers/org/setting.go index f853ef0e8e..3d397c0c66 100644 --- a/routers/org/setting.go +++ b/routers/org/setting.go @@ -11,6 +11,7 @@ import ( "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/middleware" + "github.com/gogits/gogs/modules/setting" ) const ( @@ -48,7 +49,7 @@ func SettingsPost(ctx *middleware.Context, form auth.UpdateOrgSettingForm) { } else if err = models.ChangeUserName(org, form.OrgUserName); err != nil { if err == models.ErrUserNameIllegal { ctx.Flash.Error(ctx.Tr("form.illegal_username")) - ctx.Redirect("/org/" + org.LowerName + "/settings") + ctx.Redirect(setting.AppRootSubUrl + "/org/" + org.LowerName + "/settings") return } else { ctx.Handle(500, "ChangeUserName", err) @@ -72,7 +73,7 @@ func SettingsPost(ctx *middleware.Context, form auth.UpdateOrgSettingForm) { } log.Trace("Organization setting updated: %s", org.Name) ctx.Flash.Success(ctx.Tr("org.settings.update_setting_success")) - ctx.Redirect("/org/" + org.Name + "/settings") + ctx.Redirect(setting.AppRootSubUrl + "/org/" + org.Name + "/settings") } func SettingsDelete(ctx *middleware.Context) { @@ -86,13 +87,13 @@ func SettingsDelete(ctx *middleware.Context) { switch err { case models.ErrUserOwnRepos: ctx.Flash.Error(ctx.Tr("form.org_still_own_repo")) - ctx.Redirect("/org/" + org.LowerName + "/settings/delete") + ctx.Redirect(setting.AppRootSubUrl + "/org/" + org.LowerName + "/settings/delete") default: ctx.Handle(500, "DeleteOrganization", err) } } else { log.Trace("Organization deleted: %s", ctx.User.Name) - ctx.Redirect("/") + ctx.Redirect(setting.AppRootSubUrl + "/") } return } |