aboutsummaryrefslogtreecommitdiff
path: root/go-src/user.go
diff options
context:
space:
mode:
authorSyndamia <kamen.d.mladenov@protonmail.com>2021-09-11 18:14:01 +0300
committerSyndamia <kamen.d.mladenov@protonmail.com>2021-09-11 18:14:01 +0300
commit501a530885c408a88c0fec0b38325410bd27e1d0 (patch)
tree19d5b657f000932efc46aac05103e8770d37de21 /go-src/user.go
parent8400b2398d09221953697b1e036f504b59575e69 (diff)
downloadctfc-501a530885c408a88c0fec0b38325410bd27e1d0.tar
ctfc-501a530885c408a88c0fec0b38325410bd27e1d0.tar.gz
ctfc-501a530885c408a88c0fec0b38325410bd27e1d0.zip
Updated user props names
Diffstat (limited to 'go-src/user.go')
-rw-r--r--go-src/user.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/go-src/user.go b/go-src/user.go
index 78501c7..9b49fd1 100644
--- a/go-src/user.go
+++ b/go-src/user.go
@@ -17,8 +17,8 @@ type User struct {
type UserProp int
const (
- passwordProp UserProp = iota + 1
- nameProp
+ userPasswordProp UserProp = iota + 1
+ userNameProp
)
func (u User) ValidatePassword(password string) bool {
@@ -35,9 +35,9 @@ func (u User) updateProp(currentPassword string, newValue string, userProp UserP
var fileContents []byte
switch userProp {
- case passwordProp:
+ case userPasswordProp:
fileContents = []byte(u.Username + "\n" + newValue + "\n" + u.Name)
- case nameProp:
+ case userNameProp:
fileContents = []byte(u.Username + "\n" + currentPassword + "\n" + newValue)
default:
return false
@@ -51,11 +51,11 @@ func (u User) updateProp(currentPassword string, newValue string, userProp UserP
}
func (u User) UpdatePassword(oldPassword string, newPassword string) bool {
- return u.updateProp(oldPassword, newPassword, passwordProp)
+ return u.updateProp(oldPassword, newPassword, userPasswordProp)
}
func (u User) UpdateName(password string, newName string) bool {
- return u.updateProp(password, newName, nameProp)
+ return u.updateProp(password, newName, userNameProp)
}
func logoutUser() {