Ejemplo n.º 1
0
     }
 }
 // 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;
     $errorbox_left = $class_factory->getClass(ERRORBOX_VIEW, $params);
     unset($params);
     $error_array = $authentication->getErrorArray();
     if (!empty($error_array)) {
         $error_string = implode('<br />', $error_array);
         $errorbox->setText($error_string);
     } else {
         $errorbox->setText($translator->getMessage('COMMON_ERROR'));
Ejemplo n.º 2
0
        }
        if (isset($_GET['fct'])) {
            $current_function = $_GET['fct'];
        }
    }
}
$environment->setCurrentContextID($current_context);
$environment->setCurrentModule($current_module);
$environment->setCurrentFunction($current_function);
unset($current_context);
#unset($current_module);
#unset($current_function);
// HTML text area corrections
$_POST = $environment->getTextConverter()->correctPostValuesForTextEditor($_POST);
// set output mode: default is html
if ($environment->getCurrentFunction() == 'index' and $environment->getCurrentModule() == type2Module(CS_MATERIAL_TYPE) or $environment->getCurrentModule() == 'ajax' or $environment->getCurrentModule() == 'scorm') {
    if (!empty($_GET['output'])) {
        $environment->setOutputMode($_GET['output']);
    } elseif (!empty($_POST['output'])) {
        $environment->setOutputMode($_POST['output']);
    }
}
if ($environment->inPortal() or $environment->inServer()) {
    $class_factory->setDesignTo6();
} else {
    $class_factory->setDesignTo7();
}
$server_item = $environment->getServerItem();
if ($server_item->showOutOfService()) {
    $current_context_id_save = $environment->getCurrentContextID();
    $current_module_save = $current_module;