##// END OF EJS Templates
show ip for my account, and only in editing your user, showing in all users next to API key is misleading
marcink -
r3455:d5ae996e beta
parent child Browse files
Show More
@@ -38,7 +38,7 b' from pylons.i18n.translation import _'
38 from rhodecode.lib import helpers as h
38 from rhodecode.lib import helpers as h
39 from rhodecode.lib.auth import LoginRequired, HasPermissionAllDecorator, \
39 from rhodecode.lib.auth import LoginRequired, HasPermissionAllDecorator, \
40 HasPermissionAnyDecorator, NotAnonymous, HasPermissionAny,\
40 HasPermissionAnyDecorator, NotAnonymous, HasPermissionAny,\
41 HasReposGroupPermissionAll, HasReposGroupPermissionAny
41 HasReposGroupPermissionAll, HasReposGroupPermissionAny, AuthUser
42 from rhodecode.lib.base import BaseController, render
42 from rhodecode.lib.base import BaseController, render
43 from rhodecode.lib.celerylib import tasks, run_task
43 from rhodecode.lib.celerylib import tasks, run_task
44 from rhodecode.lib.utils import repo2db_mapper, invalidate_cache, \
44 from rhodecode.lib.utils import repo2db_mapper, invalidate_cache, \
@@ -409,6 +409,8 b' class SettingsController(BaseController)'
409 # url('admin_settings_my_account')
409 # url('admin_settings_my_account')
410
410
411 c.user = User.get(self.rhodecode_user.user_id)
411 c.user = User.get(self.rhodecode_user.user_id)
412 c.perm_user = AuthUser(user_id=self.rhodecode_user.user_id,
413 ip_addr=self.ip_addr)
412 c.ldap_dn = c.user.ldap_dn
414 c.ldap_dn = c.user.ldap_dn
413
415
414 if c.user.username == 'default':
416 if c.user.username == 'default':
@@ -440,6 +442,8 b' class SettingsController(BaseController)'
440 # url('admin_settings_my_account_update', id=ID)
442 # url('admin_settings_my_account_update', id=ID)
441 uid = self.rhodecode_user.user_id
443 uid = self.rhodecode_user.user_id
442 c.user = User.get(self.rhodecode_user.user_id)
444 c.user = User.get(self.rhodecode_user.user_id)
445 c.perm_user = AuthUser(user_id=self.rhodecode_user.user_id,
446 ip_addr=self.ip_addr)
443 c.ldap_dn = c.user.ldap_dn
447 c.ldap_dn = c.user.ldap_dn
444 email = self.rhodecode_user.email
448 email = self.rhodecode_user.email
445 _form = UserForm(edit=True,
449 _form = UserForm(edit=True,
@@ -43,11 +43,14 b''
43 <label>${_('API key')}:</label> ${c.user.api_key}
43 <label>${_('API key')}:</label> ${c.user.api_key}
44 </div>
44 </div>
45 </div>
45 </div>
46 ##show current ip just if we show ourself
47 %if c.rhodecode_user.username == c.user.username:
46 <div class="field">
48 <div class="field">
47 <div class="label">
49 <div class="label">
48 <label>${_('Current IP')}:</label> ${c.perm_user.ip_addr or "?"}
50 <label>${_('Current IP')}:</label> ${c.perm_user.ip_addr or "?"}
49 </div>
51 </div>
50 </div>
52 </div>
53 %endif
51 <div class="fields">
54 <div class="fields">
52 <div class="field">
55 <div class="field">
53 <div class="label">
56 <div class="label">
@@ -20,6 +20,11 b''
20 <label>${_('API key')}</label> ${c.user.api_key}
20 <label>${_('API key')}</label> ${c.user.api_key}
21 </div>
21 </div>
22 </div>
22 </div>
23 <div class="field">
24 <div class="label">
25 <label>${_('Current IP')}:</label> ${c.perm_user.ip_addr or "?"}
26 </div>
27 </div>
23 <div class="fields">
28 <div class="fields">
24 <div class="field">
29 <div class="field">
25 <div class="label">
30 <div class="label">
General Comments 0
You need to be logged in to leave comments. Login now