This module is very interesting and I am definitely interested in using it to replace some hacks I did myself. The only feature the I am missing is the capacity to switch back to http on user logout or maybe based on certain roles (annonymous users in my case).
I don't know much about Drupal and looks to me that it could be accomplished by a couple of lines around:
if (in_array($role, $re_roles)) {
// Redirect!
_secrole_direct();
}
My question then would be, whether it'd be necessary to have a secrole_server variable for the non https and a different function. I won't need that but it'd be better for the module, right? Maybe something like:
function _secrole_unsecure_direct() {
$server = variable_get('secrole_server_unsecure', '');
header('Location: ' . ($server === '' ? 'http://' . $_SERVER['HTTP_HOST'] : $server) . request_uri(), TRUE, 303);
}
Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | anonymous_back_to_http.patch | 2 KB | manuel.adan |
Comments
Comment #1
Garrett Albright commentedInteresting idea. I'll look into it the next time I get the chance to work on this module.
Comment #2
josepvalls commentedI'll be looking forward for this. And again, I am willing to help. I may post my attempts for review.
Comment #3
manuel.adanSubscribe it all, https requests spend more server resources than http, so it's pretty good idea redirect anonymous traffic to http.
Comment #4
manuel.adanFinally I made a patch. Note that it only switch back to http for anonymous users.