diff --git a/i18n/en_US.json b/i18n/en_US.json index 1eea0d7..4fdc95e 100644 --- a/i18n/en_US.json +++ b/i18n/en_US.json @@ -1,4 +1,5 @@ { + "colon": ": ", "wide": "Wide", "isDelete": "Delete", "cancel": "Cancel", @@ -108,7 +109,6 @@ "test": "Test", "sign_up": "Sign Up", "team": "Team", - "colon": ": ", "sing_up_error": "Sign Up Error", "user_name_ruler": "Username only by az, AZ, 0-9, _ consisting of a length of 16", "password_no_match": "Password doesn't match the confirmation" diff --git a/i18n/ja_JP.json b/i18n/ja_JP.json index d8fa366..464bfbc 100644 --- a/i18n/ja_JP.json +++ b/i18n/ja_JP.json @@ -1,4 +1,5 @@ { + "colon": ":", "wide": "Wide", "isDelete": "削除", "cancel": "取消", @@ -108,7 +109,6 @@ "test": "テスト", "sign_up": "登録", "team": "チーム", - "colon": ":", "sing_up_error": "登録に失敗しました", "user_name_ruler": "16の長さからなる_ AZ、AZ、0-9、によってユーザ名のみ", "password_no_match": "一貫性のないパスワード入力" diff --git a/i18n/zh_CN.json b/i18n/zh_CN.json index 17c5c74..25cc3a8 100644 --- a/i18n/zh_CN.json +++ b/i18n/zh_CN.json @@ -1,4 +1,5 @@ { + "colon": ":", "wide": "Wide", "isDelete": "是否删除", "cancel": "取消", @@ -108,7 +109,6 @@ "test": "测试", "sign_up": "注册", "team": "团队", - "colon": ":", "sing_up_error": "注册失败", "user_name_ruler": "用户名只能由 a-z, A-Z, 0-9, _ 组成,长度为16", "password_no_match": "密码输入不一致" diff --git a/i18n/zh_TW.json b/i18n/zh_TW.json index 96abd7f..3c803f8 100644 --- a/i18n/zh_TW.json +++ b/i18n/zh_TW.json @@ -1,4 +1,5 @@ { + "colon": ":", "wide": "Wide", "isDelete": "己删除否?", "cancel": "取消", @@ -108,7 +109,6 @@ "test": "測試", "sign_up": "註冊", "team": "團隊", - "colon": ":", "sing_up_error": "註冊失敗", "user_name_ruler": "用戶名只能由az, AZ, 0-9, _ 組成,長度為16", "password_no_match": "密碼輸入不一致" diff --git a/main.go b/main.go index d08688b..1bdf3e0 100644 --- a/main.go +++ b/main.go @@ -54,7 +54,16 @@ func indexHandler(w http.ResponseWriter, r *http.Request) { wideSession := session.WideSessions.New(httpSession) username := httpSession.Values["username"].(string) - locale := conf.Wide.GetUser(username).Locale + user := conf.Wide.GetUser(username) + if nil == user { + glog.Warningf("Not found user [%s]", username) + + http.Redirect(w, r, "/login", http.StatusFound) + + return + } + + locale := user.Locale wideSessions := session.WideSessions.GetByUsername(username) userConf := conf.Wide.GetUser(username) diff --git a/session/users.go b/session/users.go index 88a95c7..e691fd9 100644 --- a/session/users.go +++ b/session/users.go @@ -100,7 +100,8 @@ func SignUpUser(w http.ResponseWriter, r *http.Request) { dir := filepath.Dir(firstUserWorkspace) model := map[string]interface{}{"conf": conf.Wide, "i18n": i18n.GetAll(conf.Wide.Locale), - "locale": conf.Wide.Locale, "ver": conf.WideVersion, "dir": dir} + "locale": conf.Wide.Locale, "ver": conf.WideVersion, "dir": dir, + "pathSeparator": conf.PathSeparator} t, err := template.ParseFiles("views/sign_up.html") diff --git a/views/index.html b/views/index.html index a4d552a..7b5d0c0 100644 --- a/views/index.html +++ b/views/index.html @@ -83,7 +83,7 @@ {{.i18n.team}}
diff --git a/views/sign_up.html b/views/sign_up.html index 9c66650..8ce3b97 100644 --- a/views/sign_up.html +++ b/views/sign_up.html @@ -31,7 +31,7 @@
Workspace: -
{{.dir}}
+
{{.dir}}{{.pathSeparator}}