コード例 #1
0
ファイル: notification_date.php プロジェクト: rhertzog/lcs
 * @author      Claro Team <*****@*****.**>
 * @since       1.10
 */
require_once dirname(__FILE__) . '/inc/claro_init_global.inc.php';
if (claro_is_user_authenticated()) {
    require_once get_path('incRepositorySys') . '/lib/form.lib.php';
    $dialogBox = new DialogBox();
    $display_form = true;
    if (isset($_REQUEST['fday']) && is_numeric($_REQUEST['fday']) && (isset($_REQUEST['fmonth']) && is_numeric($_REQUEST['fmonth'])) && (isset($_REQUEST['fyear']) && is_numeric($_REQUEST['fyear']))) {
        $_SESSION['last_action'] = $_REQUEST['fyear'] . '-' . $_REQUEST['fmonth'] . '-' . $_REQUEST['fday'] . ' 00:00:00';
        if (claro_get_current_course_id() != '') {
            claro_redirect(Url::Contextualize(get_path('clarolineRepositoryWeb') . '/course/index.php'));
        } else {
            claro_redirect(get_path('clarolineRepositoryWeb') . '/index.php');
        }
    }
    /**
     *     DISPLAY SECTION
     *
     */
    $output = '';
    $output .= claro_html_title(get_lang('Change notification date'), 2);
    $output .= $dialogBox->render();
    if ($display_form) {
        $output .= '<form method="get" action="' . claro_htmlspecialchars($_SERVER['PHP_SELF']) . '">' . claro_form_relay_context() . '<fieldset>' . "\n" . '<dd>' . claro_html_date_form('fday', 'fmonth', 'fyear', 0, 'long') . ' ' . '</dd>' . "\n" . '</dl>' . '</fieldset>' . '<input type="submit" class="claroButton" name="notificationDate" value="' . get_lang('Ok') . '" />' . "\n" . '</form>' . "\n";
    }
    Claroline::getDisplay()->body->appendContent($output);
    echo Claroline::getDisplay()->render();
} else {
    claro_redirect('index.php');
}
コード例 #2
0
ファイル: tool_access_details.php プロジェクト: rhertzog/lcs
} else {
    $displayType = '';
}
if (!empty($_REQUEST['period']) && in_array($_REQUEST['period'], array('year', 'month', 'day'))) {
    $period = $_REQUEST['period'];
} else {
    $period = 'day';
}
if (!empty($_REQUEST['reqdate'])) {
    $reqdate = (int) $_REQUEST['reqdate'];
} else {
    $reqdate = time();
}
// toolId is required, go to the tool list if it is missing
if (empty($_REQUEST['toolId'])) {
    claro_redirect("./courseReport.php");
    exit;
} else {
    // FIXME what if tool do not exists anymore ? is not in course tool list ? is deactivated ?
    $toolId = (int) $_REQUEST['toolId'];
}
/*
 * Output
 */
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Statistics'), 'courseReport.php');
$nameTools = get_lang('Statistics');
$html = '';
$langMonthNames = get_locale('langMonthNames');
if (claro_is_in_a_course()) {
    // to see stats of one course user must be courseAdmin of this course
    $is_allowedToTrack = claro_is_course_manager();
コード例 #3
0
ファイル: shibbolethUser.php プロジェクト: rhertzog/lcs
                $sqlPrepareList[] = 'nom = "' . addslashes(utf8_decode($_SERVER[$shibbolethData['nom']])) . '"';
                $sqlPrepareList[] = 'prenom = "' . addslashes(utf8_decode($_SERVER[$shibbolethData['prenom']])) . '"';
                // Use first email only
                $shibbolethEmail = explode($shibbolethEmailSep, $_SERVER[$shibbolethData['email']]);
                if ($shibbolethEmail[0] == '') {
                    $shibbolethEmail[0] = $shibbolethDefaultEmail;
                }
                $sqlPrepareList[] = 'email = "' . addslashes($shibbolethEmail[0]) . '"';
                $sqlPrepareList[] = 'authSource = "' . $shibbolethAuthSource . '"';
                $sqlPrepareList[] = '`' . $shibbolethUidTbl . '` = "' . $_SERVER[$shibbolethUniqueIdAttr] . '"';
                if ($shibbolethUidTbl != 'username') {
                    $sqlPrepareList[] = 'username = "******"';
                }
                $sql = 'UPDATE `' . $tbl_user . '` ' . 'SET ' . implode(', ', $sqlPrepareList) . ' ' . 'WHERE user_id = ' . (int) $_uid;
                $res = mysql_query($sql) or die('<center>UPDATE QUERY FAILED LINE ' . __LINE__ . '<center>');
                // redirect as normal login back to "My User Account"
                session_destroy();
                claro_redirect(get_conf('claro_ShibbolethPath') . 'index.php?sourceUrl=' . base64_encode($rootWeb . "claroline/auth/profile.php"));
            }
        } else {
            // was not logged in
            claro_die("<center>WARNING ! UNABLE TO CHANGE AUTHSOURCE. <a href=\"" . $rootWeb . "\">LOGIN FIRST</a>!.</center>");
        }
    } else {
        // Shibboleth authentication failed
        claro_die("<center>WARNING ! SHIBBOLETH AUTHENTICATION FAILED.</center>");
    }
} else {
    // Directory not protected
    claro_die("<center>WARNING ! PROTECT THIS FOLDER IN YOUR WEBSERVER CONFIGURATION.</center>");
}
コード例 #4
0
ファイル: work_list.php プロジェクト: rhertzog/lcs
// redirect to the submission form prefilled with a .url document targetting the published document
/**
 * @todo $_REQUEST['submitGroupWorkUrl'] must be treated in  filter process
 */
