Hi all,

I am currently using this module as part of a project at work and was having a tough time understanding the English in the labels and descriptions for the fields on the configuration screen.

As part of my project I have also been wanting to make it so that you can easily edit the session timeout if the user does not tick "Remember Me" when they login, without touching the variable set in settings.php.

So I made a patch to add in the functionality to control the timeout both on ticked and unticked "Remember Me", and at the same time I have tidied up the wording on the labels and descriptions of the current fields, as well as putting it all in nice tidy fieldsets to help with navigation of the interface.

To clarify, upgrades include:

  • New fieldset with option to override the default timeout with one of the options from the original list of time options (with one added time, 3 weeks)
  • Fieldsets to nicely organise the configuration options into logical sections
  • Tidied up wording in the labels and descriptions so that setting options was no longer like solving a challenge from the riddler

Patch will be included at the top of the comments.

Cheers,
iSylence

Comments

iSylence’s picture

Please don't hesitate to comment on any problems you can see that I can fix up here.

iSylence’s picture

It was pointed out to me by a colleague that to keep backwards compatibility I should include the option in the override for the unticked "Remember Me" to have a 0 option, as before there was the ability to just have the cookie duration set to session.

I have now added this in and will attach the patch to this comment.

nickl’s picture

Status: Needs review » Needs work

Great stuff! I am sure that I speak for everyone that these make some nice additions to the mix.

I am just quickly scanning through and these are some things I'd appreciate if you can have a look at please.

I see you add 1814400 and then removed , 15552000, 31104000. Since others might be using the settings that are now removed this will pose a problem but I am happy if you add new ones, no problem. To stay DRY and simplify adding to the list lets define the options once and just pass it to each form element, what do you think? You don't have to duplicate them to add the 0 option see what you can do with a shift or merge I'm sure there's something in the list of array functions that will help.

I don't understand why you are removing #descriptions and now substituting title for its purpose, this seems counter productive. At this point I am alarmed by things being removed for no reason, again additions and modifications make sense but we shouldn't have to remove anything, am I right? Unless I am missing something.

Another add or modify but don't remove: "This setting is ignored if Manage session lifetime (above) is disabled." might be useful to know, wan't you agree?

The same goes for comments: // If we have cookie lifetime set already then unset it.
These help our sanity when we've forgotten or, like yourself when the next person tries to work out what exactly we were trying to accomplish here =)

Don't include whitespace changes in the patch please have a look at interactive mode:

git add -p

Which will allow you to only use the hunks that we want instead of the silly whitespace.

I will make some time to install this during the week and get back with some more feedback.
Since we are obliged to maintain the D6 version as well may I ask that you back port and roll a patch for that too, if you don't mind.

Awesome to have you on board, keep up the good work!

iSylence’s picture

Hi nickl,

Great suggestions and thanks for a quick reply! I don't even know how I managed to delete those two other times to be honest, I had only intended to add a new one so good spotting there.

My reason for removing the #descriptions was just that I felt that the amount of text on the page was making things a bit convoluted but if you think it better that they be in there then I'll back you on that. Same goes for the commenting. :)

Thanks for the note on git add -p as well, I just have my vim set up to delete unnecessary whitespace from the end of lines, I don't actually mean to include those changes in my patches so that command will be most helpful. :)

Unfortunately at the moment at work I don't have the time to do any further work on this until possibly about this time next week, but if you would like to make those improvements to the patch then you are most welcome. If not I will look at making the changes as soon as I have time, along with looking at the D6 version and updating that.

Cheers,
iSylence

nickl’s picture

You know what, in retrospect, these are feature enhancements and not critical fixes which will pardon exclusion from the legacy implementation (D6) To be honest PHP 5.2 is rapidly getting out of my reach, unless we get at least +3 for its inclusion, the extra effort is not justified. I will even settle for +1, plus your +1 and my +1 would also make +3, that's fair right?

The interactive mode is available on several commands in git referred to either as -i or -p. In the beginning I found it odd mostly being uncertain which options to pick worried that I may loose something. But practice has proven even the most dodgy of the lot, arguably edit mode, will not even allow you to make a mistake. If anything I am uncertain when I committed something without git add -p and will habitually git reset HEAD^ to roll back the commit and quickly do it over so that I know its right, without even bothering to check since 9 times out of 10 its got junk. If you're not happy with what's been staged at any point, just q out of there and git reset will undo any mistakes, no sweat.

