// second time a user get a commsy page if (isset($_COOKIE['SID'])) { // are cookies allowed? $session->setValue('cookie', '1'); // yes } else { $session->setValue('cookie', '0'); // no } } // commsy id in session and on current page is different // -> user manipulated the url // -> redirect to home index of the portal, if user != guest and user != root $session_commsy_id = $session->getValue('commsy_id'); if ($environment->inProjectRoom() or $environment->inCommunityRoom()) { $portal_id = $environment->getCurrentPortalID(); } else { $portal_id = $environment->getCurrentContextID(); } if ($session_commsy_id != $portal_id and $session->getValue('user_id') != 'guest' and $session->getValue('user_id') != 'root' and $environment->getCurrentFunction() != 'getfile') { redirect($session_commsy_id, 'homepage', 'index'); } $authentication = $environment->getAuthenticationObject(); $authentication->setModule($environment->getCurrentModule()); $authentication->setFunction($environment->getCurrentFunction()); // check, if user is allowed here in this context (no password uid evaluation) // and set current user if (!$authentication->check($session->getValue('user_id'), $session->getValue('auth_source')) and $environment->getCurrentFunction() != 'logout') { $params = array(); $params['environment'] = $environment; $params['with_modifying_actions'] = true;
} elseif (strtolower($environment->getCurrentFunction()) == 'getfile' and strtolower($environment->getCurrentModule()) == 'picture') { include_once 'pages/picture_getfile.php'; exit; } elseif (strtolower($environment->getCurrentFunction()) == 'getfile' and strtolower($environment->getCurrentModule()) == 'individual') { include_once 'pages/individual_getfile.php'; exit; // } elseif ($environment->getConfiguration("c_shibboleth_direct_login")) { } elseif ($shib_direct_login) { include_once 'pages/context_login.php'; exit; } else { // no session created // so create session and redirect to requested page $session = new cs_session_item(); $session->createSessionID('guest'); $current_portal_id = $environment->getCurrentPortalID(); if (!empty($current_portal_id)) { $session->setValue('commsy_id', $current_portal_id); } else { $server_id = $environment->getServerID(); if (!empty($server_id)) { $session->setValue('commsy_id', $server_id); } } // external reload to check javascript $session_manager = $environment->getSessionManager(); $session_manager->save($session); if (!$outofservice) { include_once 'pages/context_reload.php'; exit; } else {