diff --git a/config/galaxy.ini.sample b/config/galaxy.ini.sample index 5e9001f1974..f6308ea0a99 100644 --- a/config/galaxy.ini.sample +++ b/config/galaxy.ini.sample @@ -409,12 +409,11 @@ paste.app_factory = galaxy.web.buildapp:app_factory # Activation grace period (in hours). Activation is not forced (login is not # disabled) until grace period has passed. Users under grace period can't run -# jobs (see inactivity_box_content). Default is 3. Enter 0 to disable grace -# period. +# jobs. Enter 0 to disable grace period. # Users with OpenID logins have grace period forever. -#activation_grace_period = 0 +#activation_grace_period = 3 -# Used for warning box for inactive accounts (unable to run jobs). +# Shown in warning box to users that were not activated yet. # In use only if activation_grace_period is set. #inactivity_box_content = Your account has not been activated yet. Feel free to browse around and see what's available, but you won't be able to upload data or run jobs until you have verified your email address. diff --git a/lib/galaxy/config.py b/lib/galaxy/config.py index 46c7365a10d..0cb349d8670 100644 --- a/lib/galaxy/config.py +++ b/lib/galaxy/config.py @@ -197,8 +197,10 @@ class Configuration( object ): activation_email = kwargs.get( 'activation_email', None ) self.email_from = kwargs.get( 'email_from', activation_email ) self.user_activation_on = string_as_bool( kwargs.get( 'user_activation_on', False ) ) - self.activation_grace_period = kwargs.get( 'activation_grace_period', None ) - self.inactivity_box_content = kwargs.get( 'inactivity_box_content', None ) + self.activation_grace_period = int( kwargs.get( 'activation_grace_period', 3 ) ) + default_inactivity_box_content = ( "Your account has not been activated yet. Feel free to browse around and see what's available, but" + " you won't be able to upload data or run jobs until you have verified your email address." ) + self.inactivity_box_content = kwargs.get( 'inactivity_box_content', default_inactivity_box_content ) self.terms_url = kwargs.get( 'terms_url', None ) self.instance_resource_url = kwargs.get( 'instance_resource_url', None ) self.registration_warning_message = kwargs.get( 'registration_warning_message', None ) diff --git a/lib/galaxy/webapps/galaxy/controllers/root.py b/lib/galaxy/webapps/galaxy/controllers/root.py index 593129471f6..4f6829d2927 100644 --- a/lib/galaxy/webapps/galaxy/controllers/root.py +++ b/lib/galaxy/webapps/galaxy/controllers/root.py @@ -48,7 +48,6 @@ class RootController( controller.JSAppLauncher, UsesAnnotations ): def _get_extended_config( self, trans ): app = trans.app - configured_for_inactivity_warning = app.config.user_activation_on and app.config.inactivity_box_content is not None user_requests = bool( trans.user and ( trans.user.requests or app.security_agent.get_accessible_request_types( trans, trans.user ) ) ) config = { 'active_view' : 'analysis', @@ -59,7 +58,7 @@ class RootController( controller.JSAppLauncher, UsesAnnotations ): 'toolbox' : app.toolbox.to_dict( trans, in_panel=False ), 'toolbox_in_panel' : app.toolbox.to_dict( trans ), 'message_box_visible' : app.config.message_box_visible, - 'show_inactivity_warning' : configured_for_inactivity_warning and trans.user and not trans.user.active, + 'show_inactivity_warning' : app.config.user_activation_on and trans.user and not trans.user.active, # TODO: move to user 'user_requests' : user_requests } diff --git a/lib/galaxy/webapps/galaxy/controllers/user.py b/lib/galaxy/webapps/galaxy/controllers/user.py index 0351da17b14..8acb135afb1 100644 --- a/lib/galaxy/webapps/galaxy/controllers/user.py +++ b/lib/galaxy/webapps/galaxy/controllers/user.py @@ -633,9 +633,6 @@ class User( BaseUIController, UsesFormDefinitionsMixin, CreatesUsersMixin, Creat """ # Activation is forced and the user is not active yet. Check the grace period. activation_grace_period = trans.app.config.activation_grace_period - # Default value is 3 hours. - if activation_grace_period is None: - activation_grace_period = 3 delta = timedelta( hours=int( activation_grace_period ) ) time_difference = datetime.utcnow() - create_time return ( time_difference > delta or activation_grace_period == 0 ) diff --git a/lib/galaxy/webapps/tool_shed/config.py b/lib/galaxy/webapps/tool_shed/config.py index bb9d61571ce..c1c93249e06 100644 --- a/lib/galaxy/webapps/tool_shed/config.py +++ b/lib/galaxy/webapps/tool_shed/config.py @@ -81,9 +81,7 @@ class Configuration( object ): # Galaxy flavor Docker Image self.enable_galaxy_flavor_docker_image = string_as_bool( kwargs.get( "enable_galaxy_flavor_docker_image", "False" ) ) self.use_remote_user = string_as_bool( kwargs.get( "use_remote_user", "False" ) ) - self.user_activation_on = kwargs.get( 'user_activation_on', None ) - self.activation_grace_period = kwargs.get( 'activation_grace_period', None ) - self.inactivity_box_content = kwargs.get( 'inactivity_box_content', None ) + self.user_activation_on = None self.registration_warning_message = kwargs.get( 'registration_warning_message', None ) self.terms_url = kwargs.get( 'terms_url', None ) self.blacklist_location = kwargs.get( 'blacklist_file', None ) diff --git a/templates/base/base_panels.mako b/templates/base/base_panels.mako index de977726c68..0beaa5d6540 100644 --- a/templates/base/base_panels.mako +++ b/templates/base/base_panels.mako @@ -7,7 +7,7 @@ self.message_box_visible = app.config.message_box_visible self.show_inactivity_warning = False if trans.webapp.name == 'galaxy' and trans.user: - self.show_inactivity_warning = ( ( trans.user.active is False ) and ( app.config.user_activation_on ) and ( app.config.inactivity_box_content is not None ) ) + self.show_inactivity_warning = ( ( trans.user.active is False ) and ( app.config.user_activation_on ) ) self.overlay_visible=False self.active_view=None self.body_class=""