Mercurial > kallithea
comparison rhodecode/controllers/admin/settings.py @ 3455:d5ae996eed11 beta
show ip for my account, and only in editing your user, showing in all users next to API key is misleading
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Tue, 05 Mar 2013 11:39:30 +0100 |
parents | 7854097b189c |
children | a8f2d78d14ea |
comparison
equal
deleted
inserted
replaced
3454:867c4d7fd2d8 | 3455:d5ae996eed11 |
---|---|
36 from pylons.i18n.translation import _ | 36 from pylons.i18n.translation import _ |
37 | 37 |
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, \ |
45 set_rhodecode_config, repo_name_slug, check_git_version | 45 set_rhodecode_config, repo_name_slug, check_git_version |
46 from rhodecode.model.db import RhodeCodeUi, Repository, RepoGroup, \ | 46 from rhodecode.model.db import RhodeCodeUi, Repository, RepoGroup, \ |
407 GET /_admin/my_account Displays info about my account | 407 GET /_admin/my_account Displays info about my account |
408 """ | 408 """ |
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': |
415 h.flash(_("You can't edit this user since it's" | 417 h.flash(_("You can't edit this user since it's" |
416 " crucial for entire application"), category='warning') | 418 " crucial for entire application"), category='warning') |
438 # h.form(url('admin_settings_my_account_update'), | 440 # h.form(url('admin_settings_my_account_update'), |
439 # method='put') | 441 # method='put') |
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, |
446 old_data={'user_id': uid, 'email': email})() | 450 old_data={'user_id': uid, 'email': email})() |
447 form_result = {} | 451 form_result = {} |