if (isset($_REQUEST['submitGroupWorkUrl']) && !empty($_REQUEST['submitGroupWorkUrl']) && claro_is_in_a_group()) {
    claro_redirect(Url::Contextualize('user_work.php?authId=' . claro_get_current_group_id() . '&cmd=rqSubWrk' . '&assigId=' . $req['assignmentId'] . '&submitGroupWorkUrl=' . urlencode($_REQUEST['submitGroupWorkUrl'])));
    exit;
}
/*============================================================================
    Permissions
  ============================================================================*/
$assignmentIsVisible = (bool) ($assignment->getVisibility() == 'VISIBLE');
$is_allowedToEditAll = (bool) claro_is_allowed_to_edit();
if (!$assignmentIsVisible && !$is_allowedToEditAll) {
    // if assignment is not visible and user is not course admin or upper
    claro_redirect(Url::Contextualize('work.php'));
    exit;
}
// upload or update is allowed between start and end date or after end date if late upload is allowed
$uploadDateIsOk = $assignment->isUploadDateOk();
if ($assignment->getAssignmentType() == 'INDIVIDUAL') {
    // user is authed and allowed
    $userCanPost = (bool) (claro_is_user_authenticated() && claro_is_course_allowed() && claro_is_course_member());
} else {
    $userGroupList = get_user_group_list(claro_get_current_user_id());
    // check if user is member of at least one group
    $userCanPost = (bool) (!empty($userGroupList));
}
$is_allowedToSubmit = (bool) ($assignmentIsVisible && $uploadDateIsOk && $userCanPost) || $is_allowedToEditAll;
/*============================================================================
    Update notification
コード例 #5
0
ファイル: adminprofile.php プロジェクト: rhertzog/lcs
// Include libraries
require_once get_path('incRepositorySys') . '/lib/user.lib.php';
require_once get_path('incRepositorySys') . '/lib/file.lib.php';
require_once get_path('incRepositorySys') . '/lib/image.lib.php';
require_once get_path('incRepositorySys') . '/lib/fileUpload.lib.php';
require_once get_path('incRepositorySys') . '/lib/fileManage.lib.php';
require_once get_path('incRepositorySys') . '/lib/display/dialogBox.lib.php';
// Initialise variables
$nameTools = get_lang('User settings');
$dialogBox = new DialogBox();
/*=====================================================================
  Main Section
 =====================================================================*/
