示例#1
0
文件: profile.php 项目: rhertzog/lcs
    // display revoquation form
    $noQUERY_STRING = true;
    ClaroBreadCrumbs::getInstance()->prepend($nameTools, $_SERVER['PHP_SELF']);
    $nameTools = get_lang('Request to remove this account');
    $display = DISP_REQUEST_REVOQUATION;
} elseif ('editExtraInfo' == $cmd && 0 < count($extraInfoDefList)) {
    // display revoquation form
    $noQUERY_STRING = true;
    $display = DISP_MOREINFO_FORM;
    ClaroBreadCrumbs::getInstance()->prepend($nameTools, $_SERVER['PHP_SELF']);
    $nameTools = get_lang('Complementary fields');
    $userInfo = get_user_property_list(claro_get_current_user_id());
} elseif ('exMoreInfo' == $cmd && 0 < count($extraInfoDefList)) {
    if (array_key_exists('extraInfoList', $_REQUEST)) {
        foreach ($_REQUEST['extraInfoList'] as $extraInfoName => $extraInfoValue) {
            set_user_property(claro_get_current_user_id(), $extraInfoName, $extraInfoValue, 'userExtraInfo');
        }
    }
}
// Initialise
$userData['userExtraInfoList'] = get_user_property_list(claro_get_current_user_id());
// Command list
$cmdList = array();
switch ($display) {
    case DISP_PROFILE_FORM:
        // Display user tracking link
        $profileText = claro_text_zone::get_content('textzone_edit_profile_form');
        if (get_conf('is_trackingEnabled')) {
            // Display user tracking link
            $cmdList[] = array('img' => 'statistics', 'name' => get_lang('View my statistics'), 'url' => claro_htmlspecialchars(Url::Contextualize(get_conf('urlAppend') . '/claroline/tracking/userReport.php?userId=' . claro_get_current_user_id())));
        }
示例#2
0
     $cmd = $_REQUEST['cmd'];
 } else {
     $cmd = '';
 }
 /**
  * Main Section
  */
 if ('registration' == $cmd) {
     // get params from the form
     $userData = user_initialise();
     // validate forum params
     $messageList = user_validate_form_registration($userData);
     if (count($messageList) == 0) {
         // Register the new user in the claroline platform
         $userId = user_create($userData);
         set_user_property($userId, 'skype', $userData['skype']);
         if (claro_is_user_authenticated()) {
             // add value in session
             $_user = user_get_properties(claro_get_current_user_id());
             $_user['firstName'] = $_user['firstname'];
             $_user['lastName'] = $_user['lastname'];
             $_user['mail'] = $_user['email'];
             $_user['lastLogin'] = claro_time() - 24 * 60 * 60;
             // DATE_SUB(CURDATE(), INTERVAL 1 DAY)
             $is_allowedCreateCourse = $userData['isCourseCreator'] == 1 ? TRUE : FALSE;
             $_SESSION['_uid'] = claro_get_current_user_id();
             $_SESSION['_user'] = $_user;
             $_SESSION['is_allowedCreateCourse'] = $is_allowedCreateCourse;
             // track user login
             $claroline->notifier->event('user_login', array('data' => array('ip' => $_SERVER['REMOTE_ADDR'])));
             // last user login date is now