Changeset - de9a3152c206
[Not reviewed]
default
0 2 0
Mads Kiilerich - 10 years ago 2015-07-31 15:44:07
madski@unity3d.com
auth: disable password change when not using internal auth
2 files changed with 14 insertions and 1 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/admin/my_account.py
Show inline comments
 
@@ -155,7 +155,11 @@ class MyAccountController(BaseController
 
    def my_account_password(self):
 
        c.active = 'password'
 
        self.__load_data()
 
        if request.POST:
 

	
 
        managed_fields = auth_modules.get_managed_fields(c.user)
 
        c.can_change_password = 'password' not in managed_fields
 

	
 
        if request.POST and c.can_change_password:
 
            _form = PasswordChangeForm(self.authuser.username)()
 
            try:
 
                form_result = _form.to_python(request.POST)
kallithea/templates/admin/my_account/my_account_password.html
Show inline comments
 
<div style="font-size: 20px; color: #666666; padding: 0px 0px 10px 0px">${_('Change Your Account Password')}</div>
 

	
 
%if c.can_change_password:
 

	
 
${h.form(url('my_account_password'), method='post')}
 
<div class="form">
 
    <div class="fields">
 
@@ -36,3 +39,9 @@ ${h.form(url('my_account_password'), met
 
    </div>
 
</div>
 
${h.end_form()}
 

	
 
%else:
 

	
 
${_('This account is managed with %s and the password cannot be changed here') % c.user.extern_type}
 

	
 
%endif
0 comments (0 inline, 0 general)