From c4c620b38bfae172f9c828ec7b7231d83e05a536 Mon Sep 17 00:00:00 2001 From: Marcin Kuzminski Date: Fri, 21 Feb 2020 22:03:35 +0100 Subject: [PATCH] user-accounts: show info about password for external accounts. --- rhodecode/apps/my_account/views/my_account.py | 1 + .../admin/my_account/my_account_auth_tokens.mako | 2 +- .../admin/my_account/my_account_password.mako | 4 +++- .../admin/my_account/my_account_profile.mako | 11 +++++++++++ .../my_account/my_account_profile_edit.mako | 16 +++++++++++----- 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/rhodecode/apps/my_account/views/my_account.py b/rhodecode/apps/my_account/views/my_account.py index 376103fb..38259723 100644 --- a/rhodecode/apps/my_account/views/my_account.py +++ b/rhodecode/apps/my_account/views/my_account.py @@ -76,6 +76,7 @@ class MyAccountView(BaseAppView, DataGridAppView): def my_account_profile(self): c = self.load_default_context() c.active = 'profile' + c.extern_type = c.user.extern_type return self._get_template_context(c) @LoginRequired() diff --git a/rhodecode/templates/admin/my_account/my_account_auth_tokens.mako b/rhodecode/templates/admin/my_account/my_account_auth_tokens.mako index 9bbd35b3..f489413e 100644 --- a/rhodecode/templates/admin/my_account/my_account_auth_tokens.mako +++ b/rhodecode/templates/admin/my_account/my_account_auth_tokens.mako @@ -71,7 +71,7 @@
${h.text('description', class_='medium', placeholder=_('Description'))} ${h.hidden('lifetime')} - ${h.select('role', '', c.role_options)} + ${h.select('role', request.GET.get('token_role', ''), c.role_options)} % if c.allow_scoped_tokens: ${h.hidden('scope_repo_id')} diff --git a/rhodecode/templates/admin/my_account/my_account_password.mako b/rhodecode/templates/admin/my_account/my_account_password.mako index 49c24194..9f29cca1 100644 --- a/rhodecode/templates/admin/my_account/my_account_password.mako +++ b/rhodecode/templates/admin/my_account/my_account_password.mako @@ -4,7 +4,9 @@ % if c.extern_type != 'rhodecode':

${_('Your user account details are managed by an external source. Details cannot be managed here.')} -
${_('Source type')}: ${c.extern_type} +
${_('For VCS access please generate')} + Authentication Token or SSH Key. +
${_('Source type')}: ${c.extern_type}

% else: ${c.form.render() | n} diff --git a/rhodecode/templates/admin/my_account/my_account_profile.mako b/rhodecode/templates/admin/my_account/my_account_profile.mako index 7877534f..96f2f734 100644 --- a/rhodecode/templates/admin/my_account/my_account_profile.mako +++ b/rhodecode/templates/admin/my_account/my_account_profile.mako @@ -8,6 +8,17 @@
+ %if c.extern_type != 'rhodecode': + <% readonly = "readonly" %> + <% disabled = " disabled" %> +
+ ${_('This user was created from external source (%s). Editing some of the settings is limited.' % c.extern_type)} +
+
+ ${_('For VCS access please generate')} + Authentication Token or SSH Key. +
+ %endif
${_('Photo')}: diff --git a/rhodecode/templates/admin/my_account/my_account_profile_edit.mako b/rhodecode/templates/admin/my_account/my_account_profile_edit.mako index 43a6394d..2f33d8e1 100644 --- a/rhodecode/templates/admin/my_account/my_account_profile_edit.mako +++ b/rhodecode/templates/admin/my_account/my_account_profile_edit.mako @@ -11,13 +11,19 @@ %if c.extern_type != 'rhodecode': <% readonly = "readonly" %> - <% disabled = "disabled" %> + <% disabled = " disabled" %> +
+ ${_('This user was created from external source (%s). Editing some of the settings is limited.' % c.extern_type)} +
+
+ ${_('For VCS access please generate')} + Authentication Token or SSH Key. +
+ %endif + + %if c.extern_type != 'rhodecode':
-

${_('Your user account details are managed by an external source. Details cannot be managed here.')} -
${_('Source type')}: ${c.extern_type} -

-