diff --git a/doc/source/topics/settings.rst b/doc/source/topics/settings.rst index 72ba6c0312..a08172b4f9 100755 --- a/doc/source/topics/settings.rst +++ b/doc/source/topics/settings.rst @@ -182,6 +182,16 @@ element, do not close the modal after clicking outside of it) and ``"static"`` (show backdrop element outside the modal, do not close the modal after clicking on backdrop). +``disable_password_reveal`` +--------------------------- + +.. versionadded:: 2015.1(Kilo) + +Default: ``False`` + +Setting this to True will disable the reveal button for password fields, +including on the login form. + ``password_validator`` ---------------------- diff --git a/horizon/static/horizon/js/horizon.forms.js b/horizon/static/horizon/js/horizon.forms.js index 39bed198f3..ddbd12237b 100644 --- a/horizon/static/horizon/js/horizon.forms.js +++ b/horizon/static/horizon/js/horizon.forms.js @@ -197,9 +197,11 @@ horizon.addInitFunction(horizon.forms.init = function () { horizon.forms.handle_object_upload_source(); horizon.forms.datepicker(); - horizon.forms.add_password_fields_reveal_buttons($("body")); - horizon.modals.addModalInitFunction( - horizon.forms.add_password_fields_reveal_buttons); + if (!horizon.conf.disable_password_reveal) { + horizon.forms.add_password_fields_reveal_buttons($("body")); + horizon.modals.addModalInitFunction( + horizon.forms.add_password_fields_reveal_buttons); + } // Bind event handlers to confirm dangerous actions. $("body").on("click", "form button.btn-danger", function (evt) { diff --git a/horizon/templates/horizon/_conf.html b/horizon/templates/horizon/_conf.html index cccc0fafdd..c55e9da10b 100644 --- a/horizon/templates/horizon/_conf.html +++ b/horizon/templates/horizon/_conf.html @@ -42,6 +42,7 @@ angular.module('hz') fade_duration: {{ HORIZON_CONFIG.auto_fade_alerts.fade_duration|default:"1500" }}, types: {{ HORIZON_CONFIG.auto_fade_alerts.types|default:"[]"|safe }} }; + hzConfig.disable_password_reveal = {{ HORIZON_CONFIG.disable_password_reveal|yesno:"true,false" }}; }]); diff --git a/openstack_dashboard/local/local_settings.py.example b/openstack_dashboard/local/local_settings.py.example index 07ba24b3a4..0b361a0d24 100644 --- a/openstack_dashboard/local/local_settings.py.example +++ b/openstack_dashboard/local/local_settings.py.example @@ -82,6 +82,10 @@ HORIZON_CONFIG = { # the database creation workflow if so desired. # HORIZON_CONFIG["password_autocomplete"] = "off" +# Setting this to True will disable the reveal button for password fields, +# including on the login form. +# HORIZON_CONFIG["disable_password_reveal"] = False + LOCAL_PATH = os.path.dirname(os.path.abspath(__file__)) # Set custom secret key: