/** * Generate html code of the wiki page preview * @param Wiki2xhtmlRenderer wikiRenderer rendering engine * @param string title page title * @param string content page content * @return string html code of the preview pannel */ function claro_disp_wiki_preview(&$wikiRenderer, $title, $content = '') { $out = "<div id=\"preview\" class=\"wikiTitle\">\n"; if ($title === '__MainPage__') { $title = get_lang("Main page"); } $title = "<h1 class=\"wikiTitle\">" . get_lang('Preview :') . "{$title}</h1>\n"; $out .= $title; $out .= '</div>' . "\n"; $dialogBox = new DialogBox(); $dialogBox->warning('<small>' . get_lang("WARNING: this page is a preview. Your modifications to the wiki has not been saved yet ! To save them do not forget to click on the 'save' button at the bottom of the page.") . '</small>'); $out .= $dialogBox->render() . "\n"; $out .= '<div class="wiki2xhtml">' . "\n"; if ($content != '') { $out .= $wikiRenderer->render($content); } else { $out .= get_lang("This page is empty, click on 'Edit this page' to add a content"); } $out .= "</div>\n"; return $out; }
$addToURL = isset($_REQUEST['addToURL']) ? $_REQUEST['addToURL'] : ''; $dialogBox = new DialogBox(); //TABLES //declare needed tables // Deal with interbreadcrumbs ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb')); $nameTools = get_lang('User list'); $offset = isset($_REQUEST['offset']) ? $_REQUEST['offset'] : 0; //------------------------------------ // Execute COMMAND section //------------------------------------ switch ($cmd) { case 'rqResetAllPasswords': $dialogBox->question(get_lang('Do you really want to reset all the passwords ?') . '<br />' . '<small>' . get_lang('The platform administrators and course creators password will remain unchanged') . '</small>' . '<br />'); $dialogBox->form(' <form method="post" action="' . claro_htmlspecialchars($_SERVER['PHP_SELF']) . '">' . '<input type="hidden" name="cmd" value="exResetAllPasswords" />' . '<input id="sendEmail" type="checkbox" name="sendEmail" value="yes" checked="checked" />' . '<label for="sendEmail">' . get_lang('send new password by email') . '</label>' . '<br />' . '<small>' . get_lang('Only the users with a valid address will receive their password by email') . '</small>' . '<br />' . '<input type="submit" value="' . get_lang('Yes') . '" />' . claro_html_button($_SERVER['PHP_SELF'], get_lang('Cancel')) . '</form>'); $dialogBox->warning('<em>' . get_lang('This may take some time, please wait until the end of the process...') . '</em>'); break; case 'exResetAllPasswords': $userList = getAllStudentUserId(); $failedMailList = array(); $failedList = array(); $sendEmail = isset($_REQUEST['sendEmail']) && $_REQUEST['sendEmail'] ? true : false; foreach ($userList as $user) { $mailSent = FALSE; $userInfo = user_get_properties($user['id']); if (!$userInfo['isPlatformAdmin'] && !$userInfo['isCourseCreator']) { $userInfo['password'] = mk_password(8); if (user_set_properties($user['id'], array('password' => $userInfo['password']))) { if ($sendEmail && user_send_registration_mail($user['id'], $userInfo)) { $mailSent = TRUE; }
$validUserData = false; } if (in_array(get_lang('This official code is already used by another user.'), $errorMsgList)) { $userList = user_search(array('officialCode' => $userData['officialCode']), claro_get_current_course_id(), false, true, false); $dialogBox->error(get_lang('This official code is already used by another user.') . '<br />' . get_lang('Take one of these options') . ' : ' . '<ul>' . '<li>' . '<a href="#resultTable">' . get_lang('Click on the enrollment command beside the concerned user') . '</a>' . '</li>' . '<li>' . '<a href="' . $_SERVER['PHP_SELF'] . '?cmd=cancel' . claro_url_relay_context('&') . '">' . get_lang('Cancel the operation') . '</a>' . '</li>' . '</ul>'); $displayResultTable = true; } elseif (!$userData['confirmUserCreate'] && !(empty($userData['lastname']) && empty($userData['email']))) { $userList = user_search(array('lastname' => $userData['lastname'], 'email' => $userData['email']), claro_get_current_course_id(), false, true, false); if (count($userList) > 0) { // PREPARE THE URL command TO CONFIRM THE USER CREATION $confirmUserCreateUrl = array(); foreach ($userData as $thisDataKey => $thisDataValue) { $confirmUserCreateUrl[] = $thisDataKey . '=' . urlencode($thisDataValue); } $confirmUserCreateUrl = Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=registration&' . implode('&', $confirmUserCreateUrl) . '&confirmUserCreate=1'); $dialogBox->warning(get_lang('Notice') . '. ' . get_lang('Users with similar settings exist on the system yet') . '<br />' . get_lang('Take one of these options') . ' : ' . '<ul>' . '<li>' . '<a href="#resultTable" onclick="highlight(\'resultTable\');">' . get_lang('Click on the enrollment command beside the concerned user') . '</a>' . '</li>' . '<li>' . '<a href="' . claro_htmlspecialchars($confirmUserCreateUrl) . '">' . get_lang('Confirm the creation of a new user') . '</a>' . '<br /><small>' . $userData['lastname'] . ' ' . $userData['firstname'] . $userData['officialCode'] . ' ' . $userData['email'] . '</small>' . '</li>' . '<li>' . '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=cancel')) . '">' . get_lang('Cancel the operation') . '</a>' . '</li>' . '</ul>'); $displayForm = false; $displayResultTable = true; } } else { $userList = array(); } if (!empty($errorMsgList) && count($userList) == 0) { foreach ($errorMsgList as $errorMsg) { $dialogBox->error($errorMsg); } } } if (!$userId && $validUserData && count($userList) == 0) { $userData['language'] = null; $userId = user_create($userData);
$subject .= $title; } else { $subject .= get_lang('Message from your lecturer'); } $msgContent = $content; // Enclosed resource $body = $msgContent . "\n" . "\n" . ResourceLinker::renderLinkList($currentLocator, true); require_once dirname(__FILE__) . '/../messaging/lib/message/messagetosend.lib.php'; require_once dirname(__FILE__) . '/../messaging/lib/recipient/courserecipient.lib.php'; $courseRecipient = new CourseRecipient(claro_get_current_course_id()); $message = new MessageToSend(claro_get_current_user_id(), $subject, $body); $message->setCourse(claro_get_current_course_id()); $message->setTools('CLANN'); $messageId = $courseRecipient->sendMessage($message); if ($failure = claro_failure::get_last_failure()) { $dialogBox->warning($failure); } } // end if $emailOption==1 } // end if $submit Announcement if ($autoExportRefresh) { /** * in future, the 2 following calls would be pas by event manager. */ // rss update /*if ( get_conf('enableRssInCourse',1)) { require_once get_path('incRepositorySys') . '/lib/rss.write.lib.php'; build_rss( array('course' => claro_get_current_course_id())); }*/
$form->assign('nextCommand', 'exMkForum'); $form->assign('catId', 0); $form->assign('categoryList', $categoryList); $form->assign('anonymity_enabled', get_conf('clfrm_anonymity_enabled', true) ? true : false); $form->assign('anonymity', 'forbidden'); $form->assign('is_postAllowed', true); $dialogBox->form($form->render()); } catch (Exception $ex) { if (claro_debug_mode()) { $dialogBox->error('<pre>' . $ex->__toString() . '</pre>'); } else { $dialogBox->error($ex->getMessage()); } } } else { $dialogBox->warning(get_lang('There are currently no forum categories!') . '<br/>' . get_lang('Please create a category first')); $cmd = 'show'; } } if ('exEdForum' == $cmd) { if (update_forum_settings($forumId, $forumName, $forumDesc, $forumPostAllowed, $catId, $anonymityType)) { $dialogBox->success(get_lang('Forum updated')); } else { $dialogBox->error(get_lang('Unable to update forum')); $cmd = 'rqEdForum'; } } if ('rqEdForum' == $cmd) { $forumSettingList = get_forum_settings($forumId); $categoryList = get_category_list(); if (count($categoryList) > 0) {
} $csvTab[] = $csvSubTab; } $csvExporter = new CsvExporter(';', '"'); $fileName = get_lang('files_stats') . '_' . claro_date('d-m-Y') . '.csv'; $stream = $csvExporter->export($csvTab); claro_send_stream($stream, $fileName, 'text/csv'); } } else { $dialogBox->warning(get_lang('Statistics in progress, please don\'t refresh until further instructions ! ') . '<br />' . get_lang('Course actually treated : ') . $course['title'] . '<br />' . get_lang(' Number of course treated : ') . count($stats)); $claroline->display->body->appendContent($dialogBox->render()); echo $claroline->display->render(); } } else { $dialogBox = new DialogBox(); $dialogBox->warning(get_lang('Caution: building files\' statistics is a pretty heavy work. It might take a while and a lot of resources, depending of the size of your campus.')); if (!empty($extensions)) { $dialogBox->info(get_lang('You\'ve chosen to isolate the following extensions: %types. If you wish to modify these extensions, check the advanced platform settings', array('%types' => implode(', ', $extensions)))); } else { $dialogBox->info(get_lang('You don\'t have chosen any extension to isolate. If you wish to isolate extensions in your statistics, check the advanced platform settings')); } $template = new CoreTemplate('admin_files_stats.tpl.php'); $template->assign('dialogBox', $dialogBox); $template->assign('extensions', $extensions); $template->assign('formAction', $_SERVER['PHP_SELF']); $template->assign('cancelUrl', get_path('rootAdminWeb')); $claroline->display->body->appendContent($template->render()); echo $claroline->display->render(); } /** * Convert a size (Bytes) to KiB/MiB/GiB/TiB
$blockLoginInfo .= get_block('blockLoginInfo', array('%firstname' => $userAccount['firstname'], '%lastname' => $userAccount['lastname'], '%username' => $userAccount['username'], '%password' => $userAccount['password'])); } $emailBody = get_block('blockLoginRequest', array('%siteName' => get_conf('siteName'), '%rootWeb' => get_path('rootWeb'), '%loginInfo' => $blockLoginInfo)); // send message if (claro_mail_user($userList[0]['uid'], $emailBody, $emailSubject)) { $dialogBox->success(get_lang('Your password has been emailed to') . ' : ' . $emailTo); } else { $dialogBox->error(get_lang('The system is unable to send you an e-mail.') . '<br />' . get_lang('Please contact') . ' : ' . '<a href="mailto:' . get_conf('administrator_email') . '?BODY=' . $emailTo . '">' . get_lang('Platform administrator') . '</a>'); } } } else { $dialogBox->error(get_lang('There is no user account with this email address.')); } if ($extAuthPasswordCount > 0) { if ($extAuthPasswordCount == count($userList)) { $dialogBox->warning(get_lang('Your password(s) is (are) recorded in an external authentication system outside the platform.')); } else { $dialogBox->warning(get_lang('Passwords of some of your user account(s) are recorded an in external authentication system outside the platform.')); } $dialogBox->info(get_lang('For more information take contact with the platform administrator.')); } } //////////////////////////////////////////////////// // display section $out = ''; // display title $out .= claro_html_tool_title($nameTools); // display message box if (!$passwordFound) { $dialogBox->title(get_lang('Enter your email so we can send you your password.')); $dialogBox->form('<form action="' . $_SERVER['PHP_SELF'] . '" method="post">' . '<input type="hidden" name="searchPassword" value="1" />' . '<label for="Femail">' . get_lang('Email') . ' : </label>' . '<br />' . '<input type="text" name="Femail" id="Femail" size="50" maxlength="100" value="' . claro_htmlspecialchars($emailTo) . '" />' . '<br /><br />' . '<input type="submit" name="retrieve" value="' . get_lang('Ok') . '" /> ' . claro_html_button(get_conf('urlAppend') . '/index.php', get_lang('Cancel')) . '</form>');
$defaultLoginValue = ''; $dialogBox = new DialogBox(); if (isset($_SESSION['lastUserName'])) { $defaultLoginValue = strip_tags($_SESSION['lastUserName']); unset($_SESSION['lastUserName']); } if (get_conf('claro_displayLocalAuthForm', true) == true) { if ($claro_loginRequested && !$claro_loginSucceeded) { if (AuthManager::getFailureMessage()) { // need to use get_lang two times... $dialogBox->error(get_lang(AuthManager::getFailureMessage())); } else { $dialogBox->error(get_lang('Login failed.') . ' ' . get_lang('Please try again.')); } if (get_conf('allowSelfReg', false)) { $dialogBox->warning(get_lang('If you haven\'t a user account yet, use the <a href="%url">the account creation form</a>.', array('%url' => get_path('url') . '/claroline/auth/inscription.php'))); } else { $dialogBox->error(get_lang('Contact your administrator.')); } $dialogBox->warning(get_lang('Warning the system distinguishes uppercase (capital) and lowercase (small) letters')); } if (get_conf('claro_secureLogin', false)) { $formAction = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; } else { $formAction = $_SERVER['PHP_SELF']; } } // end if claro_dispLocalAuthForm $template = new CoreTemplate('auth_form.tpl.php'); $template->assign('dialogBox', $dialogBox); $template->assign('formAction', $formAction);
case Claro_CourseUserRegistration::STATUS_KEYVALIDATION_FAILED: $displayMode = DISPLAY_REGISTRATION_KEY_FORM; $dialogBox->error($courseRegistration->getErrorMessage()); break; case Claro_CourseUserRegistration::STATUS_SYSTEM_ERROR: $displayMode = DISPLAY_MESSAGE_SCREEN; $dialogBox->error($courseRegistration->getErrorMessage()); break; case Claro_CourseUserRegistration::STATUS_REGISTRATION_NOTAVAILABLE: $displayMode = DISPLAY_REGISTRATION_DISABLED_FORM; $dialogBox->error($courseRegistration->getErrorMessage()); $dialogBox->info(get_lang('Please contact the course manager : %email', array('%email' => '<a href="mailto:' . $courseObj->email . '?body=' . $courseObj->officialCode . '&subject=[' . rawurlencode(get_conf('siteName')) . ']' . '">' . claro_htmlspecialchars($courseObj->titular) . '</a>'))); break; default: $displayMode = DISPLAY_MESSAGE_SCREEN; $dialogBox->warning($courseRegistration->getErrorMessage()); break; } } } // end if ($cmd == 'exReg') /*---------------------------------------------------------------------------- User course list to unregister ----------------------------------------------------------------------------*/ if ($cmd == 'rqUnreg') { $courseListView = CourseTreeNodeViewFactory::getUserCourseTreeView($userId); $unenrollUrl = Url::buildUrl($_SERVER['PHP_SELF'] . '?cmd=exUnreg', $urlParamList, null); $viewOptions = new CourseTreeViewOptions(false, true, null, $unenrollUrl->toUrl()); $courseListView->setViewOptions($viewOptions); $displayMode = DISPLAY_USER_COURSES; }
if ($is_allowedToEditThisWrk) { // the work can be edited $out .= '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?authId=' . $_REQUEST['authId'] . '&assigId=' . $assignmentId . '&cmd=rqEditWrk&wrkId=' . $work['id'])) . '">' . '<img src="' . get_icon_url('edit') . '" alt="' . get_lang('Modify') . '" />' . '</a>' . "\n"; } if ($is_allowedToEditAll) { $out .= '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?authId=' . $_REQUEST['authId'] . '&cmd=exRmWrk' . '&assigId=' . $assignmentId . '&wrkId=' . $work['id'])) . '" ' . 'onclick="return WORK.confirmationDel(\'' . clean_str_for_javascript($work['title']) . '\');">' . '<img src="' . get_icon_url('delete') . '" alt="' . get_lang('Delete') . '" />' . '</a>' . "\n"; if ($work['visibility'] == "INVISIBLE") { $out .= '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?authId=' . $_REQUEST['authId'] . '&cmd=exChVis&assigId=' . $assignmentId . '&wrkId=' . $work['id'] . '&vis=v')) . '">' . '<img src="' . get_icon_url('invisible') . '" alt="' . get_lang('Make visible') . '" />' . '</a>' . "\n"; } else { $out .= '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?authId=' . $_REQUEST['authId'] . '&cmd=exChVis' . '&assigId=' . $assignmentId . '&wrkId=' . $work['id'] . '&vis=i')) . '">' . '<img src="' . get_icon_url('visible') . '" alt="' . get_lang('Make invisible') . '" />' . '</a>' . "\n"; } if (!$is_feedback) { // if there is no correction yet show the link to add a correction if user is course admin $out .= ' ' . '<a href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?authId=' . $_REQUEST['authId'] . '&assigId=' . $assignmentId . '&cmd=rqGradeWrk&gradedWrkId=' . $work['id'])) . '">' . get_lang('Add feedback') . '</a>' . "\n"; } } $i++; // end of cmdList div $out .= '</div>' . "\n"; // end of content div $out .= '</div>' . "\n"; // end of work div $out .= '</div>' . "\n"; } } else { $dialogBox->warning(get_lang('No visible submission')); $out .= $dialogBox->render(); } } $claroline->display->body->appendContent($out); echo $claroline->display->render();
} } // Validate a user (if this option is enable for the course) if ($cmd == 'validation' && $req['user_id']) { $courseUserPrivileges = new CourseUserPrivileges(claro_get_current_course_id(), $req['user_id']); $courseUserPrivileges->load(); $courseObject = new Claro_Course(claro_get_current_course_id()); $courseObject->load(); $validation = new UserCourseEnrolmentValidation($courseObject, $courseUserPrivileges); $validationChange = isset($_REQUEST['validation']) ? $_REQUEST['validation'] : null; if ($validation->isModifiable()) { if ('grant' == $validationChange && $validation->isPending()) { if ($validation->grant()) { $dialogBox->success(get_lang('This user account is now active in the course')); } else { $dialogBox->warning(get_lang('No change')); } } elseif ('revoke' == $validationChange && !$validation->isPending()) { if ($validation->revoke()) { $dialogBox->success(get_lang('This user account is not active anymore in this course')); } else { $dialogBox->warning(get_lang('No change')); } } else { $dialogBox->warning(get_lang('No change')); } } else { $dialogBox->error(get_lang('The user activation cannot be changed')); if ($courseUserPrivileges->isCourseManager()) { $dialogBox->error(get_lang('You have to remove the course manager status first')); }
* @package internal_messaging */ $cidReset = true; require_once dirname(__FILE__) . '/../../claroline/inc/claro_init_global.inc.php'; // manager of the admin message box require_once dirname(__FILE__) . '/lib/messagebox/adminmessagebox.lib.php'; require_once dirname(__FILE__) . '/lib/tools.lib.php'; // move to kernel $claroline = Claroline::getInstance(); // ------------- permission --------------------------- if (!claro_is_user_authenticated()) { claro_disp_auth_form(false); } if (!claro_is_platform_admin()) { claro_die(get_lang('Not allowed')); } // -------------- business logic ---------------------- $content = ""; // ---- display $warningMessage = get_lang('Warning: When you delete a message keep in mind that it will be deleted for every user. <br /><br />You cannot retrieve deleted messages!'); $dialogbox = new DialogBox(); $dialogbox->warning($warningMessage); $content .= $dialogbox->render(); $content .= '' . '<h4>' . get_lang('Search') . '</h4>' . "\n" . '<ul>' . "\n" . ' <li><a href="admin_search.php?search=fromUser">' . get_lang('All messages from a user') . '</a></li>' . "\n" . ' <li><a href="admin_search.php?search=olderThan">' . get_lang('All messages older than') . '</a></li>' . "\n" . ' <li><a href="admin_search.php?search=timeInterval">' . get_lang('All messages in date interval') . '</a></li>' . "\n" . ' <li><a href="admin_search.php?search=platformMessage">' . get_lang('All platform messages') . '</a></li>' . "\n" . '</ul>' . "\n"; $content .= '<h4>' . get_lang('Delete') . '</h4>' . "\n" . '<ul>' . "\n" . '<li><a href="admin_delete.php?cmd=rqDeleteAll">' . get_lang('All messages') . '</a></li>' . "\n" . '<li><a href="admin_delete.php?cmd=rqFromUser">' . get_lang('All messages from a user') . '</a></li>' . "\n" . '<li><a href="admin_delete.php?cmd=rqOlderThan">' . get_lang('All messages older than') . '</a></li>' . "\n" . '<li><a href="admin_delete.php?cmd=rqPlatformMessage">' . get_lang('All platform messages') . '</a></li>' . "\n" . '</ul>' . "\n"; $claroline->display->banner->breadcrumbs->append(get_lang('Administration'), get_path('rootAdminWeb')); $claroline->display->banner->breadcrumbs->append(get_lang('Internal messaging'), 'admin.php'); $claroline->display->body->appendContent(claro_html_tool_title(get_lang('Administration'))); $claroline->display->body->appendContent($content); echo $claroline->display->render();
"> </a> <?php echo $this->courseToolList->render(); ?> </div> </div> <div id="courseRightContent"> <?php } ?> <?php if (claro_is_current_user_enrolment_pending()) { $dialogBox = new DialogBox(); $dialogBox->warning(get_lang('Your enrolment to this course has not been validated yet') . '<br />' . get_lang('You won\'t be able to access all this course\'s content and/or features until the course manager grants you the access.')); echo $dialogBox->render(); } ?> <!-- Page content --> <?php echo $this->content; ?> <!-- End of Page Content --> <?php if (claro_is_in_a_course() && $this->courseTitleAndTools) { ?> </div> <!-- rightContent -->
$editedCat_CanHaveCatChild = $editedCat_data['canHaveCatChild']; $editedCat_CanHaveCoursesChild = $editedCat_data['canHaveCoursesChild']; unset($editedCat_data); } } elseif ($cmd == 'exChange') { $noQUERY_STRING = true; // Search information if ($facultyEdit = get_cat_data($_REQUEST['id'])) { $doChange = true; // See if we try to set the categorie as a cat that can not have course // and that the cat already contain courses if (isset($_REQUEST['canHaveCoursesChild']) && $_REQUEST['canHaveCoursesChild'] == 0) { $sql_SearchCourses = " SELECT count(cours_id) num" . " FROM `" . $tbl_course . "`" . " WHERE faculte='" . claro_sql_escape($facultyEdit['code']) . "'"; $res_SearchCourses = claro_sql_query_get_single_value($sql_SearchCourses); if ($res_SearchCourses > 0) { $dialogBox->warning(get_lang('This category include some courses, you must delete or move them before')); $doChange = false; } } } else { $dialogBox->error(get_lang('There is no category available !')); $doChange = false; } // Edit a category (don't move the category) $_REQUEST['nameCat'] = trim($_REQUEST['nameCat']); $_REQUEST['codeCat'] = trim($_REQUEST['codeCat']); if (!empty($_REQUEST['nameCat']) && !empty($_REQUEST['codeCat'])) { if (!isset($_REQUEST['fatherCat']) && $doChange) { $canHaveCoursesChild = $_REQUEST['canHaveCoursesChild'] == 1 ? 'TRUE' : 'FALSE'; // If nothing is different if ($facultyEdit['name'] != $_REQUEST['nameCat'] && $facultyEdit['code'] != $_REQUEST['codeCat'] && $facultyEdit['canHaveCoursesChild'] != $canHaveCoursesChild) {
if (get_conf('can_install_local_module', false)) { $inputPackage[] = 'local'; } if (get_conf('can_install_upload_module', true)) { $inputPackage[] = 'upload'; } if (get_conf('can_install_curl_module', false)) { $inputPackage[] = 'curl'; } if (in_array($_cleanInput['selectInput'], $inputPackage)) { $selectInput = $_cleanInput['selectInput']; } else { switch (count($inputPackage)) { case 0: // You can't add packages $dialogBox->warning(get_lang("You cannot add module. Change this in configuration.") . '<br />' . claro_html_button('../tool/config_edit.php?config_code=CLMAIN§ion=ADVANCED', get_lang('Go to config'))); break; case 1: //Direct display $_cleanInput['selectInput'] = $selectInput = $inputPackage[0]; break; default: // SELECT ONE $dialogBox->form('<form action="' . $_SERVER['PHP_SELF'] . '" method="GET">' . "\n" . '<input type="hidden" name="claroFormId" value="' . uniqid('') . '" />' . '<input name="cmd" type="hidden" value="rqInstall" />' . "\n" . get_lang('Where is your package ?') . '<br />' . "\n" . (get_conf('can_install_upload_module', true) ? '<input name="selectInput" value="upload" id="zipOnYouComputerServer" type="radio" checked="checked" />' . '<label for="zipOnYouComputerServer" >' . get_lang('Package on your computer (zip only)') . '</label>' . '<br />' : '') . (get_conf('can_install_local_module', false) ? '<input name="selectInput" value="local" id="packageOnServer" type="radio" />' . '<label for="packageOnServer" >' . get_lang('Package on server (zipped or not)') . '</label>' . '<br />' : '') . (get_conf('can_install_curl_module', false) ? '<input name="selectInput" value="curl" id="zipOnThirdServer" type="radio" />' . '<label for="zipOnThirdServer" >' . get_lang('Package on the net (zip only)') . '</label>' . '<br />' : '') . '<br />' . "\n" . '<br />' . "\n" . '<input value="' . get_lang('Next') . '" type="submit" /> ' . "\n" . claro_html_button($_SERVER['PHP_SELF'], get_lang('Cancel')) . '</form>' . "\n"); } } switch ($_cleanInput['selectInput']) { case 'upload': $dialogBox->warning('<p>' . "\n" . get_lang('Imported modules must consist of a zip file and be compatible with your Claroline version.') . '<br />' . "\n" . get_lang('Find more available modules on <a href="http://www.claroline.net/">Claroline.net</a>.') . '</p>' . "\n\n"); $dialogBox->form('<form enctype="multipart/form-data" action="' . $_SERVER['PHP_SELF'] . '" method="post">' . "\n" . '<input type="hidden" name="claroFormId" value="' . uniqid('') . '" />' . "\n" . '<input name="cmd" type="hidden" value="exInstall" />' . "\n" . '<input name="uploadedModule" type="file" /><br />' . "\n" . '<input name="activateOnInstall" id="activateOnInstall" type="checkbox" />' . "\n" . '<label for="activateOnInstall" >' . get_lang('Activate module on install') . '</label>' . '<br />' . "\n" . '<fieldset>' . '<legend>' . get_lang('The following options will only work for course tool modules :') . '</legend>' . '<input name="notAutoActivateInCourses" id="autoActivateInCourses" type="checkbox" />' . "\n" . '<label for="notAutoActivateInCourses" >' . get_lang('This tool must be activated manualy in each course') . '</label>' . '<br />' . "\n" . '<input name="activableOnlyByPlatformAdmin" id="activableOnlyByPlatformAdmin" type="checkbox" />' . "\n" . '<label for="activableOnlyByPlatformAdmin" >' . get_lang('Make this tool activable only by the platform administrator <small>(available if the previous option is checked)</small>') . '</label>' . '<br />' . "\n" . '<input name="visibleOnInstall" id="visibleOnInstall" type="checkbox" />' . "\n" . '<label for="visibleOnInstall" >' . get_lang('Visible in all courses on install <small>(this can take some time depending on the number of courses in your campus)</small>') . '</label>' . '</fieldset>' . '<br />' . "\n" . '<br />' . "\n" . '<input value="' . get_lang('Upload and Install module') . '" type="submit" /> ' . "\n" . claro_html_button($_SERVER['PHP_SELF'], get_lang('Cancel')) . '</form>' . "\n"); break;
$manager = new $ctr(claro_get_current_course_id()); $manager->deleteAll(); } $dialogBox->success(get_lang('Course statistics are now empty')); Console::log("In course " . claro_get_current_course_id() . " : all tracking events deleted by user " . claro_get_current_user_id(), 'COURSE_RESET_ALL_TRACKING'); $display = DISP_FLUSH_RESULT; } /* * Prepare output */ $nameTools = get_lang('Delete all course statistics'); /* * Output */ $html = ''; $html .= claro_html_tool_title($nameTools); if (DISP_FLUSH_RESULT == $display) { // display confirm msg and back link $dialogBox->info('<small>' . '<a href="courseReport.php">' . '<< ' . get_lang('Back') . '</a>' . '</small>' . "\n"); } elseif (DISP_FORM == $display) { $dialogBox->warning(get_lang('Delete is definitive. There is no way to get your data back after delete.')); $dialogBox->form('<form action="' . $_SERVER['PHP_SELF'] . '">' . "\n" . claro_form_relay_context() . '<input type="hidden" name="cmd" value="exDelete" />' . "\n" . '<input type="radio" name="scope" id="scope_all" value="ALL" />' . "\n" . '<label for="scope_all">' . get_lang('All') . '</label>' . "\n" . '<br />' . "\n" . '<input type="radio" name="scope" id="scope_before" value="BEFORE" checked="checked" />' . "\n" . '<label for="scope_before" >' . get_lang('Before') . '</label> ' . "\n" . claro_html_date_form('beforeDate[day]', 'beforeDate[month]', 'beforeDate[year]', time(), 'short') . '<br /><br />' . "\n" . '<input type="submit" name="action" value="' . get_lang('Ok') . '" /> ' . claro_html_button('courseReport.php', get_lang('Cancel')) . '</form>' . "\n"); } // end else if $delete $html .= $dialogBox->render(); /* * Output rendering */ ClaroBreadCrumbs::getInstance()->prepend(get_lang('Statistics'), 'courseReport.php'); $claroline->display->body->setContent($html); echo $claroline->display->render();
} } // Set navigation url if ($adminContext && claro_is_platform_admin()) { ClaroBreadCrumbs::getInstance()->prepend(get_lang('Create course'), get_path('clarolineRepositoryWeb') . 'course/create.php?adminContext=1'); ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb')); $backUrl = get_path('rootAdminWeb'); } else { if ($course->courseId) { $backUrl = get_path('url') . '/claroline/course/index.php?cid=' . $course->courseId; } else { $backUrl = get_path('url') . '/index.php'; } } if (!get_conf('courseCreationAllowed', true)) { $dialogBox->warning(get_lang('Course creation is disabled on the platform')); } //================================= // Display section //================================= $out = ''; $out .= claro_html_tool_title(get_lang('Create a course website')); $out .= $dialogBox->render(); if (claro_is_platform_admin() || get_conf('courseCreationAllowed', true)) { if ($display == DISP_COURSE_CREATION_FORM || $display == DISP_COURSE_CREATION_FAILED) { // display form $out .= $course->displayForm($backUrl); } elseif ($display == DISP_COURSE_CREATION_PROGRESS) { // do nothing except displaying dialogBox content } elseif ($display == DISP_COURSE_CREATION_SUCCEED) { // display back link
} } if ($displayRemoveOlderThanValidated) { $date = claro_htmlspecialchars($_REQUEST['date']); $dialogBox = new DialogBox(); $dialogBoxMsg = get_lang('All messages older than %date% have been deleted', array('%date%' => $date)) . '<br /><br />' . '<a href="admin.php">' . get_lang('Back') . '</a>'; $dialogBox->success($dialogBoxMsg); $content .= '<br />' . $dialogBox->render(); } // --------------- end older than // ------------ platform message if ($displayRemovePlatformMessageConfirmation) { $dialogBox = new DialogBox(); $dialogBox->setBoxType('question'); $dialogBox->question(get_lang('Are you sure to delete all platform messages?')); $dialogBox->warning(get_lang('There is no way to restore deleted messages.')); $dialogBox->info('<br /><br /><a href="' . $_SERVER['PHP_SELF'] . '?cmd=exPlatformMessage">' . get_lang('Yes') . '</a> | <a href="admin.php">' . get_lang('No') . '</a>'); $content .= '<br />' . $dialogBox->render(); } if ($displayRemovePlatformMessageValidated) { $dialogBoxMsg = get_lang('All platform messages have been deleted') . '<br /><br />' . '<a href="admin.php">' . get_lang('Back') . '</a>'; $dialogBox = new DialogBox(); $dialogBox->info($dialogBoxMsg); $content .= '<br />' . $dialogBox->render(); } // ------------- end platform message // ------------------- render ---------------------------- $claroline->display->banner->breadcrumbs->append(get_lang('Administration'), get_path('rootAdminWeb')); $claroline->display->banner->breadcrumbs->append(get_lang('Internal messaging'), 'admin.php'); $claroline->display->banner->breadcrumbs->append(get_lang('Delete'), 'admin_delete.php?cmd=' . addslashes($_REQUEST['cmd'])); $title['mainTitle'] = get_lang('Internal messaging') . ' - ' . get_lang('Delete');
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')); } FromKernel::uses('utils/input.lib', 'utils/validator.lib', 'display/dialogBox.lib', 'admin/mergeuser.lib', 'user.lib'); try { $dialogBox = new DialogBox(); $userInput = Claro_UserInput::getInstance(); $userInput->setValidator('cmd', new Claro_Validator_AllowedList(array('rqMerge', 'chkMerge', 'exMerge'))); $cmd = $userInput->get('cmd', 'rqMerge'); if ($cmd == 'rqMerge') { $dialogBox->warning(get_lang('Merging user accounts is not a reversible operation so be careful !')); $form = '<form action="' . $_SERVER['PHP_SELF'] . '?cmd=chkMerge" method="post">' . "\n" . '<input type="hidden" name="claroFormId" value="' . uniqid('') . '" />' . "\n" . '<fieldset>' . '<legend>' . get_lang('Accounts to merge') . '</legend>' . '<label for="uidToRemove">' . get_lang('Id of the user to remove') . ' : </label><input type="text" name="uidToRemove" id="uidToRemove" value="" /><br />' . "\n" . '<label for="uidToKeep">' . get_lang('Id of the user to keep') . ' : </label><input type="text" name="uidToKeep" id="uidToKeep" value="" /><br />' . "\n" . '</fieldset>' . '<br />' . '<input type="submit" name="merge" value="' . get_lang('Merge') . '" />' . "\n" . '</form>'; $dialogBox->form($form); } if ($cmd == 'chkMerge') { $uidToKeep = $userInput->getMandatory('uidToKeep'); $uidToRemove = $userInput->getMandatory('uidToRemove'); if ($uidToKeep == $uidToRemove) { throw new Exception(get_lang('Cannot merge one user account with itself')); } if (!user_get_properties($uidToKeep)) { throw new Exception(get_lang('User to keep not found')); } if (!user_get_properties($uidToRemove)) { throw new Exception(get_lang('User to remove not found')); }
$dialogBox->error($config->backlog->output()); } } // display form $form .= $config->display_form($newPropertyList, $section); } else { // display form $form .= $config->display_form(null, $section); } } else { // error loading the configuration $error = true; $dialogBox->error($config->backlog->output()); } if ($config->is_modified()) { $dialogBox->warning(get_lang('Note. This configuration file has been manually changed. The system will try to retrieve all the configuration values, but it can not guarantee to retrieve additional settings manually inserted')); } } if (!isset($config_name)) { $nameTools = get_lang('Configuration'); ClaroBreadCrumbs::getInstance()->setCurrent($nameTools, $_SERVER['PHP_SELF']); } else { // tool name and url to edit config file $nameTools = get_lang($config->get_conf_name()); ClaroBreadCrumbs::getInstance()->setCurrent($nameTools, $_SERVER['PHP_SELF'] . '?config_code=' . $config_code); } /*************************************************************************** */ /* Display /*************************************************************************** */ // define bredcrumb ClaroBreadCrumbs::getInstance()->prepend(get_lang('Configuration'), get_path('rootAdminWeb') . 'tool/config_list.php');
// Communication's administration menu $menu['Communication'][] = '<a href="../messaging/admin.php">' . get_lang('Internal messaging') . '</a>'; $adminModuleList = get_admin_module_list(true); if (count($adminModuleList) > 0) { foreach ($adminModuleList as $module) { language::load_module_translation($module['label']); $menu['ExtraTools'][] = '<a href="' . get_module_entry_url($module['label']) . '">' . get_lang($module['name']) . '</a>'; } } // Deal with interbreadcrumbs and title variable $nameTools = get_lang('Administration'); // No sense because not allowed with claro_is_platform_admin(), // but claro_is_platform_admin() should be later replaced by // get_user_property ('can view admin menu') $is_allowedToAdmin = claro_is_platform_admin(); // Is our installation system accessible ? if (file_exists('../install/index.php') && !file_exists('../install/.htaccess')) { // If yes, warn the administrator $dialogBox->warning(get_block('blockWarningRemoveInstallDirectory')); } $register_globals_value = ini_get('register_globals'); // Is the php 'register_globals' param enable ? if (!empty($register_globals_value) && strtolower($register_globals_value) != 'off') { // If yes, warn the administrator $dialogBox->warning(get_lang('<b>Security :</b> We recommend to set register_globals to off in php.ini')); } $template = new CoreTemplate('admin_panel.tpl.php'); $template->assign('dialogBox', $dialogBox); $template->assign('menu', $menu); $claroline->display->body->appendContent($template->render()); echo $claroline->display->render();
} else { $eventNotifier->notifyCourseEvent('document_file_modified', claro_get_current_course_id(), claro_get_current_tool_id(), array('old_uri' => $cwd, 'new_uri' => $cwd), claro_get_current_group_id(), '0'); } } else { $eventNotifier->notifyCourseEvent('document_file_added', claro_get_current_course_id(), claro_get_current_tool_id(), $cwd . '/' . $uploadedFileName, claro_get_current_group_id(), '0'); } /*-------------------------------------------------------------------- IN CASE OF HTML FILE, LOOKS FOR IMAGE NEEDING TO BE UPLOADED TOO --------------------------------------------------------------------*/ if (preg_match('/.htm$/i', $_FILES['userFile']['name']) || preg_match('/.html$/i', $_FILES['userFile']['name'])) { $imgFilePath = search_img_from_html($baseWorkDir . $cwd . '/' . $uploadedFileName); /* * Generate Form for image upload */ if (sizeof($imgFilePath) > 0) { $dialogBox->warning(get_lang("Missing images detected")); $form = '<form method="post" action="' . claro_htmlspecialchars($_SERVER['PHP_SELF']) . '" ' . 'enctype="multipart/form-data">' . "\n" . claro_form_relay_context() . '<input type="hidden" name="claroFormId" value="' . uniqid('') . '" />' . '<input type="hidden" name="cmd" value="submitImage" />' . "\n" . '<input type="hidden" name="relatedFile" ' . ' value="' . $cwd . '/' . $uploadedFileName . '" />' . "\n" . '<table border="0">' . "\n"; foreach ($imgFilePath as $thisImgKey => $thisImgFilePath) { $form .= '<tr>' . "\n" . '<td>' . "\n" . '<label for="' . $thisImgKey . '">' . basename($thisImgFilePath) . ' : </label>' . "\n" . '</td>' . "\n" . '<td>' . '<input type="file" id="' . $thisImgKey . '" name="imgFile[]" />' . "\n" . '<input type="hidden" name="imgFilePath[]" value="' . $thisImgFilePath . '" />' . '</td>' . "\n" . '</tr>' . "\n"; } $form .= '<tr>' . "\n" . '<td> </td>' . "\n" . '<td>' . "\n" . '<input type="submit" name="submitImage" value="' . get_lang("Ok") . '" /> ' . "\n" . claro_html_button(claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=exChDir&file=' . base64_encode($cwd))), get_lang("Cancel")) . '</td>' . "\n" . '</tr>' . "\n\n" . '</table>' . "\n" . '</form>' . "\n"; $dialogBox->form($form); } // end if ($imgFileNb > 0) } // end if (strrchr($fileName) == "htm" } // end if is_uploaded_file } // end if ($cmd == 'exUpload') if ($cmd == 'rqUpload') {
/*============================================================================ COMMANDS ============================================================================*/ $dialogBox = new DialogBox(); // -- register campus if (isset($_REQUEST['register'])) { $country = isset($_REQUEST['country']) ? $_REQUEST['country'] : ''; $parameters = array('campusName' => addslashes(get_conf('siteName')), 'campusUrl' => get_path('rootWeb'), 'institutionName' => addslashes(get_conf('institution_name')), 'institutionUrl' => get_conf('institution_url'), 'country' => $country, 'adminEmail' => get_conf('administrator_email')); // make the soap call to register the campus $soapResponse = $soapclient->call('registerCampus', $parameters); if ($soapResponse == CAMPUS_ADDED) { $dialogBox->success(get_lang('Your campus has been submitted and is waiting to be validate by Claroline.net team')); } elseif ($soapResponse == LOCAL_URL_ERROR) { $dialogBox->error(get_block('blockRegisterLocalUrl')); } elseif ($soapResponse == CAMPUS_ALREADY_IN_LIST) { $dialogBox->warning(get_lang('It seems that you already have registered your campus.')); } elseif ($soapResponse == COUNTRY_CODE_ERROR) { $dialogBox->error(get_lang('Country code seems to be incorrect.')); } else { // unknown soap error $dialogBox->error(get_lang('An error occurred while contacting Claroline.net')); } } else { $parameters = array('campusUrl' => get_path('rootWeb')); $soapResponse = $soapclient->call('getCampusRegistrationStatus', $parameters); if ($soapResponse) { $dialogBoxContent = get_lang('Current registration status : ') . '<br /><br />' . "\n"; switch ($soapResponse) { case 'SUBMITTED': $dialogBoxContent .= get_lang('<strong>Submitted</strong><p>Waiting for validation by Claroline.net team.</p>'); break;
/** * TOOL LIST */ $is_allowedToEdit = claro_is_allowed_to_edit(); // Fetch the portlets $portletiterator = new CourseHomePagePortletIterator(ClaroCourse::getIdFromCode($cidReq)); // Fetch the session courses (if any) if (ClaroCourse::isSourceCourse($thisCourse->id)) { $sessionCourses = $thisCourse->getSessionCourses(); } else { $sessionCourses = array(); } // Notices for course managers if (claro_is_allowed_to_edit()) { if ($thisCourse->status == 'pending') { $dialogBox->warning(get_lang('This course is deactivated: you can reactive it from your course list')); } elseif ($thisCourse->status == 'date') { if (!empty($thisCourse->publicationDate) && $thisCourse->publicationDate > claro_mktime()) { $dialogBox->warning(get_lang('This course will be enabled on the %date', array('%date' => claro_date('d/m/Y', $thisCourse->publicationDate)))); } if (!empty($thisCourse->expirationDate) && $thisCourse->expirationDate > claro_mktime()) { $dialogBox->warning(get_lang('This course will be disable on the %date', array('%date' => claro_date('d/m/Y', $thisCourse->expirationDate)))); } } if ($thisCourse->userLimit > 0) { $dialogBox->warning(get_lang('This course is limited to %userLimit users', array('%userLimit' => $thisCourse->userLimit))); } if ($thisCourse->registration == 'validation') { $courseUserList = new Claro_CourseUserList(claro_get_current_course_id()); if ($courseUserList->has_registrationPending()) { $usersPanelUrl = claro_htmlspecialchars(Url::Contextualize($toolRepository . 'user/user.php'));
// register the new user in the claroline platform $userId = user_create($userData); if (false === $userId) { $dialogBox->error(claro_failure::get_last_failure()); } else { $dialogBox->success(get_lang('The new user has been sucessfully created')); $newUserMenu[] = claro_html_cmd_link('../auth/courses.php?cmd=rqReg&uidToEdit=' . $userId . '&category=&fromAdmin=settings', get_lang('Register this user to a course')); $newUserMenu[] = claro_html_cmd_link('admin_profile.php?uidToEdit=' . $userId . '&category=', get_lang('User settings')); $newUserMenu[] = claro_html_cmd_link('adminaddnewuser.php', get_lang('Create another new user')); $newUserMenu[] = claro_html_cmd_link('index.php', get_lang('Back to administration page')); $display = DISP_REGISTRATION_SUCCEED; // Send a mail to the user if (false !== user_send_registration_mail($userId, $userData)) { $dialogBox->success(get_lang('Mail sent to user')); } else { $dialogBox->warning(get_lang('No mail sent to user')); // TODO display in a popup "To Print" with content to give to user. } } } else { // User validate form return error messages if (is_array($messageList) && !empty($messageList)) { foreach ($messageList as $message) { $dialogBox->error($message); } } $error = true; } } /*===================================================================== Display Section
switch ($cmd) { case 'exUpdateCourseUserProperties': if (isset($_REQUEST['profileId'])) { $properties['profileId'] = $_REQUEST['profileId']; } if (isset($_REQUEST['isTutor'])) { $properties['tutor'] = (int) $_REQUEST['isTutor']; } else { $properties['tutor'] = 0; } if (isset($_REQUEST['role'])) { $properties['role'] = trim($_REQUEST['role']); } $done = user_set_course_properties($uidToEdit, $cidToEdit, $properties); if (!$done) { $dialogBox->warning(get_lang('No change applied')); } elseif (!empty($properties['profileId'])) { if (claro_get_profile_label($properties['profileId']) == 'manager') { $dialogBox->success(get_lang('User is now course manager')); } else { $dialogBox->success(get_lang('User is now student for this course')); } } break; } //------------------------------------ // FIND GLOBAL INFO SECTION //------------------------------------ if (isset($uidToEdit)) { // get course user info $courseUserProperties = course_user_get_properties($uidToEdit, $cidToEdit);
if (empty_all_class()) { $dialogBox->success(get_lang('All classes emptied')); } else { $dialogBox->error(get_lang('Error : Can not empty all classes')); } break; // Display form to create a new class // Display form to create a new class case 'rqAdd': $dialogBox->form('<form action="' . $_SERVER['PHP_SELF'] . '" method="post" >' . "\n" . '<input type="hidden" name="cmd" value="exAdd" />' . "\n" . '<input type="hidden" name="claroFormId" value="' . uniqid('') . '" />' . '<table>' . "\n" . '<tr>' . "\n" . '<td>' . get_lang('New Class name') . ' : ' . '</td>' . "\n" . '<td>' . "\n" . '<input type="text" name="class_name" />' . "\n" . '</td>' . "\n" . '</tr>' . "\n" . '<tr>' . "\n" . '<td>' . get_lang('Location') . ' :' . '</td>' . "\n" . '<td>' . "\n" . displaySelectBox() . '<input type="submit" value=" Ok " />' . "\n" . '</td>' . "\n" . '</tr>' . "\n" . '</table>' . "\n" . '</form>' . "\n "); break; // Create a new class // Create a new class case 'exAdd': if (empty($form_data['class_name'])) { $dialogBox->warning(get_lang('You cannot give a blank name to a class')); } else { if (class_create($form_data['class_name'], $form_data['class_parent_id'])) { $dialogBox->success(get_lang('The new class has been created')); } } break; // Edit class properties with posted form // Edit class properties with posted form case 'exEdit': if (empty($form_data['class_name'])) { $dialogBox->warning(get_lang('You cannot give a blank name to a class')); } else { if (class_set_properties($form_data['class_id'], $form_data['class_name'])) { $dialogBox->success(get_lang('Name of the class has been changed')); }