diff --git a/web/pgadmin/__init__.py b/web/pgadmin/__init__.py index b21d53030..db676c570 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 33bb834b5..48cb8cdec 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 %}
+{% endif %} {% endblock %} diff --git a/web/pgadmin/templates/security/forgot_password.html b/web/pgadmin/templates/security/forgot_password.html index 3b90b3cf1..4b9d4c8aa 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:') }}
+{% endif %} {% endblock %} diff --git a/web/pgadmin/templates/security/login_user.html b/web/pgadmin/templates/security/login_user.html index 8c14a5b4b..cae4398a8 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 %} {{ _('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 67dfff60a..7bd81138e 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 %} +{% endif %} {% endblock %}