mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
Add password button.
This commit is contained in:
parent
efab90ef3f
commit
d2d4c411ab
@ -96,7 +96,7 @@ func UpdateUser(id string, user *User) bool {
|
||||
|
||||
user.UpdateUserHash()
|
||||
|
||||
affected, err := adapter.Engine.ID(core.PK{owner, name}).AllCols().Update(user)
|
||||
affected, err := adapter.Engine.ID(core.PK{owner, name}).Cols("displayName", "avatar", "affiliation", "tag", "isAdmin", "isGlobalAdmin", "isForbidden").Update(user)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@ -224,7 +224,9 @@ func GetUserField(user *User, field string) string {
|
||||
}
|
||||
|
||||
func GetMaskedUser(user *User) *User {
|
||||
if user.Password != "" {
|
||||
user.Password = "***"
|
||||
}
|
||||
return user
|
||||
}
|
||||
|
||||
|
@ -266,9 +266,11 @@ class UserEditPage extends React.Component {
|
||||
{i18next.t("general:Password")}:
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Input value={this.state.user.password} onChange={e => {
|
||||
this.updateUserField('password', e.target.value);
|
||||
}} />
|
||||
<Row>
|
||||
<Button type="default">
|
||||
{this.state.user.password === "" ? i18next.t("user:Set password...") : i18next.t("user:Modify password...")}
|
||||
</Button>
|
||||
</Row>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: '20px'}} >
|
||||
|
@ -89,6 +89,8 @@
|
||||
"Upload a photo": "Upload a photo",
|
||||
"Select a photo...": "Select a photo...",
|
||||
"Set new profile picture": "Set new profile picture",
|
||||
"Set password...": "Set password...",
|
||||
"Modify password...": "Modify password...",
|
||||
"Affiliation": "Affiliation",
|
||||
"Tag": "Tag",
|
||||
"Third-party logins": "Third-party logins",
|
||||
|
@ -91,6 +91,8 @@
|
||||
"Upload a photo": "上传头像",
|
||||
"Select a photo...": "选择图片...",
|
||||
"Set new profile picture": "设置新头像",
|
||||
"Set password...": "设置密码...",
|
||||
"Modify password...": "修改密码...",
|
||||
"Affiliation": "工作单位",
|
||||
"Tag": "标签",
|
||||
"Third-party logins": "第三方登录",
|
||||
|
Loading…
x
Reference in New Issue
Block a user