Currently when an admin saves a user with autologout enabled configuration is written for each user's individual logout threshold.

This not only reduces the module's footprint, but allows for workflows where configuration changes should not be made on the production environment; only on staging or local environments.

Certain hosting providers (e.g. Pantheon) don't allow config to be written unless the site is flipped from (default) git mode into sftp mode, which means with autologout enabled users wouldn't be able to be saved.

All this said, I'm attaching a patch that exposes a admin setting to "Disable user-specific logout thresholds" that, if TRUE, hides the autologout threshold text field from the user edit form and does not set a autologout.user.uid configuration item on form submit.

Comments

caxy4 created an issue. See original summary.

caxy4’s picture

Uploading patch promised in description.

Status: Needs review » Needs work
naveenvalecha’s picture

arijits.drush’s picture

Adding settings on admin panel to enable or disable

user's individual logout threshold
naveenvalecha’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll

After posting patch, set it to N/R so that it would be testable on drupal ci

Status: Needs review » Needs work
arijits.drush’s picture

arijits.drush’s picture

Status: Needs work » Needs review
AsadKamil’s picture

Hi All,
It seems there are 2 errors while applying the patch.Please check

root@asad-Vostro-3550:/var/www/html/git/autologout# git apply -v autologout-admin_setting_disable_user_specific_threshold-2730737-4.patch 
autologout-admin_setting_disable_user_specific_threshold-2730737-4.patch:102: trailing whitespace.
	
autologout-admin_setting_disable_user_specific_threshold-2730737-4.patch:110: trailing whitespace.
	
Checking patch README.txt...
Checking patch autologout.api.php...
Checking patch autologout.info.yml...
Checking patch autologout.libraries.yml...
Checking patch autologout.links.menu.yml...
Checking patch autologout.module...
Checking patch autologout.permissions.yml...
Checking patch autologout.routing.yml...
Checking patch autologout.services.yml...
Checking patch composer.json...
Checking patch config/install/autologout.settings.yml...
Checking patch config/schema/autologout.schema.yml...
Checking patch js/autologout.js...
Checking patch src/AutologoutManager.php...
Checking patch src/AutologoutManagerInterface.php...
Checking patch src/Controller/AutologoutController.php...
Checking patch src/EventSubscriber/AutologoutSubscriber.php...
Checking patch src/Form/AutologoutBlockForm.php...
Checking patch src/Form/AutologoutSettingsForm.php...
Checking patch src/Plugin/Block/AutologoutWarningBlock.php...
Checking patch src/Tests/AutologoutAjaxTest.php...
Checking patch src/Tests/AutologoutSessionCleanupOnLoginTest.php...
Checking patch src/Tests/AutologoutTest.php...
Applied patch README.txt cleanly.
Applied patch autologout.api.php cleanly.
Applied patch autologout.info.yml cleanly.
Applied patch autologout.libraries.yml cleanly.
Applied patch autologout.links.menu.yml cleanly.
Applied patch autologout.module cleanly.
Applied patch autologout.permissions.yml cleanly.
Applied patch autologout.routing.yml cleanly.
Applied patch autologout.services.yml cleanly.
Applied patch composer.json cleanly.
Applied patch config/install/autologout.settings.yml cleanly.
Applied patch config/schema/autologout.schema.yml cleanly.
Applied patch js/autologout.js cleanly.
Applied patch src/AutologoutManager.php cleanly.
Applied patch src/AutologoutManagerInterface.php cleanly.
Applied patch src/Controller/AutologoutController.php cleanly.
Applied patch src/EventSubscriber/AutologoutSubscriber.php cleanly.
Applied patch src/Form/AutologoutBlockForm.php cleanly.
Applied patch src/Form/AutologoutSettingsForm.php cleanly.
Applied patch src/Plugin/Block/AutologoutWarningBlock.php cleanly.
Applied patch src/Tests/AutologoutAjaxTest.php cleanly.
Applied patch src/Tests/AutologoutSessionCleanupOnLoginTest.php cleanly.
Applied patch src/Tests/AutologoutTest.php cleanly.
warning: 2 lines add whitespace errors.
root@asad-Vostro-3550:/var/www/html/git/autologout# 
arijits.drush’s picture

Assigned: Unassigned » arijits.drush
arijits.drush’s picture

Fixed white space warning as define by "Asad"

