From d44c44987f704e2d4343db8c252281c86adb4a71 Mon Sep 17 00:00:00 2001
From: Unknown <joe2010xtmf@163.com>
Date: Mon, 24 Mar 2014 06:50:11 -0400
Subject: [PATCH 1/3] Fix dashboard auto-log bug

---
 modules/middleware/auth.go | 2 +-
 web.go                     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/middleware/auth.go b/modules/middleware/auth.go
index 82c3367c48..64f75d75cf 100644
--- a/modules/middleware/auth.go
+++ b/modules/middleware/auth.go
@@ -21,7 +21,7 @@ type ToggleOptions struct {
 
 func Toggle(options *ToggleOptions) martini.Handler {
 	return func(ctx *Context) {
-		if options.SignOutRequire && ctx.IsSigned {
+		if options.SignOutRequire && ctx.IsSigned && ctx.Req.RequestURI != "/" {
 			ctx.Redirect("/")
 			return
 		}
diff --git a/web.go b/web.go
index 9a613dceb6..4236d8b31a 100644
--- a/web.go
+++ b/web.go
@@ -88,7 +88,7 @@ func runWeb(*cli.Context) {
 	reqSignOut := middleware.Toggle(&middleware.ToggleOptions{SignOutRequire: true})
 
 	// Routers.
-	m.Get("/", ignSignIn, routers.Home)
+	m.Get("/", reqSignIn, routers.Home)
 	m.Get("/issues", reqSignIn, user.Issues)
 	m.Get("/pulls", reqSignIn, user.Pulls)
 	m.Get("/stars", reqSignIn, user.Stars)

From 59bbddb3183c27cbb5fb7918cefd9bb3a763a410 Mon Sep 17 00:00:00 2001
From: Unknown <joe2010xtmf@163.com>
Date: Mon, 24 Mar 2014 07:36:38 -0400
Subject: [PATCH 2/3] Mirror fix

---
 CONTRIBUTING.md      |  2 ++
 README.md            |  6 ++++--
 README_ZH.md         | 10 ++++++----
 gogs.go              |  2 +-
 models/repo.go       |  2 +-
 models/user.go       |  2 +-
 routers/repo/pull.go |  1 +
 web.go               |  5 +++--
 8 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 1b71d53136..17a3ebe68f 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -2,6 +2,8 @@
 
 > Thanks [drone](https://github.com/drone/drone) because this guidelines sheet is forked from its [CONTRIBUTING.md](https://github.com/drone/drone/blob/master/CONTRIBUTING.md).
 
+**This document is pre^3 release, we're not ready for receiving contribution until v0.5.0 release.**
+
 Want to hack on Gogs? Awesome! Here are instructions to get you started. They are probably not perfect, please let us know if anything feels wrong or incomplete.
 
 ## Contribution guidelines
diff --git a/README.md b/README.md
index 42eba6362d..104b7eab55 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-Gogs - Go Git Service [![wercker status](https://app.wercker.com/status/ad0bdb0bc450ac6f09bc56b9640a50aa/s/ "wercker status")](https://app.wercker.com/project/bykey/ad0bdb0bc450ac6f09bc56b9640a50aa) [![Build Status](https://drone.io/github.com/gogits/gogs/status.png)](https://drone.io/github.com/gogits/gogs/latest) [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/gogits/gogs/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
+Gogs - Go Git Service [![wercker status](https://app.wercker.com/status/ad0bdb0bc450ac6f09bc56b9640a50aa/s/ "wercker status")](https://app.wercker.com/project/bykey/ad0bdb0bc450ac6f09bc56b9640a50aa) [![Build Status](https://drone.io/github.com/gogits/gogs/status.png)](https://drone.io/github.com/gogits/gogs/latest)
 =====================
 
 Gogs(Go Git Service) is a Self Hosted Git Service in the Go Programming Language.
@@ -48,9 +48,11 @@ There are two ways to install Gogs:
 
 ## Acknowledgments
 
-- Logo is inspired by [martini](https://github.com/martini-contrib).
+- Logo is inspired by [martini-contrib](https://github.com/martini-contrib).
+- Router and middleware mechanism of [martini](http://martini.codegangsta.io/).
 - Mail Service, modules design is inspired by [WeTalk](https://github.com/beego/wetalk).
 - System Monitor Status is inspired by [GoBlog](https://github.com/fuxiaohei/goblog).
+- Usage and modification from [beego](http://beego.me) modules.
 
 ## Contributors
 
diff --git a/README_ZH.md b/README_ZH.md
index b405e04198..838e30a0ef 100644
--- a/README_ZH.md
+++ b/README_ZH.md
@@ -1,4 +1,4 @@
-Gogs - Go Git Service [![wercker status](https://app.wercker.com/status/ad0bdb0bc450ac6f09bc56b9640a50aa/s/ "wercker status")](https://app.wercker.com/project/bykey/ad0bdb0bc450ac6f09bc56b9640a50aa) [![Build Status](https://drone.io/github.com/gogits/gogs/status.png)](https://drone.io/github.com/gogits/gogs/latest) [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/gogits/gogs/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
+Gogs - Go Git Service [![wercker status](https://app.wercker.com/status/ad0bdb0bc450ac6f09bc56b9640a50aa/s/ "wercker status")](https://app.wercker.com/project/bykey/ad0bdb0bc450ac6f09bc56b9640a50aa) [![Build Status](https://drone.io/github.com/gogits/gogs/status.png)](https://drone.io/github.com/gogits/gogs/latest)
 =====================
 
 Gogs(Go Git Service) 是一个由 Go 语言编写的自助 Git 托管服务。
@@ -44,9 +44,11 @@ Gogs 完全使用 Go 语言来实现对 Git 数据的操作,实现 **零** 依
 
 ## 特别鸣谢
 
-- Logo 基于 [martini](https://github.com/martini-contrib) 修改而来。
-- 邮件服务、模块设计基于 [WeTalk](https://github.com/beego/wetalk) 修改而来。
-- 系统监视状态基于 [GoBlog](https://github.com/fuxiaohei/goblog) 修改而来。
+- Logo 基于 [martini-contrib](https://github.com/martini-contrib) 修改而来。
+- 基于 [WeTalk](https://github.com/beego/wetalk) 修改的邮件服务和模块设计。
+- 基于 [GoBlog](https://github.com/fuxiaohei/goblog) 修改的系统监视状态。
+- [beego](http://beego.me) 模块的使用与修改。
+- [martini](http://martini.codegangsta.io/) 的路由与中间件机制。
 
 ## 贡献成员
 
diff --git a/gogs.go b/gogs.go
index 09b28f9b3f..93b7231b77 100644
--- a/gogs.go
+++ b/gogs.go
@@ -20,7 +20,7 @@ import (
 // Test that go1.2 tag above is included in builds. main.go refers to this definition.
 const go12tag = true
 
-const APP_VER = "0.1.7.0323.1"
+const APP_VER = "0.1.7.0324"
 
 func init() {
 	base.AppVer = APP_VER
diff --git a/models/repo.go b/models/repo.go
index e27e99b056..f03d7683dd 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -387,7 +387,7 @@ func UpdateRepository(repo *Repository) error {
 		repo.Website = repo.Website[:255]
 	}
 
-	_, err := orm.Id(repo.Id).UseBool().Cols("description", "website").Update(repo)
+	_, err := orm.Id(repo.Id).UseBool().Cols("description", "website", "updated").Update(repo)
 	return err
 }
 
diff --git a/models/user.go b/models/user.go
index 7fd7449ce5..d2ed5a907d 100644
--- a/models/user.go
+++ b/models/user.go
@@ -211,7 +211,7 @@ func UpdateUser(user *User) (err error) {
 		user.Website = user.Website[:255]
 	}
 
-	_, err = orm.Id(user.Id).UseBool().Cols("website", "location", "is_active", "is_admin").Update(user)
+	_, err = orm.Id(user.Id).UseBool().Cols("email", "passwd", "avatar", "avatar_email", "website", "location", "is_active", "is_admin", "updated").Update(user)
 	return err
 }
 
diff --git a/routers/repo/pull.go b/routers/repo/pull.go
index d4a12a4a83..16c60389da 100644
--- a/routers/repo/pull.go
+++ b/routers/repo/pull.go
@@ -6,6 +6,7 @@ package repo
 
 import (
 	"github.com/codegangsta/martini"
+
 	"github.com/gogits/gogs/modules/middleware"
 )
 
diff --git a/web.go b/web.go
index 4236d8b31a..f0f8112579 100644
--- a/web.go
+++ b/web.go
@@ -31,9 +31,10 @@ import (
 
 var CmdWeb = cli.Command{
 	Name:  "web",
-	Usage: "just run",
+	Usage: "Gogs web server",
 	Description: `
-gogs web`,
+gogs web server is the only thing you need to run, 
+and it takes care of all the other things for you`,
 	Action: runWeb,
 	Flags:  []cli.Flag{},
 }

From ae92f92dee9007d1bef2db19331d9ee8f9883778 Mon Sep 17 00:00:00 2001
From: Unknown <joe2010xtmf@163.com>
Date: Mon, 24 Mar 2014 09:01:25 -0400
Subject: [PATCH 3/3] Locating issue

---
 models/action.go | 2 ++
 models/repo.go   | 2 +-
 models/user.go   | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/models/action.go b/models/action.go
index 1174929354..9471e9810e 100644
--- a/models/action.go
+++ b/models/action.go
@@ -92,10 +92,12 @@ func CommitRepoAction(userId int64, userName string,
 	// Update repository last update time.
 	repo, err := GetRepositoryByName(userId, repoName)
 	if err != nil {
+		log.Error("action.CommitRepoAction(GetRepositoryByName): %d/%s", userId, repo.LowerName)
 		return err
 	}
 	repo.IsBare = false
 	if err = UpdateRepository(repo); err != nil {
+		log.Error("action.CommitRepoAction(UpdateRepository): %d/%s", userId, repo.LowerName)
 		return err
 	}
 
diff --git a/models/repo.go b/models/repo.go
index f03d7683dd..a76966b057 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -387,7 +387,7 @@ func UpdateRepository(repo *Repository) error {
 		repo.Website = repo.Website[:255]
 	}
 
-	_, err := orm.Id(repo.Id).UseBool().Cols("description", "website", "updated").Update(repo)
+	_, err := orm.Id(repo.Id).AllCols().Update(repo)
 	return err
 }
 
diff --git a/models/user.go b/models/user.go
index d2ed5a907d..6ca16ec32e 100644
--- a/models/user.go
+++ b/models/user.go
@@ -211,7 +211,7 @@ func UpdateUser(user *User) (err error) {
 		user.Website = user.Website[:255]
 	}
 
-	_, err = orm.Id(user.Id).UseBool().Cols("email", "passwd", "avatar", "avatar_email", "website", "location", "is_active", "is_admin", "updated").Update(user)
+	_, err = orm.Id(user.Id).AllCols().Update(user)
 	return err
 }