public function render() { $out = ''; if (!claro_is_user_authenticated()) { if (get_conf('claro_displayLocalAuthForm', true) == true) { $out .= $this->renderLoginLink(); } } elseif (!claro_is_platform_admin() && (claro_is_in_a_course() && !claro_is_course_member()) && claro_get_current_course_data('registrationAllowed')) { if (claro_is_current_user_enrolment_pending()) { $out .= '<img src="' . get_icon_url('warning') . '" alt="off" /> ' . '<b>' . get_lang('Enrolment pending') . '</b>'; } else { $out .= $this->renderRegistrationLink(); } } elseif (claro_is_display_mode_available()) { $out .= $this->renderViewModeSwitch(); } return $out; }
/** * Prepare the user banner */ private function _prepareUserBanner() { if (claro_is_user_authenticated()) { $userToolUrlListLeft = array(); $userToolUrlListRight = array(); if (get_conf('display_former_homepage')) { } $userToolUrlListLeft[] = '<a href="' . get_path('clarolineRepositoryWeb') . 'desktop/index.php" target="_top">' . get_lang('My desktop') . '</a>'; $userToolUrlListLeft[] = '<a href="' . get_path('clarolineRepositoryWeb') . 'messaging" target="_top">' . get_lang('My messages') . '</a>'; if (claro_is_platform_admin()) { $userToolUrlListLeft[] = '<a href="' . get_path('clarolineRepositoryWeb') . 'admin/" target="_top">' . get_lang('Platform administration') . '</a>'; } $userToolUrlListRight[] = '<a href="' . get_path('clarolineRepositoryWeb') . 'auth/profile.php" target="_top">' . get_lang('Manage my account') . '</a>'; $userToolUrlListRight[] = '<a href="' . get_path('url') . '/index.php?logout=true" target="_top">' . get_lang('Logout') . '</a>'; $this->assign('userToolListRight', $userToolUrlListRight); $this->assign('userToolListLeft', $userToolUrlListLeft); $this->showBlock('userBanner'); } else { $this->hideBlock('userBanner'); } }
public function event($type, $args = null) { if (!is_array($args)) { $args = array(); } if (!array_key_exists('cid', $args) && claro_is_in_a_course()) { $args['cid'] = claro_get_current_course_id(); } if (!array_key_exists('gid', $args) && claro_is_in_a_group()) { $args['gid'] = claro_get_current_group_id(); } if (!array_key_exists('tid', $args) && claro_is_in_a_tool()) { $args['tid'] = claro_get_current_tool_id(); // $args['tlabel'] = get_current_module_label(); } if (!array_key_exists('uid', $args) && claro_is_user_authenticated()) { $args['uid'] = claro_get_current_user_id(); } if (!array_key_exists('date', $args)) { $args['date'] = claro_date("Y-m-d H:i:00"); } $this->notifyEvent($type, $args); }
} ClaroBreadCrumbs::getInstance()->prepend(get_lang('Exercises'), 'exercise.php'); $out = ''; $nameTools = $exercise->getTitle(); //-- display properties if (trim($exercise->getDescription()) != '' || !($showResult && !$recordResults) && $exercise->getTimeLimit() > $currentTime) { $out .= '<blockquote>' . "\n" . claro_parse_user_text($exercise->getDescription()) . "\n" . '</blockquote>' . "\n"; } $out .= '<ul style="font-size:small">' . "\n"; if ($exercise->getDisplayType() == 'SEQUENTIAL' && $exercise->getTimeLimit() > 0 && (!$exercise->getAttempts() || $userAttemptCount <= $exercise->getAttempts()) && !($showResult && !$recordResults) && $exercise->getTimeLimit() > $currentTime && $startExercise) { $out .= '<li>' . get_lang('Current time') . ' : <span id="currentTime">' . claro_html_duration($currentTime) . '</span></li>' . "\n"; } if ($exercise->getTimeLimit() > 0 && (!$exercise->getAttempts() || $userAttemptCount <= $exercise->getAttempts()) && !($showResult && !$recordResults) && $exercise->getTimeLimit() > $currentTime) { $out .= '<li>' . get_lang('Time limit') . " : " . claro_html_duration($exercise->getTimeLimit()) . '</li>' . "\n"; } if (claro_is_user_authenticated() && isset($userAttemptCount) && (!$exercise->getAttempts() || $userAttemptCount <= $exercise->getAttempts()) && !($showResult && !$recordResults) && $exercise->getTimeLimit() > $currentTime) { if ($exercise->getAttempts() > 0) { $out .= '<li>' . get_lang('Attempt %attemptCount on %attempts', array('%attemptCount' => $userAttemptCount, '%attempts' => $exercise->getAttempts())) . '</li>' . "\n"; } } if (!is_null($exercise->getEndDate()) && !($showResult && !$recordResults) && $exercise->getTimeLimit() > $currentTime) { $out .= '<li>' . get_lang('Available from %startDate until %endDate', array('%startDate' => claro_html_localised_date(get_locale('dateTimeFormatLong'), $exercise->getStartDate()), '%endDate' => claro_html_localised_date(get_locale('dateTimeFormatLong'), $exercise->getEndDate()))) . '</li>' . "\n"; } $out .= '</ul>' . "\n\n"; if ($showResult) { if (isset($_SESSION['inPathMode']) && $_SESSION['inPathMode']) { // old learning path tool $out .= '<form method="get" action="../learnPath/navigation/backFromExercise.php">' . "\n" . '<input type="hidden" name="op" value="finish" />'; } elseif (!$inLP) { // standard exercise mode $out .= '<form method="get" action="exercise.php">';
// and claro_get_current_course_user_data() do the same job $_profileId = $_course_user_properties['privilege']['_profileId']; $is_courseMember = $_course_user_properties['privilege']['is_courseMember']; $is_courseTutor = $_course_user_properties['privilege']['is_courseTutor']; $is_courseAdmin = $_course_user_properties['privilege']['is_courseAdmin']; $_courseUser = claro_get_course_user_data($_cid, $_uid); } else { // course $_profileId = claro_get_profile_id('anonymous'); $is_courseMember = false; $is_courseAdmin = false; $is_courseTutor = false; $_courseUser = null; // not used } $is_courseAllowed = (bool) ($_course['visibility'] && ($_course['access'] == 'public' || $_course['access'] == 'platform' && claro_is_user_authenticated()) || $is_courseMember || $is_platformAdmin); // here because it's a right and not a state } else { $_profileId = !empty($_SESSION['_profileId']) ? $_SESSION['_profileId'] : false; $is_courseMember = !empty($_SESSION['is_courseMember']) ? $_SESSION['is_courseMember'] : false; $is_courseAdmin = !empty($_SESSION['is_courseAdmin']) ? $_SESSION['is_courseAdmin'] : false; $is_courseAllowed = !empty($_SESSION['is_courseAllowed']) ? $_SESSION['is_courseAllowed'] : false; $is_courseTutor = !empty($_SESSION['is_courseTutor']) ? $_SESSION['is_courseTutor'] : false; // not used !?! $_courseUser = !empty($_SESSION['_courseUser']) ? $_SESSION['_courseUser'] : null; } // Installed module in course if available in platform and not in course if ($_cid && is_array($_course) && isset($_course['dbNameGlu']) && !empty($_course['dbNameGlu']) && trim($_course['dbNameGlu'])) { // 0. load course configuration to avoid creating uneeded examples require claro_get_conf_repository() . 'course_main.conf.php'; // 1. get tool list from main db
break; case 2: $anonymity = 'default'; break; default: $anonymity = 'forbidden'; break; } if (get_conf('clfrm_anonymity_enabled', true)) { if ('allowed' == $anonymity) { $displayName .= ' (' . get_lang('anonymity allowed') . ')'; } elseif ('default' == $anonymity) { $displayName .= ' (' . get_lang('anonymous forum') . ')'; } } $itemClass = claro_is_user_authenticated() && $this->claro_notifier->is_a_notified_forum(claro_get_current_course_id(), $this->claro_notifier->get_notification_date(claro_get_current_user_id()), claro_get_current_user_id(), claro_get_current_group_id(), claro_get_current_tool_id(), $thisForum['forum_id']) ? 'item hot' : 'item'; ?> <tr align="left" valign="top"> <td> <span class="<?php echo $itemClass; ?> "> <img src="<?php echo get_icon_url('forum', 'CLFRM'); ?> " alt="" /> <?php if (!is_null($thisForum['group_id'])) { ?> <?php
/** * @param string $template name of the template */ public function __construct($template) { $template = secure_file_path($template); $customTemplatePath = get_path('rootSys') . '/platform/templates/' . $template; $defaultTemplatePath = get_path('includePath') . '/templates/' . $template; if (file_exists($customTemplatePath)) { parent::__construct($customTemplatePath); } elseif (file_exists($defaultTemplatePath)) { parent::__construct($defaultTemplatePath); } else { throw new Exception("Template not found {$template} " . "at custom location {$customTemplatePath} " . "or default location {$defaultTemplatePath} !"); } if (claro_is_in_a_course()) { $this->course = claro_get_current_course_data(); require_once dirname(__FILE__) . '/../claroCourse.class.php'; $this->courseObject = new ClaroCourse(); $this->courseObject->load(claro_get_current_course_id()); // Fetch related courses $this->relatedCourses = $this->courseObject->getRelatedCourses(); // $this->relatedUserCourses = $this->courseObject->getRelatedUserCourses(claro_get_current_user_id()); if (claro_is_in_a_group()) { $this->group = claro_get_current_group_data(); } } if (claro_is_user_authenticated()) { $this->user = claro_get_current_user_data(); } }
if (claro_is_user_authenticated()) { $date = $claro_notifier->get_notification_date(claro_get_current_user_id()); } $preparedAnnList = array(); $lastPostDate = ''; foreach ($announcementList as $thisAnn) { // Hide hidden and out of deadline elements $isVisible = (bool) ($thisAnn['visibility'] == 'SHOW') ? 1 : 0; $isOffDeadline = (bool) (isset($thisAnn['visibleFrom']) && strtotime($thisAnn['visibleFrom']) > time() || isset($thisAnn['visibleUntil']) && time() > strtotime($thisAnn['visibleUntil']) + 86400) ? 1 : 0; if (!$isVisible || $isOffDeadline) { $thisAnn['visible'] = false; } else { $thisAnn['visible'] = true; } // Flag hot items if (claro_is_user_authenticated() && $claro_notifier->is_a_notified_ressource(claro_get_current_course_id(), $date, claro_get_current_user_id(), claro_get_current_group_id(), claro_get_current_tool_id(), $thisAnn['id'])) { $thisAnn['hot'] = true; } else { $thisAnn['hot'] = false; } $thisAnn['content'] = make_clickable($thisAnn['content']); // Post time format in MySQL date format $lastPostDate = isset($thisAnn['visibleFrom']) ? $thisAnn['visibleFrom'] : $thisAnn['time']; // Set the current locator $currentLocator = ResourceLinker::$Navigator->getCurrentLocator(array('id' => $thisAnn['id'])); $thisAnn['currentLocator'] = $currentLocator; if ($is_allowedToEdit || $isVisible && !$isOffDeadline) { $preparedAnnList[] = $thisAnn; } } $maxMinRanks = clann_get_max_and_min_rank();
// poses problems on PHP 4.1, when the array contains only // a single element $dspFileName = claro_htmlspecialchars(basename($thisFile['path'])); $cmdFileName = download_url_encode($thisFile['path']); if ($thisFile['visibility'] == 'i') { if ($is_allowedToEdit) { $style = 'invisible '; } else { continue; // skip the display of this file } } else { $style = ''; } //modify style if the file is recently added since last login if (claro_is_user_authenticated() && $claro_notifier->is_a_notified_document(claro_get_current_course_id(), $date, claro_get_current_user_id(), claro_get_current_group_id(), claro_get_current_tool_id(), $thisFile)) { $classItem = ' hot'; } else { $classItem = ''; } if ($thisFile['type'] == A_FILE) { $image = choose_image($thisFile['path']); $size = format_file_size($thisFile['size']); $date = format_date($thisFile['date']); $urlFileName = claro_htmlspecialchars(claro_get_file_download_url($thisFile['path'])); //$urlFileName = "goto/?doc_url=".rawurlencode($cmdFileName); //format_url($baseServUrl.$courseDir.$curDirPath."/".$fileName)); $target = get_conf('openNewWindowForDoc') ? 'target="_blank"' : ''; } elseif ($thisFile['type'] == A_DIRECTORY) { $image = 'folder'; $size = ' ';
public static function current_language() { // FIXME : use init.lib instead of global variables !!! global $_course, $_user, $platformLanguage; if (claro_is_in_a_course() && isset($_course['language'])) { // course language return $_course['language']; } else { if (claro_is_user_authenticated() && !empty($_user['language'])) { // user language return $_user['language']; } else { if (isset($_REQUEST['language']) && in_array($_REQUEST['language'], array_keys(get_language_list()))) { // selected language $_SESSION['language'] = $_REQUEST['language']; return $_REQUEST['language']; } else { if (empty($_SESSION['language'])) { // default platform language return $platformLanguage; } else { return $_SESSION['language']; } } } } }
?> " method="post" enctype="multipart/form-data" > <input type="hidden" name="cidReset" value="true" /> <input type="hidden" name="cidReq" value="<?php echo claro_get_current_course_id(); ?> " /> <input type="hidden" id="cmd" name="cmd" value="registration" /> <input type="hidden" id="claroFormId" name="claroFormId" value="<?php echo uniqid(''); ?> " /> <input id="confirmUserCreate" name="confirmUserCreate" value="0" type="hidden" /> <?php if (claro_is_user_authenticated() && isset($_SESSION['csrf_token'])) { ?> <input id="csrf_token" name="csrf_token" value="<?php echo $_SESSION['csrf_token']; ?> " type="hidden" /> <?php } ?> <fieldset> <legend><?php echo get_lang('Fill in the user information'); ?> :</legend>
} elseif (claro_is_user_authenticated() && $module['contentType'] == CTLABEL_) { $out .= '<td colspan="2"> </td>' . "\n"; } //-- reset link for current module if (claro_is_user_authenticated() && (get_conf('cllnp_resetByUserAllowed', false) || claro_is_allowed_to_edit())) { if (getModuleProgression(claro_get_current_user_id(), $_SESSION['path_id'], $module['learnPath_module_id'])) { $out .= '<td><a href="' . Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=resetModuleProgression&learnPath_module_id=' . $module['learnPath_module_id'] . '&path_id=' . $_SESSION['path_id']) . '" onclick="return confirm(\'' . clean_str_for_javascript(get_lang('Do you really want to reset module ') . $module['name']) . '?\');"><img src="' . get_icon_url('delete') . '" alt="' . get_lang('Reset') . '" /></a></td>' . "\n"; } else { $out .= '<td>' . get_lang('No results available') . '</td>' . "\n"; } } if ($progress > 0) { $globalProg = $globalProg + $progress; } if ($module['contentType'] != CTLABEL_) { $moduleNb++; } // increment number of modules used to compute global progression except if the module is a title $out .= '</tr>' . "\n\n"; $atleastOne = true; } $out .= '</tbody>' . "\n\n"; if ($atleastOne == false) { $out .= '<tfoot>' . "\n\n" . '<tr>' . "\n" . '<td align="center" colspan="3">' . get_lang('No module') . '</td>' . "\n" . '</tr>' . "\n\n" . '</tfoot>' . "\n\n"; } elseif (claro_is_user_authenticated() && $moduleNb > 0) { // add a blank line between module progression and global progression $out .= '<tfoot>' . "\n\n" . '<tr>' . "\n" . '<td colspan="' . ($maxDeep + 3) . '"> </td>' . "\n" . '</tr>' . "\n\n" . '<tr>' . "\n" . '<td align="right" colspan="' . ($maxDeep + 1) . '">' . get_lang('Learning path progression :') . '</td>' . "\n" . '<td align="right">' . claro_html_progress_bar(round($globalProg / $moduleNb), 1) . '</td>' . "\n" . '<td align="left">' . '<small> ' . round($globalProg / $moduleNb) . '%</small>' . '</td>' . "\n" . '</tr>' . "\n\n" . '</tfoot>' . "\n\n"; } $out .= '</table>' . "\n\n"; $claroline->display->body->appendContent($out); echo $claroline->display->render();
// check if user is anonymous if ($lpUid) { $uidCheckString = "AND UMP.`user_id` = " . (int) $lpUid; } else { $uidCheckString = "AND UMP.`user_id` IS NULL "; } // list available learning paths $sql = "SELECT LP.* , MIN(UMP.`raw`) AS minRaw, LP.`lock`\n FROM `" . $TABLELEARNPATH . "` AS LP\n LEFT JOIN `" . $TABLELEARNPATHMODULE . "` AS LPM\n ON LPM.`learnPath_id` = LP.`learnPath_id`\n LEFT JOIN `" . $TABLEUSERMODULEPROGRESS . "` AS UMP\n ON UMP.`learnPath_module_id` = LPM.`learnPath_module_id`\n " . $uidCheckString . "\n WHERE 1=1\n " . $visibility . "\n GROUP BY LP.`learnPath_id`\n ORDER BY LP.`rank`"; $result = claro_sql_query($sql); // used to know if the down array (for order) has to be displayed $LPNumber = mysql_num_rows($result); $iterator = 1; $is_blocked = false; while ($list = mysql_fetch_array($result)) { //modify style if the file is recently added since last login if (claro_is_user_authenticated() && $claro_notifier->is_a_notified_ressource(claro_get_current_course_id(), $date, claro_get_current_user_id(), claro_get_current_group_id(), claro_get_current_tool_id(), $list['learnPath_id'])) { $classItem = ' hot'; } else { $classItem = ''; } if ($list['visibility'] == 'HIDE') { if ($is_allowedToEdit) { $style = " class=\"invisible\""; } else { continue; // skip the display of this file } } else { $style = ""; } $out .= "<tr align=\"center\"" . $style . ">";
/** * Singleton constructor * @todo avoid using the singleton pattern and use a factory instead ? * @param int $uid user id * @param boolean $forceReload force reloading the data * @return Claro_CurrentUser current user */ public static function getInstance($uid = null, $forceReload = false) { if ($forceReload || !self::$instance) { self::$instance = new self($uid); if (!$forceReload && claro_is_user_authenticated()) { self::$instance->loadFromSession(); } else { self::$instance->load($forceReload); } } return self::$instance; }
/** * Return course informations in <dt> and <dd> html tags. * Use it in a <dl> tag (description list). * * @param $course * @param $hot * @param $displayIconAccess * @return string * @deprecated use UserCourseList and CourseTreeView instead */ function render_course_in_dl_list($course, $hot = false, $displayIconAccess = true) { $out = ''; $classItem = $hot ? 'hot' : ''; $langNameOfLang = get_locale('langNameOfLang'); // Display a manager icon if the user is manager of the course $userStatusImg = isset($course['isCourseManager']) && $course['isCourseManager'] == 1 ? ' <img class="qtip role" src="' . get_icon_url('manager') . '" alt="' . get_lang('You are manager of this course') . '" />' : ''; // Show course language if not the same of the platform if (get_conf('platformLanguage') != $course['language'] || get_conf('showAlwaysLanguageInCourseList', false)) { $courseLanguageTxt = !empty($langNameOfLang[$course['language']]) ? ' – ' . claro_htmlspecialchars(ucfirst($langNameOfLang[$course['language']])) : ' – ' . claro_htmlspecialchars(ucfirst($course['language'])); } else { $courseLanguageTxt = ''; } // Display the course title following the platform configuration requirements $courseTitle = get_conf('course_order_by') == 'official_code' ? $course['officialCode'] . ' - ' . $course['title'] : $course['title'] . ' (' . $course['officialCode'] . ')'; $url = get_path('url') . '/claroline/course/index.php?cid=' . claro_htmlspecialchars($course['sysCode']); // Display an icon following the course's access settings $iconUrl = $displayIconAccess ? get_course_access_icon($course['access']) : get_icon_url('course'); // Display course's manager email $managerString = isset($course['email']) && claro_is_user_authenticated() ? '<a href="mailto:' . $course['email'] . '">' . $course['titular'] . '</a>' : $course['titular'] . $courseLanguageTxt; // Don't give a link to the course if the user is in pending state $isUserPending = isset($course['isPending']) && $course['isPending'] == 1 ? true : false; $courseLink = '<a href="' . claro_htmlspecialchars($url) . '">' . claro_htmlspecialchars($courseTitle) . '</a>' . $userStatusImg . "\n"; if ($isUserPending) { $courseLink .= ' [' . get_lang('Pending registration') . ']' . "\n"; } // Make a nice explicit sentence about the course's access if ($course['access'] == 'public') { $courseAccess = get_lang('Access allowed to anybody (even without login)'); } elseif ($course['access'] == 'platform') { $courseAccess = get_lang('Access allowed only to platform members (user registered to the platform)'); } elseif ($course['access'] == 'private') { $courseAccess = get_lang('Access allowed only to course members (people on the course user list)'); } else { $courseAccess = $course['access']; } $out .= '<dt>' . "\n" . '<img class="qtip iconDefinitionList" src="' . $iconUrl . '" alt="' . $courseAccess . '" /> ' . '<span' . (!empty($classItem) ? ' class="' . $classItem . '"' : '') . '>' . $courseLink . '</span>' . "\n" . '</dt>' . "\n" . '<dd>' . "\n" . '<span class="managerString">' . $managerString . "</span>\n"; if (!empty($course['sessionCourses'])) { $out .= '<dl>' . "\n"; foreach ($course['sessionCourses'] as $sessionCourse) { $out .= render_course_in_dl_list($sessionCourse, $sessionCourse['hot']) . "\n"; } $out .= '</dl>' . "\n"; } $out .= '</dd>' . "\n\n"; return $out; }
} else { $courseId = null; } } if (claro_is_in_a_course()) { Claroline::getDisplay()->body->hideCourseTitleAndTools(); } $selfStatistics = $userId == claro_get_current_user_id() ? true : false; /* * Permissions */ if (claro_is_platform_admin()) { // if I am platform admin I can always see tracking for all courses of user $is_allowedToTrack = true; $canSwitchCourses = true; } elseif (!is_null($userId) && claro_is_user_authenticated() && $userId == claro_get_current_user_id()) { // if these are my tracking I can view tracking of my other courses $is_allowedToTrack = true; $canSwitchCourses = true; } elseif (claro_is_course_manager()) { // if I am course manager I will only be able to see tracking of my course $is_allowedToTrack = true; $canSwitchCourses = false; } else { // Mr Nobody can see nothing. Let's get out of here ! claro_die(get_lang('Not allowed')); } /* * Init some other vars */ // user's course list
<td colspan="<?php echo $this->is_allowedToEdit ? 9 : 6; ?> " align="center"> <?php echo $this->forumSettings['forum_access'] == 2 ? get_lang('There are no topics for this forum. You can post one') : get_lang('There are no topics for this forum.'); ?> </td> </tr> <?php } else { foreach ($this->topicList as $thisTopic) { ?> <tr> <?php $itemClass = claro_is_user_authenticated() && $this->claro_notifier->is_a_notified_ressource(claro_get_current_course_id(), $this->claro_notifier->get_notification_date(claro_get_current_user_id()), claro_get_current_user_id(), claro_get_current_group_id(), claro_get_current_tool_id(), $this->forumId . "-" . $thisTopic['topic_id'], FALSE) ? 'item hot' : 'item'; $itemLink = claro_htmlspecialchars(Url::Contextualize(get_module_url('CLFRM') . '/viewtopic.php?topic=' . $thisTopic['topic_id'] . (is_null($this->forumSettings['idGroup']) ? '' : '&gidReq =' . $this->forumSettings['idGroup']))); ?> <td> <span class="<?php echo $itemClass; ?> "> <img src="<?php echo get_icon_url('topic'); ?> " alt="" /> <a href="<?php echo $itemLink; ?> "><?php
// table names $TABLELEARNPATH = $tbl_lp_learnPath; $TABLEMODULE = $tbl_lp_module; $TABLELEARNPATHMODULE = $tbl_lp_rel_learnPath_module; $TABLEASSET = $tbl_lp_asset; $TABLEUSERMODULEPROGRESS = $tbl_lp_user_module_progress; $TABLECOURSUSER = $tbl_rel_course_user; $TABLEUSER = $tbl_user; require_once get_path('incRepositorySys') . "/lib/statsUtils.lib.inc.php"; // lib of learning path tool require_once get_path('incRepositorySys') . "/lib/learnPath.lib.inc.php"; //lib of document tool require_once get_path('incRepositorySys') . "/lib/fileDisplay.lib.php"; // only the course administrator or the student himself can view the tracking $is_allowedToTrack = claro_is_course_manager(); if (isset($uInfo) && claro_is_user_authenticated()) { $is_allowedToTrack = $is_allowedToTrack || $uInfo == claro_get_current_user_id(); } // get infos about the user $sql = "SELECT `nom` AS `lastname`, `prenom` as `firstname`, `email`\n FROM `" . $TABLEUSER . "`\n WHERE `user_id` = " . (int) $_REQUEST['uInfo']; $uDetails = claro_sql_query_get_single_row($sql); // get infos about the learningPath $sql = "SELECT `name`\n FROM `" . $TABLELEARNPATH . "`\n WHERE `learnPath_id` = " . (int) $_REQUEST['path_id']; $lpDetails = claro_sql_query_get_single_row($sql); //////////////////// ////// OUTPUT ////// //////////////////// $interbredcrump[] = array("url" => "../learnPath/learningPathList.php", "name" => get_lang('Learning path list')); $interbredcrump[] = array("url" => "learnPath_details.php?path_id=" . $_REQUEST['path_id'], "name" => get_lang('Statistics')); $nameTools = get_lang('Modules'); $_SERVER['QUERY_STRING'] = 'uInfo=' . $_REQUEST['uInfo'] . "&path_id=" . $_REQUEST['path_id'];
// XSS $subject = strip_tags($subject); if (isset($_REQUEST['message'])) { $message = $_REQUEST['message']; } else { $message = ''; } // XSS $message = preg_replace('/<script[^\\>]*>|<\\/script>|(onabort|onblur|onchange|onclick|ondbclick|onerror|onfocus|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onreset|onresize|onselect|onsubmit|onunload)\\s*=\\s*"[^"]+"/i', '', $message); $forumSettingList = get_forum_settings($forum_id); $is_allowedToEdit = claro_is_allowed_to_edit() || claro_is_group_tutor() && !claro_is_course_manager(); // ( claro_is_group_tutor() // is added to give admin status to tutor // && !claro_is_course_manager()) // is added to let course admin, tutor of current group, use student mode if (!claro_is_user_authenticated() || !claro_is_in_a_course()) { claro_disp_auth_form(true); } elseif ($forumSettingList) { $forum_name = stripslashes($forumSettingList['forum_name']); $forum_post_allowed = $forumSettingList['forum_access'] != 0 ? true : false; $forum_type = $forumSettingList['forum_type']; $forum_groupId = $forumSettingList['idGroup']; $forum_cat_id = $forumSettingList['cat_id']; /* * Check if the topic isn't attached to a group, or -- if it is attached --, * check the user is allowed to see the current group forum. */ if (!$forum_post_allowed || !is_null($forumSettingList['idGroup']) && (!claro_is_in_a_group() || !claro_is_group_allowed() || $forumSettingList['idGroup'] != claro_get_current_group_id())) { // NOTE : $forumSettingList['idGroup'] != claro_get_current_group_id() is necessary to prevent any hacking // attempt like rewriting the request without $cidReq. If we are in group // forum and the group of the concerned forum isn't the same as the session
function printInit($selection = "*") { global $uidReset, $cidReset, $gidReset, $tidReset, $uidReq, $cidReq, $gidReq, $tidReq, $tlabelReq, $_user, $_course, $_groupUser, $_courseTool, $_SESSION, $_claro_local_run; if ($_claro_local_run) { echo "local init runned"; } else { echo '<font color="red"> local init never runned during this script </font>'; } echo ' <table width="100%" border="1" cellspacing="4" cellpadding="1" bordercolor="#808080" bgcolor="#C0C0C0" lang="en"> <TR>'; if ($selection == "*" or strstr($selection, "u")) { echo ' <TD valign="top" > <strong>User</strong> : (_uid) : ' . var_export(claro_get_current_user_id(), 1) . ' | (session[_uid]) : ' . var_export($_SESSION["_uid"], 1) . ' <br /> reset = ' . var_export($uidReset, 1) . ' | req = ' . var_export($uidReq, 1) . '<br /> _user : <pre>' . var_export($_user, 1) . '</pre> <br />is_platformAdmin :' . var_export(claro_is_platform_admin(), 1) . ' <br />is_allowedCreateCourse :' . var_export(claro_is_allowed_to_create_course(), 1) . ' </TD>'; } if ($selection == "*" or strstr($selection, "c")) { echo "\n <TD valign=\"top\" >\n <strong>Course</strong> : (_cid)" . var_export(claro_get_current_course_id(), 1) . "\n <br />\n reset = " . var_export($cidReset, 1) . " | req = " . var_export($cidReq, 1) . "\n <br />\n _course : <pre>" . var_export($_course, 1) . "</pre>\n <br />\n _groupProperties :\n <PRE>\n " . var_export(claro_get_current_group_properties_data(), 1) . "\n </PRE>\n </TD>"; } echo ' </TR> <TR>'; if ($selection == "*" or strstr($selection, "g")) { echo '<TD valign="top" ><strong>Group</strong> : (_gid) ' . var_export(claro_get_current_group_id(), 1) . '<br /> reset = ' . var_export($GLOBALS['gidReset'], 1) . ' | req = ' . var_export($gidReq, 1) . "<br />\n _group :<pre>" . var_export(claro_get_current_group_data(), 1) . "</pre></TD>"; } if ($selection == "*" or strstr($selection, "t")) { echo '<TD valign="top" ><strong>Tool</strong> : (_tid)' . var_export(claro_get_current_tool_id(), 1) . '<br /> reset = ' . var_export($tidReset, 1) . ' | req = ' . var_export($tidReq, 1) . '| req = ' . var_export($tlabelReq, 1) . ' <br /> _tool :' . var_export(get_init('_tool'), 1) . "</TD>"; } echo "</TR>"; if ($selection == "*" or strstr($selection, "u") && strstr($selection, "c")) { echo '<TR><TD valign="top" colspan="2"><strong>Course-User</strong>'; if (claro_is_user_authenticated()) { echo '<br /><strong>User</strong> :' . var_export(claro_is_in_a_course(), 1); } if (claro_is_in_a_course()) { echo ' in ' . var_export(claro_get_current_course_id(), 1) . '<br />'; } if (claro_is_user_authenticated() && claro_get_current_course_id()) { echo '_courseUser : <pre>' . var_export(getInit('_courseUser'), 1) . '</pre>'; } echo '<br />is_courseMember : ' . var_export(claro_is_course_member(), 1); echo '<br />is_courseAdmin : ' . var_export(claro_is_course_manager(), 1); echo '<br />is_courseAllowed : ' . var_export(claro_is_course_allowed(), 1); echo '<br />is_courseTutor : ' . var_export(claro_is_course_tutor(), 1); echo '</TD></TR>'; } echo ""; if ($selection == "*" or strstr($selection, "u") && strstr($selection, "g")) { echo '<TR><TD valign="top" colspan="2">' . '<strong>Course-Group-User</strong>'; if (claro_is_user_authenticated()) { echo '<br /><strong>User</strong> :' . var_export(claro_is_in_a_course(), 1); } if (claro_is_in_a_group()) { echo ' in ' . var_export(claro_get_current_group_id(), 1); } if (claro_is_in_a_group()) { echo '<br />_groupUser:'******'_groupUser'), 1); } echo '<br />is_groupMember:' . var_export(claro_is_group_member(), 1) . '<br />is_groupTutor: ' . var_export(claro_is_group_tutor(), 1) . '<br />is_groupAllowed:' . var_export(claro_is_group_allowed(), 1) . '</TD>' . '</tr>'; } if ($selection == "*" or strstr($selection, "c") && strstr($selection, "t")) { echo '<tr> <TD valign="top" colspan="2" ><strong>Course-Tool</strong><br />'; if (claro_get_current_tool_id()) { echo 'Tool :' . claro_get_current_tool_id(); } if (claro_is_in_a_course()) { echo ' in ' . claro_get_current_course_id() . '<br />'; } if (claro_get_current_tool_id()) { echo "_courseTool : <pre>" . var_export($_courseTool, 1) . '</pre><br />'; } echo 'is_toolAllowed : ' . var_export(claro_is_tool_allowed(), 1); echo "</TD>"; } echo "</TR></TABLE>"; }
<!-- $Id: coursetoollist.tpl.php 13569 2011-09-09 12:42:41Z zefredz $ --> <div id="courseToolListBlock"> <?php if (is_array($this->toolLinkList)) { echo claro_html_list($this->toolLinkList); } ?> <?php if (claro_is_user_authenticated() && !empty($this->otherToolsList)) { ?> <br /> <ul> <?php foreach ($this->otherToolsList as $otherTool) { ?> <li><?php echo $otherTool; ?> </li> <?php } ?> </ul> <?php
<?php if ($courseTreeNode->hasCourse()) { ?> <?php if ($courseTreeNode->getCourse()->isActivated() && ($courseTreeNode->getCourse()->isVisible() || claro_is_platform_admin() || $this->courseUserPrivilegesList->getCoursePrivileges($courseTreeNode->getCourse()->sysCode)->isCourseMember())) { ?> <!-- Render the course and its children --> <?php $childNodeView = new CourseTreeNodeView($courseTreeNode, $this->courseUserPrivilegesList, $this->notifiedCourseList, $this->viewOptions); echo $childNodeView->render(); ?> <?php } elseif (claro_is_user_authenticated() && (!$courseTreeNode->getCourse()->isActivated() && $courseTreeNode->getCourse()->isVisible())) { ?> <!-- Render the course (deactivated) and its children --> <?php $childNodeView = new CourseTreeNodeDeactivatedView($courseTreeNode, $this->courseUserPrivilegesList, $this->notifiedCourseList, $this->viewOptions); echo $childNodeView->render(); ?> <?php } ?> <?php } else { ?>
/** * Return the breadcrumb to display in the header * * @global string $nameTools * @global array $interbredcrump * @global boolean $noPHP_SELF * @global boolean $noQUERY_STRING * * @return string html content */ function claro_html_breadcrumb() { // dirty global to keep value (waiting a refactoring) global $nameTools, $interbredcrump, $noPHP_SELF, $noQUERY_STRING; /****************************************************************************** BREADCRUMB LINE ******************************************************************************/ $htmlBC = ''; if (claro_is_in_a_course() || isset($nameTools) || isset($interbredcrump) && is_array($interbredcrump)) { $htmlBC .= '<div id="breadcrumbLine">' . "\n\n" . '<hr />' . "\n"; $breadcrumbUrlList = array(); $breadcrumbNameList = array(); $breadcrumbUrlList[] = get_path('url') . '/index.php'; $breadcrumbNameList[] = get_conf('siteName'); if (claro_is_in_a_course()) { $breadcrumbUrlList[] = get_path('clarolineRepositoryWeb') . 'course/index.php?cid=' . claro_htmlspecialchars(claro_get_current_course_id()); $breadcrumbNameList[] = claro_get_current_course_data('officialCode'); } if (claro_is_in_a_group()) { $breadcrumbUrlList[] = get_module_url('CLGRP') . '/index.php?cidReq=' . claro_htmlspecialchars(claro_get_current_course_id()); $breadcrumbNameList[] = get_lang('Groups'); $breadcrumbUrlList[] = get_module_url('CLGRP') . '/group_space.php?cidReq=' . claro_htmlspecialchars(claro_get_current_course_id()) . '&gidReq=' . (int) claro_get_current_group_id(); $breadcrumbNameList[] = claro_get_current_group_data('name'); } if (isset($interbredcrump) && is_array($interbredcrump)) { while (list(, $bredcrumpStep) = each($interbredcrump)) { $breadcrumbUrlList[] = $bredcrumpStep['url']; $breadcrumbNameList[] = $bredcrumpStep['name']; } } if (isset($nameTools)) { $breadcrumbNameList[] = $nameTools; if (isset($noPHP_SELF) && $noPHP_SELF) { $breadcrumbUrlList[] = null; } elseif (isset($noQUERY_STRING) && $noQUERY_STRING) { $breadcrumbUrlList[] = $_SERVER['PHP_SELF']; } else { // set Query string to empty if not exists if (!isset($_SERVER['QUERY_STRING'])) { $_SERVER['QUERY_STRING'] = ''; } $breadcrumbUrlList[] = $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING']; } } $htmlBC .= claro_html_breadcrumbtrail($breadcrumbNameList, $breadcrumbUrlList, ' > ', get_icon_url('home')); if (!claro_is_user_authenticated()) { $htmlBC .= "\n" . '<div id="toolViewOption" style="padding-right:10px">' . '<a href="' . get_path('clarolineRepositoryWeb') . 'auth/login.php' . '?sourceUrl=' . urlencode(base64_encode((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'])) . '" target="_top">' . get_lang('Login') . '</a>' . '</div>' . "\n"; } elseif (claro_is_in_a_course() && !claro_is_course_member() && claro_get_current_course_data('registrationAllowed') && !claro_is_platform_admin()) { $htmlBC .= '<div id="toolViewOption">' . '<a href="' . get_path('clarolineRepositoryWeb') . 'auth/courses.php?cmd=exReg&course=' . claro_get_current_course_id() . '">' . '<img src="' . get_icon_url('enroll') . '" alt="" /> ' . '<b>' . get_lang('Enrolment') . '</b>' . '</a>' . '</div>' . "\n"; } elseif (claro_is_display_mode_available()) { $htmlBC .= "\n" . '<div id="toolViewOption">' . "\n"; if (isset($_REQUEST['View mode'])) { $htmlBC .= claro_html_tool_view_option($_REQUEST['View mode']); } else { $htmlBC .= claro_html_tool_view_option(); } if (claro_is_platform_admin() && !claro_is_course_member()) { $htmlBC .= ' | <a href="' . get_path('clarolineRepositoryWeb') . 'auth/courses.php?cmd=exReg&course=' . claro_get_current_course_id() . '">'; $htmlBC .= '<img src="' . get_icon_url('enroll') . '" alt="" /> '; $htmlBC .= '<b>' . get_lang('Enrolment') . '</b>'; $htmlBC .= '</a>'; } $htmlBC .= "\n" . '</div>' . "\n"; } $htmlBC .= '<div class="spacer"></div>' . "\n" . '<hr />' . "\n" . '</div>' . "\n"; } else { // $htmlBC .= '<div style="height:1em"></div>'; } return $htmlBC; }
$TABLELEARNPATHMODULE = $tbl_lp_rel_learnPath_module; $TABLEASSET = $tbl_lp_asset; $TABLEUSERMODULEPROGRESS = $tbl_lp_user_module_progress; $TABLEUSERS = $tbl_user; $SCORMServerURL = Url::Contextualize(get_module_url('CLLNP') . '/navigation/SCORMserver.php'); $redirectionURL = Url::Contextualize(get_module_url('CLLNP') . '/learningPath.php'); $TOCurl = Url::Contextualize(get_module_url('CLLNP') . '/navigation/tableOfContent.php'); /*====================================== CLAROLINE MAIN ======================================*/ if (claro_is_user_authenticated()) { // Get general information to generate the right API inmplementation $sql = "SELECT *\n FROM `" . $TABLEUSERMODULEPROGRESS . "` AS UMP,\n `" . $TABLELEARNPATHMODULE . "` AS LPM,\n `" . $TABLEUSERS . "` AS U,\n `" . $TABLEMODULE . "` AS M\n WHERE UMP.`user_id` = " . (int) claro_get_current_user_id() . "\n AND UMP.`user_id` = U.`user_id`\n AND UMP.`learnPath_module_id` = LPM.`learnPath_module_id`\n AND M.`module_id` = LPM.`module_id`\n AND LPM.`learnPath_id` = " . (int) $_SESSION['path_id'] . "\n AND LPM.`module_id` = " . (int) $_SESSION['module_id']; $userProgressionDetails = claro_sql_query_get_single_row($sql); } if (!claro_is_user_authenticated() || !$userProgressionDetails) { $sco['student_id'] = "-1"; $sco['student_name'] = "Anonymous, User"; $sco['lesson_location'] = ""; $sco['credit'] = "no-credit"; $sco['lesson_status'] = "not attempted"; $sco['entry'] = "ab-initio"; $sco['raw'] = ""; $sco['scoreMin'] = "0"; $sco['scoreMax'] = "100"; $sco['total_time'] = "0000:00:00.00"; $sco['suspend_data'] = ""; $sco['launch_data'] = ""; } else { // set vars $sco['student_id'] = claro_get_current_user_id();
* @copyright (c) 2001-2011, Universite catholique de Louvain (UCL) * * @license http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE * * @see http://www.claroline.net/wiki/index.php/CLCHT * * @package CLCHT * * @author Claro Team <*****@*****.**> * @author Christophe Gesche <*****@*****.**> * @copyright (c) 2001-2011, Universite catholique de Louvain (UCL) * */ $tlabelReq = 'CLCHT'; require '../inc/claro_init_global.inc.php'; if (!claro_is_in_a_course() || !claro_is_course_allowed() && !claro_is_user_authenticated()) { claro_disp_auth_form(true); } $_course = claro_get_current_course_data(); $nameTools = get_lang('Chat'); $titlePage = ''; if (!empty($nameTools)) { $titlePage .= $nameTools . ' - '; } if (!empty($_course['officialCode'])) { $titlePage .= $_course['officialCode'] . ' - '; } $titlePage .= get_conf('siteName'); // Redirect previously sent paramaters in the correct subframe (messageList.php) $paramList = array(); if (isset($_REQUEST['gidReset']) && $_REQUEST['gidReset'] == TRUE) {
<?php echo claro_htmlspecialchars($this->node->getCourse()->officialCode); ?> – <?php echo claro_htmlspecialchars($this->node->getCourse()->name); ?> <?php } ?> </dt> <dd> <span> <?php if (isset($this->node->getCourse()->email) && claro_is_user_authenticated()) { ?> <a href="mailto:<?php echo $this->node->getCourse()->email; ?> "> <?php echo claro_htmlspecialchars($this->node->getCourse()->titular); ?> </a> <?php } else { ?>
$pageTitle['subTitle'] = $assignment->getTitle(); // SHOW FEEDBACK // only if : // - there is a text OR a file in automatic feedback // AND // feedback must be shown after end date and end date is past // OR feedback must be shown directly after a post (from the time a work was uploaded by the student) // there is a prefill_ file or text, so there is something to show $textOrFilePresent = (bool) $assignment->getAutoFeedbackText() != '' || $assignment->getAutoFeedbackFilename() != ''; // feedback must be shown after end date and end date is past $showAfterEndDate = (bool) ($assignment->getAutoFeedbackSubmitMethod() == 'ENDDATE' && $assignment->getEndDate() < time()); // feedback must be shown directly after a post // check if user has already posted a work // do not show to anonymous users because we can't know // if the user already uploaded a work $showAfterPost = (bool) claro_is_user_authenticated() && ($assignment->getAutoFeedbackSubmitMethod() == 'AFTERPOST' && count($assignment->getSubmissionList(claro_get_current_user_id())) > 0); // Command list $cmdList = array(); if ($is_allowedToSubmit && $assignment->getAssignmentType() != 'GROUP') { // Link to create a new assignment $cmdList[] = array('name' => get_lang('Submit a work'), 'url' => claro_htmlspecialchars(Url::Contextualize('user_work.php?authId=' . claro_get_current_user_id() . '&cmd=rqSubWrk' . '&assigId=' . $req['assignmentId']))); } if ($is_allowedToEditAll) { $cmdList[] = array('name' => get_lang('Edit automatic feedback'), 'url' => claro_htmlspecialchars(Url::Contextualize('feedback.php?cmd=rqEditFeedback' . '&assigId=' . $req['assignmentId']))); if (claro_is_platform_admin() || get_conf('allow_download_all_submissions')) { $cmdList[] = array('img' => 'save', 'name' => get_lang('Download submissions'), 'url' => claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=rqDownload' . '&assigId=' . $req['assignmentId']))); } } /** * OUTPUT *
} elseif ($this->cupList->getCoursePrivileges($course->courseId)->isCourseMember()) { ?> [Member] <?php } elseif ($this->cupList->getCoursePrivileges($course->courseId)->isEnrolmentPending()) { ?> [Pending] <?php } ?> </span> </dt> <dd> <?php if (isset($course->email) && claro_is_user_authenticated()) { ?> <a href="mailto:<?php echo $course->email; ?> "> <?php echo claro_htmlspecialchars($course->titular); ?> </a> <?php } else { ?> <?php echo claro_htmlspecialchars($course->titular);
* * @version $Revision: 14315 $ * @copyright (c) 2001-2011, Universite catholique de Louvain (UCL) * @license http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE * @see http://www.claroline.net/wiki/Auth/ * @author Claro Team <*****@*****.**> * @package AUTH */ /*===================================================================== Init Section =====================================================================*/ $cidReset = true; $gidReset = true; $uidRequired = true; require '../inc/claro_init_global.inc.php'; if (!claro_is_user_authenticated()) { claro_disp_auth_form(); } $dialogBox = new DialogBox(); $display = ''; $error = false; // include configuration files include claro_get_conf_repository() . 'user_profile.conf.php'; // find this file to modify values. // include library files include_once get_path('incRepositorySys') . '/lib/user.lib.php'; include_once get_path('incRepositorySys') . '/lib/sendmail.lib.php'; include_once get_path('incRepositorySys') . '/lib/fileManage.lib.php'; include_once get_path('incRepositorySys') . '/lib/fileUpload.lib.php'; include_once get_path('incRepositorySys') . '/lib/image.lib.php'; include_once get_path('incRepositorySys') . '/lib/display/dialogBox.lib.php';
function get_access_mode_to_group_forum($forum) { if (claro_is_user_authenticated()) { $userGroupList = get_user_group_list(claro_get_current_user_id()); $userGroupList = array_keys($userGroupList); $tutorGroupList = get_tutor_group_list(claro_get_current_user_id()); } else { $userGroupList = array(); $tutorGroupList = array(); } $is_groupPrivate = claro_get_current_group_properties_data('private'); $group_id = is_null($forum['group_id']) ? null : (int) $forum['group_id']; if (!is_null($group_id)) { if (in_array($group_id, $userGroupList) || in_array($group_id, $tutorGroupList) || !$is_groupPrivate || claro_is_allowed_to_edit()) { if (is_array($tutorGroupList) && in_array($group_id, $tutorGroupList)) { $accessMode = 'tutor'; } elseif (is_array($userGroupList) && in_array($group_id, $userGroupList)) { $accessMode = 'member'; } else { $accessMode = 'visitor'; } } else { $accessMode = 'private'; } return $accessMode; } return false; }