aboutsummaryrefslogtreecommitdiffstats
path: root/routers/user/home.go
diff options
context:
space:
mode:
authorFlorian Kaiser <florian.kaiser@fnkr.net>2016-01-31 18:13:39 +0000
committerFlorian Kaiser <florian.kaiser@fnkr.net>2016-01-31 18:37:50 +0000
commitbba1847a8eb08dfc5a3302a23ee210b21e0e71d3 (patch)
treed6234dd75543736a1b77c148f2e19b5c82e3b688 /routers/user/home.go
parent9cf95e4e37419fd2856ec941922b5a0c74d155e1 (diff)
downloadgitea-bba1847a8eb08dfc5a3302a23ee210b21e0e71d3.tar.gz
gitea-bba1847a8eb08dfc5a3302a23ee210b21e0e71d3.zip
Everyone can see public repos
Diffstat (limited to 'routers/user/home.go')
-rw-r--r--routers/user/home.go18
1 files changed, 13 insertions, 5 deletions
diff --git a/routers/user/home.go b/routers/user/home.go
index fabe7b1f31..6e2135dca2 100644
--- a/routers/user/home.go
+++ b/routers/user/home.go
@@ -312,14 +312,22 @@ func showOrgProfile(ctx *middleware.Context) {
}
org := ctx.Org.Organization
- userId := ctx.User.Id
ctx.Data["Title"] = org.FullName
- if err := org.GetUserRepositories(userId); err != nil {
- ctx.Handle(500, "GetUserRepositories", err)
- return
+ if ctx.IsSigned {
+ if err := org.GetUserRepositories(ctx.User.Id); err != nil {
+ ctx.Handle(500, "GetUserRepositories", err)
+ return
+ }
+ ctx.Data["Repos"] = org.Repos
+ } else {
+ if repos, err := models.GetRepositories(org.Id, false); err != nil {
+ ctx.Handle(500, "GetRepositories", err)
+ return
+ } else {
+ ctx.Data["Repos"] = repos
+ }
}
- ctx.Data["Repos"] = org.Repos
if err := org.GetMembers(); err != nil {
ctx.Handle(500, "GetMembers", err)