$view = DISP_REPAIR_RESULT; break; } /** * prepare display */ /** * Display */ $out = ''; /** * Information edit for create or edit a category */ switch ($view) { case DISP_ANALYSE: $out .= claro_html_tool_title(array('mainTitle' => 'ANALYSE RESULT', 'subTitle' => 'Tree Structure ')) . claro_html_msg_list($analyseTreeResultMsg, 1) . $dgDataAnalyseResult->render() . ($errorCounter ? claro_html_button($_SERVER['PHP_SELF'] . '?cmd=repairTree', 'Repair', 'Run repair task on the tree ? ') : '') . claro_html_tool_title('Course ownance') . $dgCourseOwnanceCheck->render(); break; case DISP_REPAIR_RESULT: $out .= claro_html_tool_title(array('mainTitle' => 'REPAIR RESULT', 'subTitle' => 'Tree Structure ')) . claro_html_msg_list($repairResultMsg, 1) . claro_html_button($_SERVER['PHP_SELF'] . '?cmd=', 'Analyse'); break; default: $out .= '<div>' . __LINE__ . ': $view = <pre>' . var_export($view, 1) . '</PRE></div>'; } $claroline->display->body->appendContent($out); echo $claroline->display->render(); /** * Return course list which have an unexisting category as parent * * @author Christophe Gesché <*****@*****.**> * @since 1.8 *
$courseDataGrid->set_colHead('officialCode'); $courseDataGrid->set_noRowMessage(get_lang('There is no course matching such criteria') . '<br />' . '<a href="advanced_course_search.php' . $addtoAdvanced . '">' . get_lang('Search again (advanced)') . '</a>'); // Command list $cmdList = array(); $cmdList[] = array('img' => 'courseadd', 'name' => get_lang('Create course'), 'url' => '../course/create.php?adminContext=1'); // Display $out = ''; $out .= claro_html_tool_title($nameTools, null, $cmdList); if (!empty($isSearched)) { $dialogBox->info('<b>' . get_lang('Search on') . '</b> : <small>' . $isSearched . '</small>'); } $out .= $dialogBox->render(); // DISPLAY : Search/filter panel $out .= '<table width="100%">' . "\n\n" . '<tr>' . "\n" . '<td align="right" valign="top">' . "\n\n" . '<form action="' . $_SERVER['PHP_SELF'] . '">' . "\n" . '<label for="search">' . get_lang('Make new search') . ' : </label>' . "\n" . '<input type="text" value="' . claro_htmlspecialchars($search) . '" name="search" id="search" />' . "\n" . '<input type="submit" value=" ' . get_lang('Ok') . ' " />' . "\n" . '<input type="hidden" name="newsearch" value="yes" />' . "\n" . '[<a class="claroCmd" href="advanced_course_search.php' . $addtoAdvanced . '">' . get_lang('Advanced') . '</a>]' . "\n" . '</form>' . "\n\n" . '</td>' . "\n" . '</tr>' . "\n\n" . '</table>' . "\n\n"; // DISPLAY : List of datas $out .= $myPager->disp_pager_tool_bar($_SERVER['PHP_SELF']) . $courseDataGrid->render() . $myPager->disp_pager_tool_bar($_SERVER['PHP_SELF']); $claroline->display->body->appendContent($out); echo $claroline->display->render(); /** * Prepares the sql request to select courses in database. * * @return string $sql */ function prepare_get_filtred_course_list() { $tbl_mdb_names = claro_sql_get_main_tbl(); $sqlFilter = array(); // Prepare filter deal with KEY WORDS classification call if (isset($_SESSION['admin_course_search'])) { $sqlFilter[] = "( co.`intitule` LIKE '%" . claro_sql_escape(pr_star_replace($_SESSION['admin_course_search'])) . "%'" . "\n" . " OR co.`administrativeNumber` LIKE '%" . claro_sql_escape(pr_star_replace($_SESSION['admin_course_search'])) . "%'" . "\n" . ")"; }
$cmdList[] = array('img' => 'locked', 'name' => get_lang('Reset all user passwords'), 'url' => $_SERVER['PHP_SELF'] . '?cmd=rqResetAllPasswords'); $out .= claro_html_tool_title($nameTools, null, $cmdList); //Display selectbox and advanced search link //TOOL LINKS //Display search form if (!empty($isSearchedHTML)) { $dialogBox->info('<b>' . get_lang('Search on') . '</b> : <small>' . $isSearchedHTML . '</small>'); } //Display Forms or dialog box(if needed) $out .= $dialogBox->render(); $out .= '<table width="100%">' . "\n" . '<tr>' . "\n" . '<td align="right">' . "\n" . '<form action="' . $_SERVER['PHP_SELF'] . '">' . "\n" . '<label for="search">' . get_lang('Make new search') . ' </label>' . "\n" . '<input type="text" value="' . claro_htmlspecialchars($search) . '" name="search" id="search" />' . "\n" . '<input type="submit" value=" ' . get_lang('Ok') . ' " />' . "\n" . '<input type="hidden" name="newsearch" value="yes" />' . "\n" . ' [<a class="claroCmd" href="advanced_user_search.php' . $addtoAdvanced . '" >' . get_lang('Advanced') . '</a>]' . "\n" . '</form>' . "\n" . '</td>' . "\n" . '</tr>' . "\n" . '<tr>' . '</tr>' . '</table>' . "\n\n"; $url = $search == '' ? $_SERVER['PHP_SELF'] : $_SERVER['PHP_SELF'] . '?search=' . $search; if (count($userGrid) > 0) { $out .= $myPager->disp_pager_tool_bar($url); } $out .= $userDataGrid->render(); if (count($userGrid) > 0) { $out .= $myPager->disp_pager_tool_bar($url); } JavascriptLoader::getInstance()->load('admin_users'); $claroline->display->body->appendContent($out); echo $claroline->display->render(); /** * * @todo: the name would be review befor move to a lib * @todo: eject usage in function of $_SESSION * * @return sql statements */ function get_sql_filtered_user_list() {
/** * PREPARE DISPLAY */ ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb')); $contactUidList = claro_get_uid_of_platform_contact(); $requestUidList = claro_get_uid_of_request_admin(); $notifiedUidList = claro_get_uid_of_system_notification_recipient(); foreach ($platformAdminUidList as $k => $platformAdminUid) { $userData = user_get_properties($platformAdminUid); $userDataGrid[$k]['id'] = $userData['user_id']; $userDataGrid[$k]['name'] = $userData['lastname']; $userDataGrid[$k]['firstname'] = $userData['firstname']; $userDataGrid[$k]['email'] = $userData['email']; $userDataGrid[$k]['authSource'] = $userData['authSource']; //$userDataGrid[$k]['contact_switch'] = '<input name="contactList[]" type="checkbox" value="' . $platformAdminUid . '" ' . ((bool) in_array($platformAdminUid,$contactUidList) ? 'checked="checked" />' : '>'); $userDataGrid[$k]['request_switch'] = '<input name="requestList[]" type="checkbox" value="' . $platformAdminUid . '" ' . ((bool) in_array($platformAdminUid, $requestUidList) ? 'checked="checked" /> ' : '> '); $userDataGrid[$k]['notification_switch'] = '<input name="notifiedList[]" type="checkbox" value="' . $platformAdminUid . '" ' . ((bool) in_array($platformAdminUid, $notifiedUidList) ? 'checked="checked" /> ' : '> '); } $adminDataGrid = new claro_datagrid($userDataGrid); $adminDataGrid->set_idLineType('none'); $adminDataGrid->set_colHead('name'); $adminDataGrid->set_colTitleList(array('user id' => get_lang('User id'), 'name' => get_lang('Last name'), 'firstname' => get_lang('First name'), 'email' => get_lang('Email'), 'authSource' => get_lang('Authentication source'), 'request_switch' => get_lang('Request'), 'notification_switch' => get_lang('Notify'))); $adminDataGrid->set_colAttributeList(array('request_switch' => array('align' => 'left'), 'notification_switch' => array('align' => 'left'), 'authSource' => array('align' => 'center'))); /** * DISPLAY */ $out = ''; // Display tool title $out .= claro_html_tool_title($nameTools) . claro_html_msg_list($messageList) . '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">' . "\n" . '<input type="hidden" name="cmd" value="setRecipient" />' . "\n" . $adminDataGrid->render() . '<input type="submit" value="' . get_lang('Ok') . '" /> ' . "\n" . claro_html_button($_SERVER['PHP_SELF'], get_lang('Cancel')) . "\n" . '</form>' . "\n"; $claroline->display->body->appendContent($out); echo $claroline->display->render();
$userDataList[$lineId]['cmd_cu_unenroll'] = '<a href="' . $_SERVER['PHP_SELF'] . '?cidToEdit=' . $cidToEdit . '&cmd=unsub&user_id=' . $user['user_id'] . '&pager_offset=' . $pager_offset . '" ' . ' onclick="return ADMIN.confirmationUnReg(\'' . clean_str_for_javascript($user['username']) . '\');">' . "\n" . '<img src="' . get_icon_url('unenroll') . '" alt="' . get_lang('Unregister user') . '" />' . "\n" . '</a>' . "\n"; } // end display users table // Prepare output // Javascript confirm pop up declaration for header JavascriptLanguage::getInstance()->addLangVar('Are you sure you want to unregister %name ?'); JavascriptLoader::getInstance()->load('admin'); // Config Datagrid $sortUrlList = $myPager->get_sort_url_list($_SERVER['PHP_SELF'] . '?cidToEdit=' . $cidToEdit); $dg_opt_list['idLineShift'] = $myPager->offset + 1; $dg_opt_list['colTitleList'] = array('user_id' => '<a href="' . $sortUrlList['user_id'] . '">' . get_lang('User id') . '</a>', 'name' => '<a href="' . $sortUrlList['name'] . '">' . get_lang('Last name') . '</a>', 'firstname' => '<a href="' . $sortUrlList['firstname'] . '">' . get_lang('First name') . '</a>', 'profileId' => '<a href="' . $sortUrlList['profileId'] . '">' . get_lang('Profile') . '</a>', 'isCourseManager' => '<a href="' . $sortUrlList['isCourseManager'] . '">' . get_lang('Course manager') . '</a>', 'cmd_cu_edit' => get_lang('Edit'), 'cmd_cu_unenroll' => get_lang('Unregister user')); $dg_opt_list['colAttributeList'] = array('user_id' => array('align' => 'center'), 'isCourseManager' => array('align' => 'center'), 'cmd_cu_edit' => array('align' => 'center'), 'cmd_cu_unenroll' => array('align' => 'center')); $nameTools = get_lang('Course members'); $nameTools .= " : " . $courseData['name']; // Deal with interbreadcrumbs ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb')); // Command list $cmdList = array(); $cmdList[] = array('name' => get_lang('Enroll a user'), 'url' => 'adminregisteruser.php' . '?cidToEdit=' . $cidToEdit); if ($cfrom == 'clist') { $cmdList[] = array('img' => 'back', 'name' => get_lang('Back to course list'), 'url' => 'admin_courses.php'); } // Display $out = ''; $out .= claro_html_tool_title($nameTools, null, $cmdList); $out .= $dialogBox->render(); $userDataGrid = new claro_datagrid($userDataList); $userDataGrid->set_option_list($dg_opt_list); $out .= $myPager->disp_pager_tool_bar($_SERVER['PHP_SELF'] . '?cidToEdit=' . $cidToEdit) . $userDataGrid->render() . $myPager->disp_pager_tool_bar($_SERVER['PHP_SELF'] . '?cidToEdit=' . $cidToEdit); $claroline->display->body->appendContent($out); echo $claroline->display->render();
* Main ***************************************************************************/ $tempView = $view; $levelView++; $out .= '<p>' . "\n"; if ('1' == $view[$levelView]) { $tempView[$levelView] = '0'; if (false === ($datagrid[$levelView] = $Cache_Lite->get($levelView))) { $sql = "SELECT DISTINCT username AS username\n , count(*) AS qty\n FROM `" . $tbl_user . "`\n GROUP BY username\n HAVING qty > 1\n ORDER BY qty DESC\n LIMIT 100"; $data = claro_sql_query_fetch_all($sql); if (!is_array($data) || 0 == sizeof($data)) { $data[] = array('-', 'qty' => '-'); } $dg->set_colTitleList(array(get_lang('Username'), get_lang('count'))); $dg->set_grid($data); $datagrid[$levelView] .= $dg->render(); $Cache_Lite->save($datagrid[$levelView], $levelView); } $out .= '-' . ' ' . '<b>' . get_lang('Accounts with same <i>Username</i>') . '</b>' . ' ' . '<small>' . '[<a href="' . $_SERVER['PHP_SELF'] . '?view=' . $tempView . '">' . get_lang('Close') . '</a>]' . '</small>' . '<br />' . "\n" . $datagrid[$levelView] . '<small>' . get_lang('Last computing') . ' ' . claro_html_localised_date(get_locale('dateTimeFormatLong') . ':%S', $Cache_Lite->lastModified()) . ', ' . get_lang('%delay ago', array('%delay' => claro_html_duration(time() - $Cache_Lite->lastModified()))) . '</small>' . '<br />' . "\n"; } else { $tempView[$levelView] = '1'; $out .= '+' . ' ' . '<a href="' . $_SERVER['PHP_SELF'] . '?view=' . $tempView . '">' . get_lang('Accounts with same <i>Username</i>') . '</a>' . "\n"; } $out .= '</p>' . "\n\n"; /*************************************************************************** * Platform access and logins ***************************************************************************/ $tempView = $view; $levelView++; $out .= '<p>' . "\n"; if ('1' == $view[$levelView]) {