include_once 'etc/cs_config.php'; global $c_webserver; if (isset($c_webserver) and $c_webserver == 'lighttpd') { $path = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; } else { $path = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF']; } $path = str_replace('rss.php', '', $path); // start of execution time include_once 'functions/misc_functions.php'; $time_start = getmicrotime(); include_once 'classes/cs_environment.php'; include_once 'functions/curl_functions.php'; // needed for setting fileArray $environment = new cs_environment(); $environment->setCurrentContextID($_GET['cid']); $hash_manager = $environment->getHashManager(); $context_item = $environment->getCurrentContextItem(); $validated = false; if ($context_item->isOpenForGuests()) { $validated = true; } function setFileArray($item) { global $environment; $file_array = $item->getFileList()->to_Array(); $file_name_array = array(); foreach ($file_array as $file) { $file_name_array[htmlentities($file->getDisplayName(), ENT_NOQUOTES, 'UTF-8')] = $file; } $environment->getTextConverter()->setFileArray($file_name_array);
// // You have received a copy of the GNU General Public License // along with CommSy. header("Content-type: text/css"); // load required classes chdir('../..'); include_once 'etc/cs_constants.php'; include_once 'etc/cs_config.php'; include_once 'classes/cs_environment.php'; // create environment of this page $color = $cs_color['DEFAULT']; // find out the room we're in if (!empty($_GET['cid'])) { $cid = $_GET['cid']; $environment = new cs_environment(); $environment->setCurrentContextID($cid); $room = $environment->getCurrentContextItem(); $color = $room->getColorArray(); } ?> /*General Settings */ body { margin: 0px; padding: 0px; width:800px; font-family: 'Trebuchet MS','lucida grande',tahoma,'ms sans serif',verdana,arial,sans-serif; font-size:80%; font-size-adjust:none; font-stretch:normal; font-style:normal;
if (!empty($_GET['cid']) and $_GET['cid'] > 99) { // transform POST_VARS and GET_VARS --- move into page object, if exist include_once 'functions/text_functions.php'; $_GET = encode(FROM_GET, $_GET); // multi master implementation $db = $environment->getConfiguration('db'); if (count($db) > 1) { if (!empty($_COOKIE['db_pid'])) { $environment->setDBPortalID($_COOKIE['db_pid']); } elseif (!empty($_GET['db_pid'])) { $environment->setDBPortalID($_GET['db_pid']); } } // multi master implementation - END // set current context $environment->setCurrentContextID($_GET['cid']); // get plugins from plugins $text1 = plugin_hook_output_all('getTextFormatingInformationAsHTML', '', BRLF); if (!empty($text1)) { $text1 = BRLF . $text1; } else { $text1 = ' '; } } // text $translator = $environment->getTranslationObject(); $text = $translator->getMessage('COMMON_TEXT_INCLUDING_MEDIA_TEXT_JS', $text1, $text2); if ($text === "COMMON_TEXT_INCLUDING_MEDIA_TEXT_JS") { $text = '<table> <tr> <td>
$fileHandle = fopen($fileName, 'r'); $csvContent = fgetcsv($fileHandle, 0, $delimiter, $enclosure); if (!$csvContent) { echo "CSV-Datei konnte nicht geladen werden!"; nl(); exit; } fclose($fileHandle); chdir('../../'); include_once('etc/cs_config.php'); include_once('classes/cs_environment.php'); global $environment; $environment = new cs_environment(); $environment->setCurrentContextID($newPortalId); $db_connector = $environment->getDBConnector(); global $c_send_email; $c_send_email = false; // get all rooms echo "Lade Rauminformationen..."; nl(); nl(); $roomManager = $environment->getRoomManager(); $roomManager->setContextLimit($oldPortalId); $roomManager->select(); $roomList = $roomManager->get(); // determine rooms to move $moveList = new cs_list();
if ($current_module != 'homepage' and $current_module != 'picture' and $current_module != 'context') { $current_module = 'homepage'; } if (!isset($_GET['fct'])) { if ($current_context != $environment->getServerID()) { $current_function = 'detail'; } else { $current_function = 'index'; } } elseif (isset($_GET['fct'])) { $current_function = $_GET['fct']; } if ($current_function != 'index' and $current_function != 'detail' and $current_function != 'edit' and $current_function != 'getfile' and $current_function != 'move' and $current_function != 'forward' and $current_function != 'logout' and $current_function != 'login') { $current_function = 'detail'; } $environment->setCurrentContextID($current_context); $environment->setCurrentModule($current_module); $environment->setCurrentFunction($current_function); unset($current_context); unset($current_module); unset($current_function); $context_item_current = $environment->getCurrentContextItem(); if ($environment->inPortal() or $environment->inServer()) { $class_factory->setDesignTo6(); } else { $class_factory->setDesignTo7(); } /*********** SERVER INITIALIZATION AND JUMP TO HOMEPAGE INDEX ***********/ // send user to ... // homepage overview, if cid in URL was empty or current context does not exist if ($cid_not_set) {
$current_module = 'home'; $current_function = 'index'; } else { if (!isset($_GET['mod']) or !isset($_GET['fct'])) { $current_module = 'home'; $current_function = 'index'; } else { if (isset($_GET['mod'])) { $current_module = $_GET['mod']; } 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']); } }
// get requested uri $uri = $_SERVER['REQUEST_URI']; // adjust uri $pattern = '/.*\\/commsy\\/(.*)/'; preg_match($pattern, $uri, $matches); $uri = $matches[1]; // try to get file id from scorm package $pattern = '/var\\/.*\\/.*\\/public\\/scorm\\/scorm_(.*).zip\\/.*/'; preg_match($pattern, $uri, $matches); if (isset($matches[1])) { $file_id = $matches[1]; // authentification $file_manager = $environment->getFileManager(); $file = $file_manager->getItem($file_id); unset($file_manager); // are we allowed to open this file? $link_manager = $environment->getLinkManager(); $material_id = $link_manager->getMaterialIDForFileID($file->getFileID()); $material_manager = $environment->getMaterialManager(); $material = $material_manager->getItem($material_id); unset($material_manager); $current_user = $environment->getCurrentUser(); // set current context $environment->setCurrentContextID($material->getContextID()); var_dump($environment->getCurrentContextItem()->mayEnter($current_user)); if (!($material->isNotActivated() && $current_user->getItemID() != $material->getCreatorID() && !$current_user->isModerator()) && $environment->getCurrentContextItem()->mayEnterByUserID($current_user->getUserID(), $current_user->getAuthSource())) { //($material->maySee($current_user) || $material->mayExternalSee($current_user))) { // deliver secured content readfile($uri); } }