When Secure Pages is enabled on a site, some modules, like Ubercart's PayPal module, need to have additional entries added to secure pages configuration else they will fail in ways that are not clear to the site administrator.

The developers of these modules are (generally) aware of the issues, and some post it in their documentation. However, it would be nice for the other modules to be smart enough to make the changes themselves in an install or update hook. Such a thing would have saved me several days (and several gray hairs) getting the PayPal WPS set up on my site.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dandaman’s picture

Yeah, I'd be interested in this feature as well. I might work on some code for it; it seems what we need is a function to see if that path has been set in the Secure Pages list and then a function that makes it easy to add another page.

dandaman’s picture

Ohh, and it should probably set a message to the screen just so the user is notified that a new page was added to Secure Pages.

John Franklin’s picture

Version: » 6.x-1.8

I think that is a good start.

However, does this work regardless of the order they are installed? That is, if Secure Pages is installed and then Ubercart, UC can update the Secure Pages list in their install hook. However, if Secure Pages is installed *after* Ubercart, how will UC know to register their path?

longwave’s picture

Subscribe. Would be very useful to have a hook that can indicate paths that should be forced HTTPS or HTTP, or that should explicitly be allowed with either protocol.

dave_robinson’s picture

Version: 6.x-1.8 » 7.x-1.x-dev
Status: Active » Needs work
FileSize
1.51 KB

We had this requirement ourselves and I'm currently experimenting with the attached patch. It provides 2 hooks which allow other modules to add to the pages or ignore lists. The hooks are hook_securepages_pages and hook_securepages_ignore. The hook should return an array of additional path strings for the appropriate variable.
Aside from cleaning up the code this still needs documentation and tests.

longwave’s picture

For consistency with core it might be best if this hook had compatible or similar syntax to hook_admin_paths()

http://api.drupal.org/api/drupal/modules!system!system.api.php/function/...

Perhaps TRUE should mean SSL, FALSE should mean non-SSL and NULL should mean allow either?

John Franklin’s picture

Issue summary: View changes
FileSize
867 bytes

Might I suggest a somewhat tighter patch (attached) and a plea for a patch like this one or the one in #5.

John Franklin’s picture

Status: Needs work » Needs review

Marking needs review.