git apply -v autologout-admin_setting_disable_user_specific_threshold-2730737-5.patch
Checking patch README.txt...
Checking patch autologout.api.php...
Checking patch autologout.info.yml...
Checking patch autologout.libraries.yml...
Checking patch autologout.links.menu.yml...
Checking patch autologout.module...
Checking patch autologout.permissions.yml...
Checking patch autologout.routing.yml...
Checking patch autologout.services.yml...
Checking patch composer.json...
Checking patch config/install/autologout.settings.yml...
Checking patch config/schema/autologout.schema.yml...
Checking patch js/autologout.js...
Checking patch src/AutologoutManager.php...
Checking patch src/AutologoutManagerInterface.php...
Checking patch src/Controller/AutologoutController.php...
Checking patch src/EventSubscriber/AutologoutSubscriber.php...
Checking patch src/Form/AutologoutBlockForm.php...
Checking patch src/Form/AutologoutSettingsForm.php...
Checking patch src/Plugin/Block/AutologoutWarningBlock.php...
Checking patch src/Tests/AutologoutAjaxTest.php...
Checking patch src/Tests/AutologoutSessionCleanupOnLoginTest.php...
Checking patch src/Tests/AutologoutTest.php...
Applied patch README.txt cleanly.
Applied patch autologout.api.php cleanly.
Applied patch autologout.info.yml cleanly.
Applied patch autologout.libraries.yml cleanly.
Applied patch autologout.links.menu.yml cleanly.
Applied patch autologout.module cleanly.
Applied patch autologout.permissions.yml cleanly.
Applied patch autologout.routing.yml cleanly.
Applied patch autologout.services.yml cleanly.
Applied patch composer.json cleanly.
Applied patch config/install/autologout.settings.yml cleanly.
Applied patch config/schema/autologout.schema.yml cleanly.
Applied patch js/autologout.js cleanly.
Applied patch src/AutologoutManager.php cleanly.
Applied patch src/AutologoutManagerInterface.php cleanly.
Applied patch src/Controller/AutologoutController.php cleanly.
Applied patch src/EventSubscriber/AutologoutSubscriber.php cleanly.
Applied patch src/Form/AutologoutBlockForm.php cleanly.
Applied patch src/Form/AutologoutSettingsForm.php cleanly.
Applied patch src/Plugin/Block/AutologoutWarningBlock.php cleanly.
Applied patch src/Tests/AutologoutAjaxTest.php cleanly.
Applied patch src/Tests/AutologoutSessionCleanupOnLoginTest.php cleanly.
Applied patch src/Tests/AutologoutTest.php cleanly.
ajits’s picture

Status: Needs review » Needs work

There are too many unnecessary file permission changes coming in from the patch. These needs to be fixed before asking for a review.

arijits.drush’s picture

arijits.drush’s picture

Status: Needs work » Needs review
arijits.drush’s picture

arijits.drush’s picture

lomasr’s picture

StatusFileSize
new42.85 KB

I applied the patch in #14 . Patch did not applied cleanly. Please see the screen.

ajits’s picture

Assigned: arijits.drush » Unassigned
arijits.drush’s picture

Used to work correct , Think new line added .
Here is the revised patch

arijits.drush’s picture

Assigned: Unassigned » arijits.drush
ruscoe’s picture

Rerolled patch against 8.x-1.x.

ruscoe’s picture

Patch in #22 contained a minor error.

bzoks’s picture

Rerolled patch #23 against the current version of 8.x-1.x.
Added missing schema change, default value and update hook.
Added clearing of already configured individual timeouts when they become disabled by admin setting.

bcizej’s picture

Status: Needs review » Reviewed & tested by the community

Tested, works good, thanks.

boshtian’s picture

Status: Reviewed & tested by the community » Needs work

I think the solution we have is still not good and needs additional work.

User specific settings are stored in user.data which is good.

The only thing missing is, that now by default each user can change the logout threshold and we don't have a setting to remove that. What we need to do is add additional setting for autologout, check if user can change the value in form_alter where we're adding this field and this is it.

bcizej’s picture

StatusFileSize
new9.46 KB

@boshtian And that is exactly what @bzoks patch does.

Here is a rerolled patch.

bcizej’s picture

Status: Needs work » Needs review
boshtian’s picture

Status: Needs review » Reviewed & tested by the community

OK, all clear. I got confused by the issue description.

Thanks for reroll, tested it, looks good.

  • boshtian committed d7bed03 on 8.x-1.x authored by bzoks
    Issue #2730737 by arijits.drush, ruscoe, benjamincizej, bzoks: Add admin...
boshtian’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.