mirror of
https://github.com/cuigh/swirl
synced 2024-12-29 07:12:11 +00:00
Disable changing password for LDAP users
This commit is contained in:
parent
415d92fede
commit
32d66e3de6
@ -168,4 +168,5 @@ profile.title: Profile
|
|||||||
profile.description: User profiles.
|
profile.description: User profiles.
|
||||||
profile.field.password.current: Current password
|
profile.field.password.current: Current password
|
||||||
profile.field.password.new: New password
|
profile.field.password.new: New password
|
||||||
profile.field.password.confirm: Password confirmation
|
profile.field.password.confirm: Password confirmation
|
||||||
|
profile.password.warning: You are a LDAP user, can not modify password here.
|
@ -168,4 +168,5 @@ profile.title: 资料
|
|||||||
profile.description: 用户个人信息。
|
profile.description: 用户个人信息。
|
||||||
profile.field.password.current: 当前密码
|
profile.field.password.current: 当前密码
|
||||||
profile.field.password.new: 新密码
|
profile.field.password.new: 新密码
|
||||||
profile.field.password.confirm: 新密码确认
|
profile.field.password.confirm: 新密码确认
|
||||||
|
profile.password.warning: 你是 LDAP 认证用户,不支持在这里修改密码。
|
@ -45,7 +45,12 @@ func profileModifyInfo(ctx web.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func profilePassword(ctx web.Context) error {
|
func profilePassword(ctx web.Context) error {
|
||||||
m := newModel(ctx)
|
user, err := biz.User.GetByID(ctx.User().ID())
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
m := newModel(ctx).Set("User", user)
|
||||||
return ctx.Render("profile/password", m)
|
return ctx.Render("profile/password", m)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,9 +65,12 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<p class="control">
|
<p class="control">
|
||||||
<button class="button is-primary" type="submit">{{ i18n("button.update") }}</button>
|
<button class="button is-primary" type="submit"{{ if .User.Type == "ldap" }} disabled{{ end }}>{{ i18n("button.update") }}</button>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
{{ if .User.Type == "ldap" }}
|
||||||
|
<div class="notification is-warning" style="margin-top: 1.5em">{{ i18n("profile.password.warning") }}</div>
|
||||||
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user