I also clean trailing whitespace and convert tabs by default and have no qualms to include whitespace fixes don't get me wrong but to aid with cherry picking they should preferably be done in their own patches so we don't have to worry that it changed anything and it wold probably make sense to touch all the source simultaneously to prevent future frustrations. These should include that irritating new line at end of file whitespace above any others. What do you say?

There's no rush take your time, much obliged! =) I am unlikely going to have a chance myself ether. Preoccupied with the next release of Luracast/Restler (see github) which is enjoying my free time right now. All good things...

nickl’s picture

Priority: Normal » Critical

@iSylence how is it going, are you making some time to wrap this up? I am very eager and excited to add your amazing additions so lets do this thing.

You know it's easier to quickly complete these things while still close by and fresh in memory, how quickly time flies and the cobwebs start settling. I'm marking it critical as every day that goes by increases the risk this patch going to dust and ashes, that would be a shame.

Looking forward to seeing your rerolled patch, can't wait.

Keep up the good work!

iSylence’s picture

Hi nickl!

Sorry it's taken me so long to come back to this, had a site release and general work busy-ness going on. I'll see about getting this done this week, one request, could you help me out by making a bulleted list of what you'd like me to change in the patch? There's a lot of text up there and I'm just a bit unsure of what I am to do and what I'm not to do haha.

If you could do that for me that would be excellent!

Cheers,
iSylence

nickl’s picture

Hope this helps:

* Add don't remove
* Keep it DRY don't duplicate
* ignore whitespace
* All things awesome

I was thinking about elaborating but that is what all the previous text is about and you did want to avoid that so I hope this helps.

Looking forward to review your masterpiece =)

iSylence’s picture

Thanks nickl,

Just for Drupal 7 as well right, or did you want it backported for 6?

I'll hopefully be able to work on this on Friday or in a bit of spare time next week.

iSylence

iSylence’s picture

Status: Needs work » Needs review
StatusFileSize
new5.36 KB

Hi nickl,

Finally got the patch here, sorry it's been so long coming, I thought it was going to be more work than it actually was so I allocated more time than I needed. No harm done I hope. :)

If I've made any mistakes or you need anything else done just let me know and I'll get it done this week, I promise this time. Really! :)

iSylence

nickl’s picture

Status: Needs review » Needs work

Looking good well done! =) Now that is what a patch should look like I want to frame it and put it on the wall.

Only one thing that I can see that may be a problem, please verify if I am mistaken.
This patch only includes the changes to the settings page but you are incorporating a new setting "override_session_default_lifetime" where is the implementation for that?

In the previous patch I see the following changed in remember_me.module.

if(variable_get('override_drupal_default_timeout') == TRUE) {
    if(variable_get('override_session_default_lifetime', 604800) != ini_get('session.cookie_lifetime')) {
        _remember_me_set_lifetime(variable_get('override_session_default_lifetime', 1814400));
    }
}

Is this not required anymore?

iSylence’s picture

Hi nickl!

You're right that should be in there, I'm not sure how I managed to miss that. Sorry about that, here's a re-rolled patch, it should be okay this time! :)

iSylence

gold’s picture

Issue summary: View changes
Status: Needs work » Reviewed & tested by the community

Woah... This has been here a long time...

This patch is currently being used by a few of our clients in the wild and is working well. And it has been for the last 4 years...

This is RTBC.

imkartik’s picture

@Gold Thanks for the initiative. Please let us know by when can we expect the new release of this project.

gold’s picture

@imkartik, I'm not actually involved with that side of things. However, there is currently a group that are going through the process of getting maintainership transferred to them. How long this takes is unknown to me.

rosk0’s picture

Priority: Critical » Major
Status: Reviewed & tested by the community » Needs review
StatusFileSize
new5.06 KB

Re-roll against latest dev.
Some small derivation from original patch is presented: I have removed added "Override default timeout" config section because 1) it was effectively duplicating already existing functionality 2) it wasn't actually working because hook_init() was using variable that is not exists(because of typo probably).

And it's totally not "Critical".