/** * constructor, build a config object * * @param string $config_code */ function Config($config_code) { $this->config_code = $config_code; $this->conf_dirname = claro_get_conf_repository(); // in 1.8 is 'platform/conf' folder $this->def_dirname = claro_get_conf_def_file($config_code); $this->backlog = new Backlog(); $this->def_loaded = false; }
public function __construct() { if (file_exists(claro_get_conf_repository() . 'CLCAL.conf.php')) { include claro_get_conf_repository() . 'CLCAL.conf.php'; } $today = getdate(); $this->month = $today['mon']; $this->year = $today['year']; }
public function __construct($label) { parent::__construct($label); $this->name = 'Latest announcements'; $this->label = 'CLANN_Portlet'; if (file_exists(claro_get_conf_repository() . 'CLANN.conf.php')) { include claro_get_conf_repository() . 'CLANN.conf.php'; } }
$gidReset = true; require '../inc/claro_init_global.inc.php'; if (!claro_is_in_a_course() || !claro_is_course_allowed()) { claro_disp_auth_form(true); } $context = claro_get_current_context(CLARO_CONTEXT_COURSE); // Local lib require_once './lib/announcement.lib.php'; // get some shared lib require_once get_path('incRepositorySys') . '/lib/sendmail.lib.php'; // require_once get_path('clarolineRepositorySys') . '/linker/linker.inc.php'; FromKernel::uses('core/linker.lib'); ResourceLinker::init(); // Get specific conf file require claro_get_conf_repository() . 'ical.conf.php'; require claro_get_conf_repository() . 'rss.conf.php'; claro_set_display_mode_available(true); // Set flag following depending on settings $is_allowedToEdit = claro_is_allowed_to_edit(); $courseId = claro_get_current_course_id(); $userLastLogin = claro_get_current_user_data('lastLogin'); // DB tables definition $tbl_cdb_names = claro_sql_get_main_tbl(); $tbl_course_user = $tbl_cdb_names['rel_course_user']; $tbl_user = $tbl_cdb_names['user']; // Default display $displayForm = false; $displayList = true; $subTitle = ''; $dialogBox = new DialogBox(); // avoid executing commands twice when switching view mode
if (!claro_is_in_a_course() || !claro_is_course_allowed()) { claro_disp_auth_form(true); } if (empty($cidReq)) { claro_die(get_lang('Cannot find course')); } // Fetch this course's portlets $portletiterator = new CourseHomePagePortletIterator(ClaroCourse::getIdFromCode($cidReq)); // Include specific CSS if any if (file_exists(get_conf('coursesRepositorySys') . $_course['path'] . '/css/course.css')) { $claroline->display->header->addHtmlHeader('<link rel="stylesheet" media="screen" type="text/css" href="' . get_path('url') . '/' . get_path('coursesRepositoryAppend') . $_course['path'] . '/css/course.css" />'); } // Instantiate course $thisCourse = new ClaroCourse(); $thisCourse->load($cidReq); include claro_get_conf_repository() . 'rss.conf.php'; // Include the course home page special CSS CssLoader::getInstance()->load('coursehomepage', 'all'); $toolRepository = get_path('clarolineRepositoryWeb'); claro_set_display_mode_available(true); // Manage portlets if (claro_is_course_manager() && !empty($portletClass)) { // Require the right class $portletPath = get_module_path($portletLabel) . '/connector/coursehomepage.cnr.php'; if (file_exists($portletPath)) { require_once $portletPath; } else { throw new Exception(get_lang('Cannot find this portlet')); } if ($portletCmd == 'exAdd') { $portlet = new $portletClass();
echo '</ol>'; } else { echo get_lang('No function in this extension') . '<br />'; } } } } elseif ($cmd == 'phpinfo') { echo '<div class="center">'; echo phpinfoNoHtml(); echo '</div>'; } elseif ($cmd == 'secinfo') { require_once dirname(__FILE__) . '/../../inc/lib/thirdparty/PhpSecInfo/PhpSecInfo.lib.php'; phpsecinfo(); } elseif ($cmd == 'claroconf') { echo '<div style="background-color: #dfdfff;">'; highlight_file(claro_get_conf_repository() . 'claro_main.conf.php'); echo '<hr /></div>'; } else { ?> <table class="claroTable"> <thead> <tr> <th scope="col"><?php echo get_lang('Software'); ?> </th> <th scope="col"><?php echo get_lang('Version'); ?> </th> </tr>
} /** * CLAROLINE * * User desktop : course list portlet. * * @version $Revision: 14314 $ * @copyright (c) 2001-2011, Universite catholique de Louvain (UCL) * @license http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE * @package DESKTOP * @author Claroline Team <*****@*****.**> * @fixme should not be a portlet anymore */ FromKernel::uses('courselist.lib'); // we need CLHOME conf file for render_user_course_list function include claro_get_conf_repository() . 'CLHOME.conf.php'; // conf file class MyCourseList extends UserDesktopPortlet { public function __construct() { $this->name = 'My course list'; $this->label = 'mycourselist'; } public function renderContent() { global $platformLanguage; $out = ''; // Last user action $lastUserAction = isset($_SESSION['last_action']) && $_SESSION['last_action'] != '1970-01-01 00:00:00' ? $_SESSION['last_action'] : date('Y-m-d H:i:s'); $userCommands = array();
* * Build iCal file for user in given course * * @version $Revision: 13707 $ * @copyright (c) 2001-2011, Universite catholique de Louvain (UCL) * @author Claroline Team <*****@*****.**> * @author Christophe Gesche <*****@*****.**> * @license http://www.gnu.org/copyleft/gpl.html * GNU GENERAL PUBLIC LICENSE version 2.0 * @package KERNEL */ $_course = array(); $siteName = ''; $is_courseAllowed = false; require dirname(__FILE__) . '/../inc/claro_init_global.inc.php'; include_once claro_get_conf_repository() . 'ical.conf.php'; include_once get_path('includePath') . '/lib/ical.write.lib.php'; $formatList = array('ics' => 'iCalendar', 'xcs' => 'xCalendar (xml)', 'rdf' => 'rdf'); if (!get_conf('enableICalInCourse')) { // Codes Status HTTP 404 for rss feeder header('HTTP/1.0 404 Not Found'); exit; } $calType = array_key_exists('calFormat', $_REQUEST) && array_key_exists($_REQUEST['calFormat'], $formatList) ? $_REQUEST['calFormat'] : get_conf('calType', 'ics'); // need to be in a course if (!claro_is_in_a_course()) { die('<form >cidReq = <input name="cidReq" type="text" /><input type="submit" /></form>'); } if (!$_course['visibility'] && !claro_is_course_allowed()) { if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm="' . get_lang('iCal feed for %course', array('%course' => $_course['name'])) . '"');
/* * Permissions */ if (claro_is_in_a_course() && !claro_is_in_a_group()) { // course context $is_allowedToEdit = claro_is_allowed_to_edit(); $pathSys = get_path('coursesRepositorySys') . claro_get_course_path() . '/document/'; $pathWeb = get_path('coursesRepositoryWeb') . claro_get_course_path() . '/document/'; require claro_get_conf_repository() . 'CLDOC.conf.php'; $maxFilledSpace = get_conf('maxFilledSpace_for_course'); } elseif (claro_is_in_a_group()) { // course context $is_allowedToEdit = claro_is_allowed_to_edit(); $pathSys = get_path('coursesRepositorySys') . claro_get_course_path() . '/group/' . claro_get_current_group_data('directory'); $pathWeb = get_path('coursesRepositoryWeb') . claro_get_course_path() . '/group/' . claro_get_current_group_data('directory'); require claro_get_conf_repository() . 'CLDOC.conf.php'; $maxFilledSpace = get_conf('maxFilledSpace_for_course'); } else { // platform context $is_allowedToEdit = claro_is_platform_admin(); $pathSys = get_path('rootSys') . 'platform/document/'; $pathWeb = get_path('rootWeb') . 'platform/document/'; } /* * Libraries */ include_once $includePath . '/lib/fileUpload.lib.php'; include_once $includePath . '/lib/fileManage.lib.php'; /* * Init directory */
* @license http://www.gnu.org/copyleft/gpl.html * GNU GENERAL PUBLIC LICENSE version 2 or later * @package CLWORK * @since 1.9.5 */ $tlabelReq = 'CLWRK'; require_once dirname(__FILE__) . '/../../claroline/inc/claro_init_global.inc.php'; //Security checks if (!claro_is_user_authenticated()) { claro_disp_auth_form(true); } if (!claro_is_allowed_to_edit()) { claro_die(get_lang('Not allowed')); } //Loading tool config file and required libraries require_once claro_get_conf_repository() . 'CLWRK.conf.php'; require_once get_path('incRepositorySys') . '/lib/course_utils.lib.php'; //init DialogBox object $dialogBox = new DialogBox(); try { //init user input handler $userInput = Claro_UserInput::getInstance(); $userInput->setValidatorForAll(new Claro_Validator_ValueType('string')); $cmd = $userInput->get('cmd'); if ('savePrefs' == $cmd) { $errorCount = 0; $notifySubmissions = $userInput->getMandatory('submission'); $notifyFeedbacks = $userInput->getMandatory('feedback'); if (false === save_course_property('notify_submissions', $notifySubmissions, claro_get_current_course_id())) { $errorsCount++; }
// $Id: platform_courses.php 14288 2012-10-17 08:02:02Z jrm_ $ /** * CLAROLINE * * @version $Revision: 14288 $ * @license http://www.gnu.org/licenses/agpl-3.0-standalone.html AGPL Affero General Public License * @copyright Copyright 2010 Claroline Consortium * @author Claro Team <*****@*****.**> * @author Antonin Bourguignon <*****@*****.**> * @since 1.10 */ require '../inc/claro_init_global.inc.php'; require '../inc/lib/courselist.lib.php'; require_once dirname(__FILE__) . '/../inc/lib/coursesearchbox.class.php'; //load home page config file require claro_get_conf_repository() . 'CLHOME.conf.php'; // Build the breadcrumb $nameTools = get_lang('Platform courses'); $categoryId = !empty($_REQUEST['categoryId']) ? (int) $_REQUEST['categoryId'] : 0; $categoryBrowser = new CategoryBrowser($categoryId, claro_get_current_user_id()); if (isset($_REQUEST['cmd']) && $_REQUEST['cmd'] == 'search') { $categoriesList = array(); $coursesList = search_course($_REQUEST['keyword']); } // Display $template = $categoryBrowser->getTemplate(); $claroline->display->body->appendContent($template->render()); $searchbox = new CourseSearchBox($_SERVER['REQUEST_URI']); $claroline->display->body->appendContent($searchbox->render()); echo $claroline->display->render();
* @todo separate checking and output * @todo protect "showall" when there is nothing in cache */ define('DISP_RESULT', __LINE__); define('DISP_NOT_ALLOWED', __LINE__); require '../inc/claro_init_global.inc.php'; // Security check if (!claro_is_user_authenticated()) { claro_disp_auth_form(); } if (!claro_is_platform_admin()) { claro_die(get_lang('Not allowed')); } include_once get_path('incRepositorySys') . '/lib/statsUtils.lib.inc.php'; include_once get_path('incRepositorySys') . '/lib/thirdparty/pear/Lite.php'; include_once claro_get_conf_repository() . 'CLKCACHE.conf.php'; // right $is_allowedToCheckProblems = claro_is_platform_admin(); // Cache_lite setting & init $cache_options = array('cacheDir' => get_path('rootSys') . 'tmp/cache/campusProblem/', 'lifeTime' => get_conf('cache_lifeTime', 10), 'automaticCleaningFactor' => get_conf('cache_automaticCleaningFactor', 50)); if (claro_debug_mode()) { $cache_options['pearErrorMode'] = CACHE_LITE_ERROR_DIE; } if (claro_debug_mode()) { $cache_options['lifeTime'] = 3; } if (!file_exists($cache_options['cacheDir'])) { include_once get_path('incRepositorySys') . '/lib/fileManage.lib.php'; claro_mkdir($cache_options['cacheDir'], CLARO_FILE_PERMISSIONS, true); } $Cache_Lite = new Cache_Lite($cache_options);
/** * Load configuration file for a module * @param $module module label (default null for current module) */ function load_module_config($moduleLabel = null) { if (!$moduleLabel) { $moduleLabel = get_current_module_label(); } // load main config file $mainConfigFile = claro_get_conf_repository() . $moduleLabel . '.conf.php'; if (file_exists($mainConfigFile)) { include $mainConfigFile; } // check if config overwritten in course and load config file if (claro_is_in_a_course()) { $courseConfigFile = get_conf('coursesRepositorySys') . claro_get_current_course_data('path') . '/conf/' . $moduleLabel . '.conf.php'; if (file_exists($courseConfigFile)) { include $courseConfigFile; } } }
echo '<br />' . get_lang('%path is missing', array('%path' => $coursesRepositorySys)) . "\n"; } if ($coursesRepositorySysWriteProtected) { echo '<br />' . get_lang('Claroline cannot write to %path', array('%path' => $coursesRepositorySys)) . "\n"; } if ($garbageRepositorySysMissing) { echo '<br />' . get_lang('%path is missing', array('%path' => $garbageRepositorySys)) . "\n"; } if ($garbageRepositorySysWriteProtected) { echo '<br />' . get_lang('Claroline cannot write to %path', array('%path' => $garbageRepositorySys)) . "\n"; } if ($platformConfigRepositorySysMissing) { echo '<br />' . get_lang('%path is missing', array('%path' => claro_get_conf_repository())) . "\n"; } if ($platformConfigRepositorySysWriteProtected) { echo '<br />' . get_lang('Claroline cannot write to %path', array('%path' => claro_get_conf_repository())) . "\n"; } echo get_lang('Write problems can come from two possible causes') . ' :<br />' . "\n" . '<ul>' . "\n" . '<li>' . "\n" . get_lang('Permission problems.') . '<br />' . "\n" . get_lang('Try initially with <em>chmod 777 -R</em> and increase restrictions gradually.') . "\n" . '</li>' . "\n" . '<li>' . "\n" . get_lang('PHP is running in <a href="http://www.php.net/manual/en/features.safe-mode.php" target="_phpman">SAFE MODE</a>.') . '<br />' . "\n" . get_lang('If possible, try to switch it off.') . "\n" . '</li>' . "\n" . '</ul>' . "\n"; echo '<p align="right">' . '<input type="submit" name="alreadyVisited" value="' . get_lang('Start again from the beginning') . '" />' . "\n" . '<input type="submit" name="cmdDoInstall" value="' . get_lang('Retry') . '" />' . "\n" . '</p>'; } elseif (DISP_RUN_INSTALL_COMPLETE == $display) { echo '<h2>' . $panelTitle[DISP_RUN_INSTALL_COMPLETE] . '</h2>' . "\n" . '<div class="claroDialogBox boxWarning">' . '<p>' . '<strong>' . get_lang('Warning') . '</strong>' . "\n" . ' : ' . get_lang('We highly recommend that you <strong>protect or remove the <em>/claroline/install/</em> directory</strong>.') . "\n" . '</p>' . '</div>' . "\n" . '<fieldset>' . "\n" . '<legend>' . get_lang('Do not forget to') . '</legend>' . '<ul>' . '<li>' . get_lang('Tune your platform configuration in %administration | %configuration', array('%administration' => get_lang('Administration'), '%configuration' => get_lang('Configuration'))) . "\n" . '</li>' . '<li>' . get_lang('Build your course category tree in %administration | %manage course categories', array('%administration' => get_lang('Administration'), '%manage course categories' => get_lang('Manage course categories'))) . "\n" . '</li>' . '<li>' . get_lang('Edit or clear text zones in %administration | %edit text zones', array('%administration' => get_lang('Administration'), '%edit text zones' => get_lang('Edit text zones'))) . "\n" . '</li>' . '</ul>' . "\n" . '</fieldset>' . "\n" . '<div id="goToCampusLink">' . "\n" . '<a href="../../index.php">' . get_lang('Go to your brand new campus') . '</a>' . "\n" . '</div>' . "\n"; } else { echo get_lang('Unhandled error') . '<br />' . "\n" . '<br />' . "\n" . get_lang('Please report and explain this issue on <a href="%forumUrl">Claroline\'s support forums</a>', array('%forumUrl' => 'http://forum.claroline.net')); } // navigation buttons $htmlNextPrevButton = '<div id="navigation">' . "\n" . '<div id="navToNext">' . "\n"; if (!is_null($stepPos) && $stepPos !== false && $stepPos + 1 < count($panelSequence)) { $htmlNextPrevButton .= '<input type="submit" name="' . $cmdName[$panelSequence[$stepPos + 1]] . '" value="' . get_lang('Next') . ' > " ' . ($nextStepDisable ? 'disabled="disabled"' : '') . ' />' . "\n"; } elseif (DISP_LAST_CHECK_BEFORE_INSTALL == $display) { $htmlNextPrevButton .= '<input type="submit" name="cmdDoInstall" value="' . get_lang('Install Claroline') . '" />' . "\n"; }
} } else { $coursesRepositorySysMissing = TRUE; $display = DISP_RUN_INSTALL_NOT_COMPLETE; } if (file_exists($garbageRepositorySys)) { if (!is_writable($garbageRepositorySys)) { $garbageRepositorySysWriteProtected = TRUE; $display = DISP_RUN_INSTALL_NOT_COMPLETE; } } else { $garbageRepositorySysMissing = TRUE; $display = DISP_RUN_INSTALL_NOT_COMPLETE; } if (file_exists(claro_get_conf_repository())) { if (!is_writable(claro_get_conf_repository())) { $platformConfigRepositorySysWriteProtected = TRUE; $display = DISP_RUN_INSTALL_NOT_COMPLETE; } } else { $platformConfigRepositorySysMissing = TRUE; $display = DISP_RUN_INSTALL_NOT_COMPLETE; } /** * Initialise right profile */ include_once 'init_profile_right.lib.php'; create_required_profile(); /** * ADD MODULES */
* CLAROLINE * * @version 1.9 $Revision: 12923 $ * @copyright (c) 2001-2011, Universite catholique de Louvain (UCL) * @license http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE * @package CLICAL * @author Claro Team <*****@*****.**> */ /** * This lib use * * cache lite * * icalendar/class.iCal.inc.php * */ require_once claro_get_conf_repository() . 'rss.conf.php'; require_once claro_get_conf_repository() . 'ical.conf.php'; FromKernel::uses('thirdparty/icalendar/class.iCal.inc'); /** * return the mime type for a requested format * * @param fortma $calType : ics,xcs,rdf * @return string mimetype */ function get_ical_MimeType($calType) { switch ($calType) { case 'ics': return 'text/Calendar'; case 'xcs': return 'text/Calendar'; case 'rdf':
} $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 $mainCourseToolList = claro_get_main_course_tool_list(); // 2. get list af already installed tools from course $tbl_mdb_names = claro_sql_get_main_tbl(); $tbl_tool = $tbl_mdb_names['tool']; $sql = " SELECT pct.id AS toolId ,\n pct.claro_label AS label\n\n FROM `" . $_course['dbNameGlu'] . "tool_list` AS ctl\n INNER JOIN `" . $tbl_tool . "` AS pct\n ON `ctl`.`tool_id` = `pct`.`id`\n WHERE ctl.installed = 'true'"; $courseToolList = claro_sql_query_fetch_all_rows($sql); $tmp = array(); foreach ($courseToolList as $thisCourseTool) { $tmp[$thisCourseTool['label']] = $thisCourseTool['toolId']; } // 3. compare the two lists and register and install/activate missing tool if necessary $listOfToolsToAdd = array(); foreach ($mainCourseToolList as $thisToolId => $thisMainCourseTool) { if (!array_key_exists($thisMainCourseTool['label'], $tmp)) {
* @version $Revision: 14576 $ * @copyright (c) 2001-2011, Universite catholique de Louvain (UCL) * @author Claroline Team <*****@*****.**> * @author Christophe Mertens <*****@*****.**> * @license http://www.gnu.org/copyleft/gpl.html * GNU GENERAL PUBLIC LICENSE version 2 or later * @package internal_messaging */ $cidReset = true; require_once dirname(__FILE__) . '/../../claroline/inc/claro_init_global.inc.php'; require_once get_path('incRepositorySys') . '/lib/user.lib.php'; // ------------- Business Logic --------------------------- if (!claro_is_user_authenticated()) { claro_disp_auth_form(false); } include claro_get_conf_repository() . 'CLMSG.conf.php'; require_once dirname(__FILE__) . '/lib/permission.lib.php'; $userId = isset($_REQUEST['userId']) ? (int) $_REQUEST['userId'] : null; $link_arg = array(); if (!is_null($userId) && !empty($userId)) { $currentUserId = (int) $_REQUEST['userId']; $link_arg['userId'] = $currentUserId; } else { $currentUserId = claro_get_current_user_id(); } if ($currentUserId != claro_get_current_user_id() && !claro_is_platform_admin()) { claro_die(get_lang("Not allowed")); } // user exist ? if ($currentUserId != claro_get_current_user_id()) { $userData = user_get_properties($currentUserId);
*/ /*===================================================================== 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'; $nameTools = get_lang('My user account'); // define display define('DISP_PROFILE_FORM', __LINE__); define('DISP_MOREINFO_FORM', __LINE__); define('DISP_REQUEST_COURSE_CREATOR_STATUS', __LINE__); define('DISP_REQUEST_REVOQUATION', __LINE__); $display = DISP_PROFILE_FORM;
/** * Load configuration file given its name * @param string $name */ function load_kernel_config($name) { $name = secure_file_path($name); if (file_exists(claro_get_conf_repository() . $name . '.conf.php')) { include claro_get_conf_repository() . $name . '.conf.php'; } }