##// END OF EJS Templates
auth: disable password change form for accounts that are not managed by RhodeCode....
marcink -
r1275:b650c2de default
parent child Browse files
Show More
@@ -81,6 +81,9 b' class MyAccountController(BaseController'
81 81 " crucial for entire application"), category='warning')
82 82 return redirect(url('users'))
83 83
84 c.auth_user = AuthUser(
85 user_id=c.rhodecode_user.user_id, ip_addr=self.ip_addr)
86
84 87 def _load_my_repos_data(self, watched=False):
85 88 if watched:
86 89 admin = False
@@ -109,8 +112,7 b' class MyAccountController(BaseController'
109 112 # url('my_account')
110 113 c.active = 'profile_edit'
111 114 self.__load_data()
112 c.perm_user = AuthUser(user_id=c.rhodecode_user.user_id,
113 ip_addr=self.ip_addr)
115 c.perm_user = c.auth_user
114 116 c.extern_type = c.user.extern_type
115 117 c.extern_name = c.user.extern_name
116 118
@@ -182,8 +184,7 b' class MyAccountController(BaseController'
182 184 """
183 185 c.active = 'profile_edit'
184 186 self.__load_data()
185 c.perm_user = AuthUser(user_id=c.rhodecode_user.user_id,
186 ip_addr=self.ip_addr)
187 c.perm_user = c.auth_user
187 188 c.extern_type = c.user.extern_type
188 189 c.extern_name = c.user.extern_name
189 190
@@ -199,6 +200,7 b' class MyAccountController(BaseController'
199 200 def my_account_password(self):
200 201 c.active = 'password'
201 202 self.__load_data()
203 c.extern_type = c.user.extern_type
202 204
203 205 schema = user_schema.ChangePasswordSchema().bind(
204 206 username=c.rhodecode_user.username)
@@ -206,7 +208,7 b' class MyAccountController(BaseController'
206 208 form = forms.Form(schema,
207 209 buttons=(forms.buttons.save, forms.buttons.reset))
208 210
209 if request.method == 'POST':
211 if request.method == 'POST' and c.extern_type == 'rhodecode':
210 212 controls = request.POST.items()
211 213 try:
212 214 valid_data = form.validate(controls)
@@ -254,8 +256,7 b' class MyAccountController(BaseController'
254 256 def my_account_perms(self):
255 257 c.active = 'perms'
256 258 self.__load_data()
257 c.perm_user = AuthUser(user_id=c.rhodecode_user.user_id,
258 ip_addr=self.ip_addr)
259 c.perm_user = c.auth_user
259 260
260 261 return render('admin/my_account/my_account.html')
261 262
@@ -1,5 +1,13 b''
1 1 <%namespace name="widgets" file="/widgets.html"/>
2 2
3 3 <%widgets:panel title="${_('Change Your Account Password')}">
4
5 % if c.extern_type != 'rhodecode':
6 <p>${_('Your user account details are managed by an external source. Details cannot be managed here.')}
7 <br/>${_('Source type')}: <strong>${c.extern_type}</strong>
8 </p>
9 % else:
4 10 ${c.form.render() | n}
11 % endif
12
5 13 </%widgets:panel>
@@ -15,7 +15,10 b''
15 15 <% disabled = "disabled" %>
16 16 <div class="infoform">
17 17 <div class="fields">
18 <p>${_('Your user account details are managed by an external source, i.e. LDAP. Details cannot be managed here.')}.</p>
18 <p>${_('Your user account details are managed by an external source. Details cannot be managed here.')}
19 <br/>${_('Source type')}: <strong>${c.extern_type}</strong>
20 </p>
21
19 22 <div class="field">
20 23 <div class="label">
21 24 <label for="username">${_('Username')}:</label>
General Comments 0
You need to be logged in to leave comments. Login now