diff --git a/web/pgadmin/__init__.py b/web/pgadmin/__init__.py index b21d530..db676c5 100644 --- a/web/pgadmin/__init__.py +++ b/web/pgadmin/__init__.py @@ -540,11 +540,8 @@ def create_app(app_name=None): ): abort(401) - if not config.SERVER_MODE: - @app.before_first_request - def before_first_request(): + if not config.SERVER_MODE and not current_user.is_authenticated: user = user_datastore.get_user(config.DESKTOP_USER) - # Throw an error if we failed to find the desktop user, to give # the sysadmin a hint. We'll continue to try to login anyway as # that'll through a nice 500 error for us. @@ -554,7 +551,6 @@ def create_app(app_name=None): % config.DESKTOP_USER ) abort(401) - login_user(user) @app.after_request diff --git a/web/pgadmin/templates/security/change_password.html b/web/pgadmin/templates/security/change_password.html index 33bb834..48cb8cd 100644 --- a/web/pgadmin/templates/security/change_password.html +++ b/web/pgadmin/templates/security/change_password.html @@ -1,6 +1,7 @@ {% extends "security/panel.html" %} {% block panel_title %}{{ _('%(appname)s Password Change', appname=config.APP_NAME) }}{% endblock %} {% block panel_body %} +{% if config.SERVER_MODE %}
{{ change_password_form.hidden_tag() }}
@@ -10,4 +11,5 @@
+{% endif %} {% endblock %} diff --git a/web/pgadmin/templates/security/forgot_password.html b/web/pgadmin/templates/security/forgot_password.html index 3b90b3c..4b9d4c8 100644 --- a/web/pgadmin/templates/security/forgot_password.html +++ b/web/pgadmin/templates/security/forgot_password.html @@ -1,6 +1,7 @@ {% extends "security/panel.html" %} {% block panel_title %}{{ _('Recover %(appname)s Password', appname=config.APP_NAME) }}{% endblock %} {% block panel_body %} +{% if config.SERVER_MODE %}

{{ _('Enter the email address for the user account you wish to recover the password for:') }}

{{ forgot_password_form.hidden_tag() }} @@ -9,4 +10,5 @@
+{% endif %} {% endblock %} diff --git a/web/pgadmin/templates/security/login_user.html b/web/pgadmin/templates/security/login_user.html index 8c14a5b..cae4398 100644 --- a/web/pgadmin/templates/security/login_user.html +++ b/web/pgadmin/templates/security/login_user.html @@ -1,6 +1,7 @@ {% extends "security/panel.html" %} {% block panel_title %}{{ _('%(appname)s Login', appname=config.APP_NAME) }}{% endblock %} {% block panel_body %} +{% if config.SERVER_MODE %}
{{ login_user_form.hidden_tag() }} {% set user_language = request.cookies.get('PGADMIN_LANGUAGE') or 'en' %} @@ -21,4 +22,5 @@
{{ _('Forgotten your password?', url=url_for('browser.forgot_password')) }} +{% endif %} {% endblock %} diff --git a/web/pgadmin/templates/security/reset_password.html b/web/pgadmin/templates/security/reset_password.html index 67dfff6..7bd8113 100644 --- a/web/pgadmin/templates/security/reset_password.html +++ b/web/pgadmin/templates/security/reset_password.html @@ -1,6 +1,7 @@ {% extends "security/panel.html" %} {% block panel_title %}{{ _('%(appname)s Password Reset', appname=config.APP_NAME) }}{% endblock %} {% block panel_body %} +{% if config.SERVER_MODE %}
{{ reset_password_form.hidden_tag() }} @@ -10,4 +11,5 @@
+{% endif %} {% endblock %}