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!

CommentFileSizeAuthor
#4 anonymous_back_to_http.patch2 KBmanuel.adan

Comments

Garrett Albright’s picture

Interesting idea. I'll look into it the next time I get the chance to work on this module.

josepvalls’s picture

I'll be looking forward for this. And again, I am willing to help. I may post my attempts for review.

manuel.adan’s picture

Subscribe it all, https requests spend more server resources than http, so it's pretty good idea redirect anonymous traffic to http.

manuel.adan’s picture

StatusFileSize
new2 KB

Finally I made a patch. Note that it only switch back to http for anonymous users.