$e = &$modx->Event;
if( $e->name == "OnWebPageInit"){
if( isset($_SESSION['mgrValidated']) ){
$url = $_SERVER['REQUEST_URI'];
$secureserver = "https://mysite.com";
$modx->sendRedirect($secureserver.$url);
}
}Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
* This problem can sometimes be caused by disabling or refusing to accept
cookies.Too many redirects occurred trying to open “https://mysite.com/”. This might occur if you open a page that is redirected to open another page which then is redirected to open the original page.
if( isset($_SESSION['mgrValidated']) ){
$modx->logEvent(29, 1, $secureserver.$url , $source= 'SSL');
$modx->sendRedirect($secureserver.$url);
}else{
if($encryption && !$ssl) {
// if SSL off and we are about to access a secure page then redirect
$modx->sendRedirect($secureserver.$url);
} else if ($ssl && !$encryption) {
// if SSL is on and we are about to acccess an unsecure page then redirect
$modx->sendRedirect($insecureserver.$url);
}
}//manager logged in
if( isset($_SESSION['mgrValidated']) ){
if($ssl){
//ntd - ssl activated
}else{
//activate ssl
$modx->sendRedirect($secureserver.$url);
}
}else{
if($ssl){
if($encryption){
//ntd - ssl activated
}else{
//deactivate ssl
$modx->sendRedirect($insecureserver.$url);
}
}else{
if($encryption){
$modx->sendRedirect($secureserver.$url);
}else{
//ntd - regular page
}
}
}