// see which user we are working with ...
if (empty($_REQUEST['uidToEdit'])) {
    claro_redirect('adminusers.php');
} else {
    $userId = $_REQUEST['uidToEdit'];
}
$user_data = user_get_properties($userId);
if (empty($user_data)) {
    claro_die(get_lang('Unable to load user information'));
}
$user_extra_data = user_get_extra_data($userId);
if (count($user_extra_data)) {
    $dgExtra = new claro_datagrid(user_get_extra_data($userId));
} else {
    $dgExtra = null;
}
if (isset($_REQUEST['applyChange'])) {
    // get params form the form
コード例 #6
0
ファイル: newtopic.php プロジェクト: rhertzog/lcs
include_once get_path('incRepositorySys') . '/lib/forum.lib.php';
// variables
$allowed = TRUE;
$error = FALSE;
$dialogBox = new DialogBox();
$pagetype = 'newtopic';
/*=================================================================
  Main Section
 =================================================================*/
if (isset($_REQUEST['forum'])) {
    $forum_id = (int) $_REQUEST['forum'];
} else {
    $forum_id = 0;
}
if (isset($_REQUEST['cancel'])) {
    claro_redirect('viewforum.php?forum=' . $forum_id);
    exit;
}
if (isset($_REQUEST['subject'])) {
    $subject = $_REQUEST['subject'];
} else {
    $subject = '';
}
// XSS
$subject = strip_tags($subject);
if (isset($_REQUEST['message'])) {
    $message = $_REQUEST['message'];
} else {
    $message = '';
}
// XSS
コード例 #7
0
ファイル: page.php プロジェクト: rhertzog/lcs
 *              through the world-wide-web at http://www.gnu.org/copyleft/gpl.html
 * @author      Frederic Minne <*****@*****.**>
 * @package     Wiki
 */
$tlabelReq = 'CLWIKI';
require_once '../inc/claro_init_global.inc.php';
if (!claro_is_tool_allowed()) {
    if (!claro_is_in_a_course()) {
        claro_die(get_lang("Not allowed"));
    } else {
        claro_disp_auth_form(true);
    }
}
// check and set user access level for the tool
if (!isset($_REQUEST['wikiId'])) {
    claro_redirect(Url::Contextualize("wiki.php"));
    exit;
}
// set admin mode and groupId
claro_set_display_mode_available(TRUE);
$is_allowedToAdmin = claro_is_allowed_to_edit() || claro_is_in_a_group() && claro_is_group_tutor();
if (claro_is_in_a_group() && claro_is_group_allowed()) {
    // group context
    $groupId = (int) claro_get_current_group_id();
} elseif (claro_is_in_a_group() && !claro_is_group_allowed()) {
    claro_die(get_lang("Not allowed"));
} elseif (claro_is_course_allowed()) {
    // course context
    $groupId = 0;
} else {
    claro_disp_auth_form();
コード例 #8
0
            $claroline->notifier->event('download', array('data' => array('url' => $document_url)));
            if ($wasFolder) {
                unlink($pathInfo);
            }
            if (!$canRetry) {
                $sql = 'DELETE FROM `' . $tableName . '` WHERE token = \'' . claro_sql_escape($token) . '\'';
                Claroline::getDatabase()->exec($sql);
            }
        } else {
            header('HTTP/1.1 404 Not Found');
            claro_die(get_lang('File download failed : %failureMSg%', array('%failureMsg%' => claro_failure::get_last_failure())));
        }
    } else {
        $sql = 'DELETE FROM `' . $tableName . '` WHERE token = \'' . claro_sql_escape($token) . '\'';
        Claroline::getDatabase()->exec($sql);
        // redirect to document
        claro_redirect($document_url);
    }
} else {
    header('HTTP/1.1 404 Not Found');
}
//Clean left zip here
$sql = 'SELECT * FROM `' . $tableName . '` WHERE ADDTIME(`requestTime`,\'0 0:0:30\') < NOW() AND NOT `wasFolder` = \'0\'';
$result = Claroline::getDatabase()->query($sql);
while (($row = $result->fetch()) !== false) {
    if (is_file($row['requestedPath'])) {
        unlink($row['requestedPath']);
    }
}
$sql = 'DELETE FROM `' . $tableName . '` WHERE ADDTIME(`requestTime`,\'0 0:0:30\') < NOW()';
Claroline::getDatabase()->exec($sql);
コード例 #9
0
ファイル: courses.php プロジェクト: rhertzog/lcs
     * themself or either be here from admin tool
     */
    if (!empty($uidToEdit)) {
        $userId = $uidToEdit;
    } else {
        // Default use is enroll for itself
        $userId = claro_get_current_user_id();
        $uidToEdit = claro_get_current_user_id();
    }
} else {
    if (get_conf('allowToSelfEnroll', true)) {
        $userId = claro_get_current_user_id();
        // default use is enroll for itself...
        $uidToEdit = claro_get_current_user_id();
    } else {
        claro_redirect('..');
    }
}
/*---------------------------------------------------------------------
Define breadcrumbs
---------------------------------------------------------------------*/
if (isset($_REQUEST['addNewCourse'])) {
    ClaroBreadCrumbs::getInstance()->prepend(get_lang('My personal course list'), $_SERVER['PHP_SELF']);
}
/*---------------------------------------------------------------------
Breadcrumbs is different if we come from admin tool
---------------------------------------------------------------------*/
if (!empty($fromAdmin)) {
    if ($fromAdmin == 'settings' || $fromAdmin == 'usercourse' || $fromAdmin == 'class') {
        ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb'));
    }
コード例 #10
0
ファイル: settings.php プロジェクト: rhertzog/lcs
                    include get_path('incRepositorySys') . '/claro_init_local.inc.php';
                }
            } else {
                $dialogBox->error(get_lang('Unable to save'));
            }
        } else {
            $dialogBox->error($course->backlog->output());
        }
    }
    if ($cmd == 'exDelete') {
        if ($course->delete()) {
            $claroline->log('DELETION COURSE', array('courseName' => $course->title, 'uid' => claro_get_current_user_id()));
            if ($adminContext) {
                claro_redirect(get_path('rootAdminWeb') . '/admin_courses.php');
            } else {
                claro_redirect(get_path('url') . '/index.php');
            }
        } else {
            $dialogBox->error(get_lang('Unable to delete'));
        }
    }
    if ($cmd == 'rqDelete') {
        $display = DISP_COURSE_RQ_DELETE;
    }
} else {
    // course data load failed
    claro_die(get_lang('Wrong parameters'));
}
// Command list
$cmdList = array();
$cmdList[] = array('img' => 'edit', 'name' => get_lang('Edit Tool list'), 'url' => claro_htmlspecialchars(Url::Contextualize(get_path('clarolineRepositoryWeb') . 'course/tools.php')));
コード例 #11
0
ファイル: insertMyDoc.php プロジェクト: rhertzog/lcs
$TABLEMODULE = $tbl_lp_module;
$TABLEASSET = $tbl_lp_asset;
$dbTable = $tbl_cdb_names['document'];
// document browser vars
$TABLEDOCUMENT = claro_get_current_course_data('dbNameGlu') . 'document';
$courseDir = claro_get_course_path() . '/document';
$moduleDir = claro_get_course_path() . '/modules';
$baseWorkDir = get_path('coursesRepositorySys') . $courseDir;
$moduleWorkDir = get_path('coursesRepositorySys') . $moduleDir;
//lib of this tool
require_once get_path('incRepositorySys') . "/lib/learnPath.lib.inc.php";
require_once get_path('incRepositorySys') . "/lib/fileDisplay.lib.php";
require_once get_path('incRepositorySys') . "/lib/fileManage.lib.php";
// $_SESSION
if (!isset($_SESSION['path_id'])) {
    claro_redirect(Url::Contextualize("./learningPath.php"));
}
/*======================================
       CLAROLINE MAIN
 ======================================*/
