aboutsummaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-04-03 16:33:27 -0400
committerUnknown <joe2010xtmf@163.com>2014-04-03 16:33:27 -0400
commite9c4156c874ceeecc81fdf7fe00ff2f582110ecd (patch)
tree091d17fbfa89444ab16c97d4c4b8da361a1c6ad8 /routers
parent79a610592ea7c2e93ab2f91190af1782c4aa8f8d (diff)
downloadgitea-e9c4156c874ceeecc81fdf7fe00ff2f582110ecd.tar.gz
gitea-e9c4156c874ceeecc81fdf7fe00ff2f582110ecd.zip
Add: rename user
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/repo.go2
-rw-r--r--routers/user/setting.go23
2 files changed, 18 insertions, 7 deletions
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index a55647a314..ae51c55139 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -291,7 +291,7 @@ func SettingPost(ctx *middleware.Context) {
ctx.RenderWithErr("Repository name has been taken in your repositories.", "repo/setting", nil)
return
} else if err = models.ChangeRepositoryName(ctx.Repo.Owner.Name, ctx.Repo.Repository.Name, newRepoName); err != nil {
- ctx.Handle(404, "repo.SettingPost(update)", err)
+ ctx.Handle(404, "repo.SettingPost(change repository name)", err)
return
}
log.Trace("%s Repository name changed: %s/%s -> %s", ctx.Req.RequestURI, ctx.User.Name, ctx.Repo.Repository.Name, newRepoName)
diff --git a/routers/user/setting.go b/routers/user/setting.go
index 75adf2b81d..4b6d88a362 100644
--- a/routers/user/setting.go
+++ b/routers/user/setting.go
@@ -23,15 +23,27 @@ func Setting(ctx *middleware.Context, form auth.UpdateProfileForm) {
user := ctx.User
ctx.Data["Owner"] = user
- if ctx.Req.Method == "GET" {
+ if ctx.Req.Method == "GET" || ctx.HasError() {
ctx.HTML(200, "user/setting")
return
}
- // below is for POST requests
- if hasErr, ok := ctx.Data["HasError"]; ok && hasErr.(bool) {
- ctx.HTML(200, "user/setting")
- return
+ // Check if user name has been changed.
+ if user.Name != form.UserName {
+ isExist, err := models.IsUserExist(form.UserName)
+ if err != nil {
+ ctx.Handle(404, "user.Setting(update: check existence)", err)
+ return
+ } else if isExist {
+ ctx.RenderWithErr("User name has been taken.", "user/setting", &form)
+ return
+ } else if err = models.ChangeUserName(user, form.UserName); err != nil {
+ ctx.Handle(404, "user.Setting(change user name)", err)
+ return
+ }
+ log.Trace("%s User name changed: %s -> %s", ctx.Req.RequestURI, user.Name, form.UserName)
+
+ user.Name = form.UserName
}
user.Email = form.Email
@@ -46,7 +58,6 @@ func Setting(ctx *middleware.Context, form auth.UpdateProfileForm) {
ctx.Data["IsSuccess"] = true
ctx.HTML(200, "user/setting")
-
log.Trace("%s User setting updated: %s", ctx.Req.RequestURI, ctx.User.LowerName)
}
='backport/43025/stable29'>backport/43025/stable29 Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
summaryrefslogtreecommitdiffstats
path: root/l10n/da/bookmarks.po
blob: 7d336705b21f1c60b95c212beaa7b95ccfe2bdbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# 
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: ownCloud\n"
"Report-Msgid-Bugs-To: http://bugs.owncloud.org/\n"
"POT-Creation-Date: 2012-07-28 02:02+0200\n"
"PO-Revision-Date: 2012-07-27 22:17+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Danish (http://www.transifex.com/projects/p/owncloud/language/da/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: da\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"

#: appinfo/app.php:14
msgid "Bookmarks"
msgstr ""

#: bookmarksHelper.php:99
msgid "unnamed"
msgstr ""

#: templates/bookmarklet.php:5
msgid ""
"Drag this to your browser bookmarks and click it, when you want to bookmark "
"a webpage quickly:"
msgstr ""

#: templates/bookmarklet.php:7
msgid "Read later"
msgstr ""

#: templates/list.php:13
msgid "Address"
msgstr ""

#: templates/list.php:14
msgid "Title"
msgstr ""

#: templates/list.php:15
msgid "Tags"
msgstr ""

#: templates/list.php:16
msgid "Save bookmark"
msgstr ""

#: templates/list.php:22
msgid "You have no bookmarks"
msgstr ""

#: templates/settings.php:11
msgid "Bookmarklet <br />"
msgstr ""