The attached patch allows an admin to specify a set of roles that should always be forced onto https, regardless of which path they're accessing.

This allows you to (for instance) easily specify that all authenticated users should always use https.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cafuego’s picture

FileSize
3.03 KB

I boo-booed in the patch and left a debug statement in. Removed in this version.

This version also works and doesn't match user roles against roles for which https enforcement is not enabled.

cafuego’s picture

FileSize
2.97 KB

Yet another version. I found array_filter(), so there's no need for a foreach() loop to clean up the enabled roles.

sime’s picture

Priority: Normal » Major
Status: Needs review » Reviewed & tested by the community
FileSize
2.97 KB

This works, new rolled patch with a smidge more info for the admin form.

dboulet’s picture

Would like to see this implemented in 7.x as well.

izmeez’s picture

subscribing

cafuego’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Reviewed & tested by the community » Needs review
FileSize
3 KB

Minimal effort to port the patch to 7.x-1.x

dboulet’s picture

Patch in #6 looks good to me.

grendzy’s picture

Assigned: Unassigned » grendzy
khaled.zaidan’s picture

Can we expect this to be committed to both 6 and 7?

thx

grendzy’s picture

Yes, I'm hoping to get this in the next release.

grendzy’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Needs review » Patch (to be ported)

With a few edits, and added tests, this has been committed to 7.x: 4b8f953.

Moving to 6.x.

grendzy’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Status: Patch (to be ported) » Fixed

Status: Fixed » Closed (fixed)

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