// FUNCTION NEEDED TO BUILD THE QUERY TO SELECT THE MODULES THAT MUST BE AVAILABLE
// 1)  We select first the modules that must not be displayed because
// as they are already in this learning path
function buildRequestModules()
{
    global $TABLELEARNPATHMODULE;
    global $TABLEMODULE;
    $firstSql = "SELECT `module_id`\n              FROM `" . $TABLELEARNPATHMODULE . "` AS LPM\n              WHERE LPM.`learnPath_id` = " . (int) $_SESSION['path_id'];
    $firstResult = claro_sql_query($firstSql);
    // 2) We build the request to get the modules we need
    $sql = "SELECT M.*\n         FROM `" . $TABLEMODULE . "` AS M\n         WHERE 1 = 1";
コード例 #12
0
// all I need from REQUEST is the track_id and it is required
if (isset($_REQUEST['trackedExId']) && is_numeric($_REQUEST['trackedExId'])) {
    $trackedExId = (int) $_REQUEST['trackedExId'];
} else {
    claro_redirect("./exercise.php");
    exit;
}
$dialogBox = new DialogBox();
//-- get infos
// get infos about the exercise
// get infos about the user
// get infos about the exercise attempt
$sql = "SELECT `E`.`id`, `E`.`title`, `E`.`showAnswers`, `E`.`attempts`,\n                `U`.`user_id`, `U`.`nom` as `lastname`, `U`.`prenom` as `firstname`,\n                `TE`.`exo_id`, `TE`.`result`, `TE`.`time`, `TE`.`weighting`,\n                UNIX_TIMESTAMP(`TE`.`date`) AS `unix_exe_date`\n        FROM `" . $tbl_qwz_exercise . "` as `E`, `" . $tbl_qwz_tracking . "` as `TE`, `" . $tbl_user . "` as `U`\n        WHERE `E`.`id` = `TE`.`exo_id`\n        AND `TE`.`user_id` = `U`.`user_id`\n        AND `TE`.`id` = " . $trackedExId;
if (!($thisAttemptDetails = claro_sql_query_get_single_row($sql))) {
    // sql error, let's get out of here !
    claro_redirect("./exercise.php");
    exit;
}
//-- permissions
// if a user want to see its own results the teacher must have allowed the students
// to see the answers at the end of the exercise
$is_allowedToTrack = false;
if (claro_is_user_authenticated()) {
    if (claro_is_course_manager()) {
        $is_allowedToTrack = true;
    } elseif (claro_get_current_user_id() == $thisAttemptDetails['user_id']) {
        if ($thisAttemptDetails['showAnswers'] == 'ALWAYS') {
            $is_allowedToTrack = true;
        } elseif ($thisAttemptDetails['showAnswers'] == 'LASTTRY') {
            // we must check that user has at least "max_attempt" results
            $sql = "SELECT COUNT(`id`)\n                    FROM `" . $tbl_qwz_tracking . "`\n                    WHERE `user_id` = " . (int) claro_get_current_user_id() . "\n                    AND `exo_id` = " . $thisAttemptDetails['exo_id'];
コード例 #13
0
ファイル: learnPath_details.php プロジェクト: rhertzog/lcs
 *
 * @author Claro Team <*****@*****.**>
 *
 */
require '../inc/claro_init_global.inc.php';
load_module_config('CLLNP');
require_once get_path('incRepositorySys') . '/lib/class.lib.php';
if (!claro_is_in_a_course() || !claro_is_course_allowed()) {
    claro_disp_auth_form(true);
}
if (!claro_is_course_manager()) {
    claro_die(get_lang('Not allowed'));
}
// path id can not be empty, return to the list of learning paths
if (empty($_REQUEST['path_id'])) {
    claro_redirect("../learnPath/learningPathList.php");
    exit;
}
$nameTools = get_lang('Learning paths tracking');
ClaroBreadCrumbs::getInstance()->setCurrent($nameTools, Url::Contextualize('learnPath_details.php?path_id=' . $_REQUEST['path_id']));
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Learning path list'), Url::Contextualize(get_module_url('CLLNP') . '/learningPathList.php'));
// regroup table names for maintenance purpose
/*
 * DB tables definition
 */
$tbl_cdb_names = claro_sql_get_course_tbl();
$tbl_mdb_names = claro_sql_get_main_tbl();
$tbl_rel_course_user = $tbl_mdb_names['rel_course_user'];
$tbl_user = $tbl_mdb_names['user'];
$tbl_lp_learnPath = $tbl_cdb_names['lp_learnPath'];
$tbl_lp_rel_learnPath_module = $tbl_cdb_names['lp_rel_learnPath_module'];
コード例 #14
0
ファイル: lp_modules_details.php プロジェクト: rhertzog/lcs
// $Id: lp_modules_details.php 14403 2013-02-18 08:18:35Z kitan1982 $
/**
 * CLAROLINE
 *
 * @version     $Revision: 14403 $
 * @copyright   (c) 2001-2011, Universite catholique de Louvain (UCL)
 * @license     http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE
 * @author      Claro Team <*****@*****.**>
 */
require '../inc/claro_init_global.inc.php';
if (empty($_REQUEST['uInfo'])) {
    claro_redirect("./userReport.php");
    exit;
}
if (empty($_REQUEST['path_id'])) {
    claro_redirect("./userReport.php?uInfo=" . $_REQUEST['uInfo'] . "&view=0010000");
    exit;
}
/*
 * DB tables definition
 */
$tbl_cdb_names = claro_sql_get_course_tbl();
$tbl_mdb_names = claro_sql_get_main_tbl();
$tbl_rel_course_user = $tbl_mdb_names['rel_course_user'];
$tbl_user = $tbl_mdb_names['user'];
$tbl_lp_learnPath = $tbl_cdb_names['lp_learnPath'];
$tbl_lp_rel_learnPath_module = $tbl_cdb_names['lp_rel_learnPath_module'];
$tbl_lp_user_module_progress = $tbl_cdb_names['lp_user_module_progress'];
$tbl_lp_module = $tbl_cdb_names['lp_module'];
$tbl_lp_asset = $tbl_cdb_names['lp_asset'];
// table names
コード例 #15
0
ファイル: track_exercise_reset.php プロジェクト: rhertzog/lcs
 * CLAROLINE
 *
 * @version     $Revision: 14305 $
 * @copyright   (c) 2001-2011, Universite catholique de Louvain (UCL)
 * @license     http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE
 * @package     CLTRACK
 * @author      Claro Team <*****@*****.**>
 */
try {
    $tlabelReq = 'CLQWZ';
    require_once dirname(__FILE__) . '/../../claroline/inc/claro_init_global.inc.php';
    if (!claro_is_in_a_course() || !claro_is_user_authenticated()) {
        claro_disp_auth_form(true);
    }
    if (!claro_is_course_manager()) {
        claro_redirect(Url::Contextualize("../exercise/exercise.php"));
    }
    FromKernel::uses('utils/input.lib', 'utils/validator.lib');
    $userInput = Claro_UserInput::getInstance();
    $cmd = $userInput->get('cmd');
    $trackingReset = new CLQWZ_TrackingReset(claro_get_current_course_id());
    $dialogBox = new DialogBox();
    if ('resetAttemptForUser' == $cmd) {
        $userId = $userInput->getMandatory('userId');
        $trackId = $userInput->getMandatory('trackId');
        $trackingReset->resetAttemptForUser($userId, $trackId);
        $dialogBox->success('<p>' . get_lang('User attempt deleted from tracking') . '</p>');
    } elseif ('resetAllAttemptsForUser' == $cmd) {
        $userId = $userInput->getMandatory('userId');
        $exId = $userInput->getMandatory('exId');
        $trackingReset->resetAllAttemptsForUser($userId, $exId);
コード例 #16
0
ファイル: login.php プロジェクト: rhertzog/lcs
        $claroline->display->body->appendContent($out);
        echo $claroline->display->render();
    } elseif ($userLoggedOnCas && isset($_SESSION['casCallBackUrl'])) {
        claro_redirect($_SESSION['casCallBackUrl']);
    } elseif (isset($sourceUrl)) {
        $sourceUrl = base64_decode($sourceUrl);
        if (isset($_REQUEST['sourceCid'])) {
            $sourceUrl .= (strstr($sourceUrl, '?') ? '&' : '?') . 'cidReq=' . $_REQUEST['sourceCid'];
        }
        if (isset($_REQUEST['sourceGid'])) {
            $sourceUrl .= (strstr($sourceUrl, '?') ? '&' : '?') . 'gidReq=' . $_REQUEST['sourceGid'];
        }
        if (!preg_match('/^http/', $sourceUrl) && get_conf('claro_secureLogin', false)) {
            $sourceUrl = 'http://' . $_SERVER['HTTP_HOST'] . $sourceUrl;
        }
        claro_redirect($sourceUrl);
    } elseif (claro_is_in_a_course()) {
        // claro_redirect(get_path('coursesRepositoryWeb') . '/' . claro_get_course_path());
        if (get_conf('claro_secureLogin', false)) {
            claro_redirect('http://' . $_SERVER['HTTP_HOST'] . get_path('clarolineRepositoryWeb') . 'claroline/course?cid=' . claro_get_current_course_id());
        } else {
            claro_redirect(get_path('clarolineRepositoryWeb') . 'claroline/course?cid=' . claro_get_current_course_id());
        }
    } else {
        if (get_conf('claro_secureLogin', false)) {
            claro_redirect('http://' . $_SERVER['HTTP_HOST'] . get_path('clarolineRepositoryWeb'));
        } else {
            claro_redirect(get_path('clarolineRepositoryWeb'));
        }
    }
}
コード例 #17
0
ファイル: reply.php プロジェクト: rhertzog/lcs
$pagetype = 'reply';
/*=================================================================
  Main Section
 =================================================================*/
if (isset($_REQUEST['forum'])) {
    $forum_id = (int) $_REQUEST['forum'];
} else {
    $forum_id = 0;
}
if (isset($_REQUEST['topic'])) {
    $topic_id = (int) $_REQUEST['topic'];
} else {
    $topic_id = 0;
}
if (isset($_REQUEST['cancel'])) {
    claro_redirect(Url::Contextualize(get_module_url('CLFRM') . '/viewtopic.php?topic=' . $topic_id . '&forum=' . $forum_id));
    exit;
}
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);
$topicSettingList = get_topic_settings($topic_id);
if (!claro_is_user_authenticated() || !claro_is_in_a_course()) {
    claro_disp_auth_form(true);
} elseif ($topicSettingList) {
    if ($forum_id != $topicSettingList['forum_id']) {
        $allowed = FALSE;
コード例 #18
0
ファイル: inscription.php プロジェクト: rhertzog/lcs
 * CLAROLINE
 *
 * @version     $Revision: 13949 $
 * @copyright   (c) 2001-2011, Universite catholique de Louvain (UCL)
 * @license     http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE
 * @package     CLAUTH
 * @author      Claro Team <*****@*****.**>
 */
define('DISP_REGISTRATION_FORM', __LINE__);
define('DISP_REGISTRATION_SUCCEED', __LINE__);
define('DISP_REGISTRATION_AGREEMENT', __LINE__);
define('DISP_REGISTRATION_NOT_ALLOWED', __LINE__);
require '../inc/claro_init_global.inc.php';
// Already logged
if (claro_is_user_authenticated()) {
    claro_redirect(get_conf('urlAppend') . '/index.php');
    exit;
}
// include profile library
include claro_get_conf_repository() . 'user_profile.conf.php';
if (!get_conf('allowSelfReg', false)) {
    claro_die(get_lang('Not allowed'));
}
include_once get_path('incRepositorySys') . '/lib/user.lib.php';
include_once get_path('incRepositorySys') . '/lib/sendmail.lib.php';
$agreementText = claro_text_zone::get_content('textzone_inscription');
if ('' == $agreementText && file_exists('./textzone_inscription.inc.html')) {
    $agreementText = file_get_contents('./textzone_inscription.inc.html');
    // Introduction message if needed
    if ('' == trim(strip_tags($agreementText, '<img><embed><object>'))) {
        $agreementText = '';
コード例 #19
0
ファイル: learningPath.php プロジェクト: rhertzog/lcs
include_once get_path('incRepositorySys') . '/lib/fileDisplay.lib.php';
// $_SESSION
if (isset($_GET['path_id']) && $_GET['path_id'] > 0) {
    $_SESSION['path_id'] = (int) $_GET['path_id'];
} elseif (!isset($_SESSION['path_id']) || $_SESSION['path_id'] == "") {
    // if path id not set, redirect user to the home page of learning path
    claro_redirect(Url::Contextualize(get_module_url('CLLNP') . '/learningPathList.php'));
    exit;
}
// use viewMode
claro_set_display_mode_available(true);
// permissions (only for the viewmode, there is nothing to edit here )
if (claro_is_allowed_to_edit()) {
    // if the fct return true it means that user is a course manager and than view mode is set to COURSE_ADMIN
    $pathId = (int) $_SESSION['path_id'];
    claro_redirect(Url::Contextualize(get_module_url('CLLNP') . '/learningPathAdmin.php?path_id=' . $pathId));
    exit;
}
// main page
//####################################################################################\\
//############################## MODULE TABLE LIST PREPARATION #######################\\
//####################################################################################\\
if (is_learnpath_accessible((int) $_SESSION['path_id']) && !claro_is_allowed_to_edit()) {
    claro_die(get_lang('Not allowed'));
}
$cmd = isset($_REQUEST['cmd']) ? $_REQUEST['cmd'] : '';
if (get_conf('cllnp_resetByUserAllowed', false) || claro_is_allowed_to_edit()) {
    switch ($cmd) {
        case "resetModuleProgression":
            $learnPath_module_id = isset($_GET['learnPath_module_id']) ? $_GET['learnPath_module_id'] : '';
            if (!empty($learnPath_module_id) && claro_is_user_authenticated()) {
コード例 #20
0
ファイル: index.php プロジェクト: rhertzog/lcs
        $templateCategoryBrowser = $categoryBrowser->getTemplate();
        $template->assign('templateCategoryBrowser', $templateCategoryBrowser);
    }
    // Render
    $claroline->display->body->setContent($template->render());
    if (!(isset($_REQUEST['logout']) && isset($_SESSION['isVirtualUser']))) {
        echo $claroline->display->render();
    }
} else {
    require_once get_path('clarolineRepositorySys') . '/desktop/index.php';
}
// Logout request : delete session data
if (isset($_REQUEST['logout'])) {
    if (isset($_SESSION['isVirtualUser'])) {
        unset($_SESSION['isVirtualUser']);
        claro_redirect(get_conf('rootWeb') . 'claroline/admin/admin_users.php');
        exit;
    }
    // notify that a user has just loggued out
    if (isset($logout_uid)) {
        $eventNotifier->notifyEvent('user_logout', array('uid' => $logout_uid));
    }
    /* needed to be able to :
       - log with claroline when 'magic login' has previously been clicked
       - notify logout event
       (logout from CAS has been commented in casProcess.inc.php)*/
    if (get_conf('claro_CasEnabled', false) && (get_conf('claro_CasGlobalLogout') && !phpCAS::checkAuthentication())) {
        phpCAS::logout((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . get_conf('urlAppend') . '/index.php');
    }
    session_destroy();
}
コード例 #21
0
ファイル: index.php プロジェクト: rhertzog/lcs
// $Id: index.php 13708 2011-10-19 10:46:34Z abourguignon $
/**
 * CLAROLINE
 *
 * Shibboleth / Switch AAI.
 * Authenticate User with Shibboleth authSource.
 *
 * @version     0.4
 * @author      Daniel Streiff <*****@*****.**>
 */
// Shibboleth attributes available, process login
$_REQUEST['shibbolethLogin'] = true;
require '../../../inc/claro_init_global.inc.php';
// The unique id has to contain something
if (isset($_SERVER[$shibbolethUniqueIdAttr])) {
    if (!$_SERVER[$shibbolethUniqueIdAttr] == '') {
        // Redirect to rootWeb
        if (isset($_REQUEST['sourceUrl'])) {
            $sourceUrl = base64_decode($_REQUEST['sourceUrl']);
            claro_redirect($sourceUrl);
        } else {
            claro_redirect($rootWeb);
        }
    } else {
        // Shibboleth authentication failed
        claro_die('<center>WARNING ! SHIBBOLETH AUTHENTICATION FAILED.</center>');
    }
} else {
    // Directory not protected
    claro_die('<center>WARNING ! PROTECT THIS FOLDER IN YOUR WEBSERVER CONFIGURATION.</center>');
}
コード例 #22
0
ファイル: admin_search.php プロジェクト: rhertzog/lcs
            } else {
                $arguments['date2'] = $day2 . '/' . $month2 . '/' . $year2;
            }
        }
        if (!isset($arguments['date1']) || !isset($arguments['date2'])) {
            $displayTable = FALSE;
        } else {
            $strategy->setStrategy(AdminBoxStrategy::DATED_INTERVAL, array('date1' => strtotime($year1 . '-' . $month1 . '-' . $day1), 'date2' => strtotime($year2 . '-' . $month2 . '-' . $day2)));
        }
    }
    if ($arguments['search'] == 'platformMessage') {
        $subTitle = get_lang('All platform messages');
        $strategy->setStrategy(AdminBoxStrategy::PLATFORM_MESSAGE);
    }
} else {
    claro_redirect('./admin.php');
}
if (isset($_REQUEST['cmd']) && in_array($_REQUEST['cmd'], $acceptedCommand)) {
    $cmd = $_REQUEST['cmd'];
    if ($cmd == "exDeleteSelection" && isset($_REQUEST['msg']) && is_array($_REQUEST['msg'])) {
        $box->deleteMessageList($_REQUEST['msg']);
    }
    if ($cmd == "rqDeleteSelection" && isset($_REQUEST['msg']) && is_array($_REQUEST['msg'])) {
        $form = get_lang('Are you sure to delete selected message?') . "\n" . '<form action="" method="post">' . "\n" . '<input type="hidden" name="cmd" value="exDeleteSelection" />' . "\n\n";
        foreach ($_REQUEST['msg'] as $count => $idMessage) {
            $form .= '<input type="hidden" name="msg[]" value="' . (int) $idMessage . '" />' . "\n";
        }
        $form .= '<input type="submit" value="' . get_lang('Yes') . '" /> ' . "\n" . '<a href=""><input type="button" value="' . get_lang('No') . '" /></a>' . "\n" . '</form>' . "\n\n";
        $dialogbox = new DialogBox();
        $dialogbox->form($form);
        $content .= $dialogbox->render();
コード例 #23
0
ファイル: editpost.php プロジェクト: rhertzog/lcs
 $forum_name = stripslashes($forumSettingList['forum_name']);
 $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 (!is_null($forumSettingList['idGroup']) && ($forumSettingList['idGroup'] != claro_get_current_group_id() || !claro_is_group_allowed())) {
     // 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
     // one, something weird is happening, indeed ...
     $allowed = false;
     $dialogBox->error(get_lang('Not allowed'));
 } else {
     if (isset($_REQUEST['cancel'])) {
         claro_redirect('viewtopic.php?topic=' . $topic_id);
         exit;
     }
     if (isset($_REQUEST['submit'])) {
         /*-----------------------------------------------------------------
            Edit Post
           -----------------------------------------------------------------*/
         if (!$postSettingList) {
             error_die($err_db_retrieve_data);
         }
         $poster_id = $postSettingList['poster_id'];
         $forum_id = $postSettingList['forum_id'];
         $topic_id = $postSettingList['topic_id'];
         $this_post_time = $postSettingList['post_time'];
         list($day, $time) = explode(' ', $postSettingList['post_time']);
         $date = date('Y-m-d H:i');
コード例 #24
0
ファイル: group_space.php プロジェクト: rhertzog/lcs
        }
    }
}
if (isset($_REQUEST['tutorRegDone'])) {
    $dialogBox->success(get_lang("You are now the tutor of this group."));
}
if (isset($_REQUEST['tutorUnregistration'])) {
    //RECHECK if subscribe is aivailable
    if ($isTutorUnregAllowed) {
        if (isset($_REQUEST['doUnreg'])) {
            //RECHECK if subscribe is aivailable
            if ($isTutorUnregAllowed) {
                $sql = "UPDATE `" . $tbl_group_team . "`\n                SET \n                    `tutor` = NULL\n                WHERE\n                    `id` = " . (int) claro_get_current_group_id();
                if (claro_sql_query($sql)) {
                    // REFRESH THE SCRIPT TO COMPUTE NEW PERMISSIONS ON THE BASSIS OF THIS CHANGE
                    claro_redirect(dirname($_SERVER['PHP_SELF']) . '/group.php?gidReset=1&tutorUnregDone=1');
                    exit;
                }
            }
        } else {
            $dialogBox->form(get_lang('Confirm your unsubscription as tutor from the group &quot;<b>%group_name</b>&quot;', array('%group_name' => claro_get_current_group_data('name'))) . "\n" . '<form action="' . claro_htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">' . "\n" . claro_form_relay_context() . '<input type="hidden" name="tutorUnregistration" value="1" />' . "\n" . '<input type="hidden" name="doUnreg" value="1" />' . "\n" . '<br />' . "\n" . '<input type="submit" value="' . get_lang("Ok") . '" />' . "\n" . claro_html_button(claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'])), get_lang("Cancel")) . "\n" . '</form>' . "\n");
        }
    }
}
/********************************
 * GROUP INFORMATIONS RETRIVIAL
 ********************************/
/*----------------------------------------------------------------------------
GET GROUP MEMBER LIST
----------------------------------------------------------------------------*/
$groupMemberList = get_group_user_list(claro_get_current_group_id(), claro_get_current_course_id());
コード例 #25
0
ファイル: cllp.frames.cnr.php プロジェクト: rhertzog/lcs
 *
 * @package CLDOC
 *
 * @author Sebastien Piraux
 *
 */
$tlabelReq = 'CLDOC';
require_once dirname(__FILE__) . '/../../../claroline/inc/claro_init_global.inc.php';
if (!claro_is_tool_allowed()) {
    if (claro_is_in_a_course()) {
        claro_die(get_lang("Not allowed"));
    } else {
        claro_disp_auth_form(true);
    }
}
$inLP = claro_called_from() == 'CLLP' ? true : false;
if (!$inLP) {
    claro_redirect('../document.php');
}
$url = Url::Contextualize(get_path('url') . '/claroline/backends/download.php?url=' . $_REQUEST['url']);
$claroline->setDisplayType(Claroline::FRAMESET);
$docFrame = new ClaroFrame('document', $url);
$docFrame->allowScrolling(true);
$docFrame->noFrameBorder();
$progressFrame = new ClaroFrame('progress', Url::Contextualize('./cllp.progress.cnr.php'));
$progressFrame->disableResize(true);
$progressFrame->noFrameBorder();
$claroline->display->addRow($docFrame, '*');
$claroline->display->addRow($progressFrame, '50');
// output outer frameset with inner frameset within in embedded mode
echo $claroline->display->render();
コード例 #26
0
ファイル: index.php プロジェクト: rhertzog/lcs
<?php

// $Id: index.php 13708 2011-10-19 10:46:34Z abourguignon $
/**
 * CLAROLINE
 *
 * Select the good agenda waiting that two scripts are merged.
 *
 * @version     $Revision: 13708 $
 * @copyright   (c) 2001-2011, Universite catholique de Louvain (UCL)
 * @license     http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE
 * @package     CLCAL
 * @author      Claro Team <*****@*****.**>
 */
$tlabelReq = 'CLCAL';
require_once dirname(__FILE__) . '/../../claroline/inc/claro_init_global.inc.php';
if (claro_is_in_a_course()) {
    claro_redirect('./agenda.php');
} else {
    claro_redirect('./myagenda.php');
}
exit;
コード例 #27
0
ファイル: casProcess.inc.php プロジェクト: rhertzog/lcs
include_once get_path('incRepositorySys') . '/lib/thirdparty/cas/CAS.php';
// DB table definition
$tbl_mdb_names = claro_sql_get_main_tbl();
$tbl_user = $tbl_mdb_names['user'];
if (!isset($_SESSION['init_CasCheckinDone']) || $logout || basename($_SERVER['SCRIPT_NAME']) == 'login.php' && isset($_REQUEST['authModeReq']) && $_REQUEST['authModeReq'] == 'CAS' || isset($_REQUEST['fromCasServer'])) {
    phpCAS::client(CAS_VERSION_2_0, get_conf('claro_CasServerHostUrl'), get_conf('claro_CasServerHostPort', 443), get_conf('claro_CasServerRoot', ''), FALSE);
    phpCAS::setNoCasServerValidation();
    if ($logout) {
        $userLoggedOnCas = false;
        $logout_url = (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . get_conf('urlAppend') . '/index.php';
        if (get_conf('claro_CasGlobalLogout')) {
            if (phpCAS::checkAuthentication()) {
                phpCAS::logoutWithUrl($logout_url);
            }
        } else {
            claro_redirect($logout_url);
            die;
        }
    } elseif (basename($_SERVER['SCRIPT_NAME']) == 'login.php') {
        // set the call back url
        if (isset($_REQUEST['sourceUrl'])) {
            $casCallBackUrl = base64_decode($_REQUEST['sourceUrl']);
        } else {
            $casCallBackUrl = (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . get_conf('urlAppend') . '/';
        }
        $casCallBackUrl .= (strstr($casCallBackUrl, '?') ? '&' : '?') . 'fromCasServer=true';
        if ($_SESSION['_cid']) {
            $casCallBackUrl .= (strstr($casCallBackUrl, '?') ? '&' : '?') . 'cidReq=' . urlencode($_SESSION['_cid']);
        }
        if ($_SESSION['_gid']) {
            $casCallBackUrl .= (strstr($casCallBackUrl, '?') ? '&' : '?') . 'gidReq=' . urlencode($_SESSION['_gid']);