skala
Julio Montoya 15 years ago
commit f8952f4784
  1. 20
      main/inc/banner.inc.php
  2. 4
      main/inc/tool_navigation_menu.inc.php
  3. 61
      main/user/subscribe_user.php
  4. 20
      main/user/user.php

@ -35,7 +35,7 @@ $session_name = api_get_session_name($my_session_id);
if (!empty($_cid) and $_cid != -1 and isset($_course)) { if (!empty($_cid) and $_cid != -1 and isset($_course)) {
//Put the name of the course in the header //Put the name of the course in the header
?> ?>
<div id="my_courses"><a href="<?php echo api_get_path(WEB_COURSE_PATH).$_course['path']; ?>/index.php" target="_top"> <div id="my_courses"><a href="<?php echo api_get_path(WEB_COURSE_PATH).$_course['path']; ?>/index.php" target="_top">&nbsp;
<?php <?php
echo $_course['name'].' '; echo $_course['name'].' ';
if (api_get_setting('display_coursecode_in_courselist') == 'true') { if (api_get_setting('display_coursecode_in_courselist') == 'true') {
@ -95,6 +95,7 @@ if ((api_get_setting('showonline', 'world') == 'true' AND !$_user['user_id']) OR
} }
$number = who_is_online_count(api_get_setting('time_limit_whosonline')); $number = who_is_online_count(api_get_setting('time_limit_whosonline'));
$number_online_in_course = 0; $number_online_in_course = 0;
if(!empty($_course['id'])) { if(!empty($_course['id'])) {
$number_online_in_course = who_is_online_in_this_course_count(api_get_user_id(), api_get_setting('time_limit_whosonline'), $_course['id']); $number_online_in_course = who_is_online_in_this_course_count(api_get_user_id(), api_get_setting('time_limit_whosonline'), $_course['id']);
@ -120,14 +121,14 @@ if ($_user['user_id'] && isset($_cid)) {
echo '</li>'; echo '</li>';
} }
} }
if (api_is_allowed_to_edit()) { if (api_is_allowed_to_edit()) {
if (!empty($help)) { if (!empty($help)) {
// Show help // Show help
?> ?>
<li>| <li>|
<a href="#" onclick="javascript: MyWindow=window.open('<?php echo api_get_path(WEB_CODE_PATH).'help/help.php'; ?>?open=<?php echo $help; ?>','MyWindow','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=620,height=600,left=200,top=20'); return false;"> <a href="#" onclick="javascript: MyWindow=window.open('<?php echo api_get_path(WEB_CODE_PATH).'help/help.php'; ?>?open=<?php echo $help; ?>','MyWindow','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=620,height=600,left=200,top=20'); return false;">
<img src="<?php echo api_get_path(WEB_IMG_PATH); ?>khelpcenter.gif" style="vertical-align: middle;" alt="<?php echo get_lang('Help'); ?>"/>&nbsp;<?php echo get_lang('Help'); ?></li></a> <img src="<?php echo api_get_path(WEB_IMG_PATH); ?>khelpcenter.gif" style="vertical-align: middle;" alt="<?php echo get_lang('Help'); ?>"/>&nbsp;<?php echo get_lang('Help'); ?></li></a>
<?php <?php
} }
} }
@ -136,7 +137,6 @@ if (api_is_allowed_to_edit()) {
</div> </div>
<div class="clear">&nbsp;</div> <div class="clear">&nbsp;</div>
</div> </div>
<div id="header3"> <div id="header3">
<?php <?php
@ -153,16 +153,16 @@ if ($_user['user_id']) {
?> ?>
<!-- start user section line with name, my course, my profile, scorm info, etc --> <!-- start user section line with name, my course, my profile, scorm info, etc -->
<ul id="logout"> <ul id="logout">
<li><a href="<?php echo api_get_path(WEB_PATH); ?>index.php?logout=logout&uid=<?php echo $_user['user_id']; ?>" target="_top"><span><?php echo get_lang('Logout').' '.$login; ?></span></a></li> <li><a href="<?php echo api_get_path(WEB_PATH); ?>index.php?logout=logout&uid=<?php echo $_user['user_id']; ?>" target="_top"><span><?php echo get_lang('Logout').' '.$login; ?></span></a></li>
</ul> </ul>
<?php <?php
} }
?> ?>
<ul>
<ul>
<?php <?php
$navigation = array(); $navigation = array();
$possible_tabs = get_tabs(); $possible_tabs = get_tabs();
// Campus Homepage // Campus Homepage

@ -4,7 +4,7 @@
/** /**
* Navigation menu display code * Navigation menu display code
* *
* @package dokeos.include * @package chamilo.include
*/ */
require_once api_get_path(LIBRARY_PATH).'course_home.lib.php'; // For using the method CourseHome::translate_tool_name(); require_once api_get_path(LIBRARY_PATH).'course_home.lib.php'; // For using the method CourseHome::translate_tool_name();
@ -189,7 +189,7 @@ function show_navigation_menu() {
?> ?>
<script type="text/javascript"> <script type="text/javascript">
/* <![CDATA[ */ /* <![CDATA[ */
if (readCookie('dokeos_menu_state') == 0) if (readCookie('dokeos_menu_state') == 0) {
swap_menu(); swap_menu();
} }
/* ]]> */ /* ]]> */

@ -185,11 +185,11 @@ function get_number_of_users() {
if (isset($_REQUEST['type']) && $_REQUEST['type']=='teacher') { if (isset($_REQUEST['type']) && $_REQUEST['type']=='teacher') {
if (!empty($_SESSION["id_session"])) { if (api_get_session_id() != 0) {
$sql = "SELECT
u.user_id $sql = "SELECT u.user_id
FROM $user_table u FROM $user_table u
LEFT JOIN $tbl_session_rel_course_user cu on u.user_id = cu.id_user and course_code='".$_SESSION['_course']['id']."' AND id_session ='".$_SESSION["id_session"]."' LEFT JOIN $tbl_session_rel_course_user cu on u.user_id = cu.id_user and course_code='".api_get_course_id()."' AND id_session ='".api_get_session_id()."'
WHERE cu.id_user IS NULL AND u.status=1 AND (u.official_code <> 'ADMIN' OR u.official_code IS NULL) "; WHERE cu.id_user IS NULL AND u.status=1 AND (u.official_code <> 'ADMIN' OR u.official_code IS NULL) ";
if ($_configuration['multiple_access_urls']==true) { if ($_configuration['multiple_access_urls']==true) {
@ -197,21 +197,19 @@ function get_number_of_users() {
if ($url_access_id !=-1) { if ($url_access_id !=-1) {
$tbl_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); $tbl_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$sql = "SELECT $sql = "SELECT u.user_id FROM $user_table u
u.user_id LEFT JOIN $tbl_session_rel_course_user cu on u.user_id = cu.id_user and course_code='".api_get_course_id()."' AND id_session ='".api_get_session_id()."'
FROM $user_table u
LEFT JOIN $tbl_session_rel_course_user cu on u.user_id = cu.id_user and course_code='".$_SESSION['_course']['id']."' AND id_session ='".$_SESSION["id_session"]."'
INNER JOIN $tbl_url_rel_user as url_rel_user INNER JOIN $tbl_url_rel_user as url_rel_user
ON (url_rel_user.user_id = u.user_id) ON (url_rel_user.user_id = u.user_id)
WHERE cu.user_id IS NULL AND access_url_id= $url_access_id AND u.status=1 AND (u.official_code <> 'ADMIN' OR u.official_code IS NULL) "; WHERE cu.id_user IS NULL AND access_url_id= $url_access_id AND u.status=1 AND (u.official_code <> 'ADMIN' OR u.official_code IS NULL) ";
} }
} }
} else { } else {
$sql = "SELECT u.user_id $sql = "SELECT u.user_id
FROM $user_table u FROM $user_table u
LEFT JOIN $course_user_table cu on u.user_id = cu.user_id and course_code='".$_SESSION['_course']['id']."' LEFT JOIN $course_user_table cu on u.user_id = cu.user_id and course_code='".api_get_course_id()."'
WHERE cu.user_id IS NULL AND u.status<>".DRH." "; WHERE cu.user_id IS NULL AND u.status<>".DRH." ";
if ($_configuration['multiple_access_urls']==true) { if ($_configuration['multiple_access_urls']==true) {
$url_access_id = api_get_current_access_url_id(); $url_access_id = api_get_current_access_url_id();
@ -221,7 +219,7 @@ function get_number_of_users() {
$sql = "SELECT $sql = "SELECT
u.user_id u.user_id
FROM $user_table u FROM $user_table u
LEFT JOIN $course_user_table cu on u.user_id = cu.user_id and course_code='".$_SESSION['_course']['id']."' LEFT JOIN $course_user_table cu on u.user_id = cu.user_id and course_code='".api_get_course_id()."'
INNER JOIN $tbl_url_rel_user as url_rel_user INNER JOIN $tbl_url_rel_user as url_rel_user
ON (url_rel_user.user_id = u.user_id) ON (url_rel_user.user_id = u.user_id)
WHERE cu.user_id IS NULL AND u.status<>".DRH." AND access_url_id= $url_access_id "; WHERE cu.user_id IS NULL AND u.status<>".DRH." AND access_url_id= $url_access_id ";
@ -232,27 +230,23 @@ function get_number_of_users() {
} else { } else {
// students // students
if (!empty($_SESSION["id_session"])) { if (api_get_session_id() != 0) {
$sql = "SELECT $sql = "SELECT u.user_id
u.user_id
FROM $user_table u FROM $user_table u
LEFT JOIN $tbl_session_rel_course_user cu on u.user_id = cu.id_user and course_code='".$_SESSION['_course']['id']."' AND id_session ='".$_SESSION["id_session"]."' LEFT JOIN $tbl_session_rel_course_user cu on u.user_id = cu.id_user and course_code='".api_get_course_id()."' AND id_session ='".api_get_session_id()."'
WHERE cu.id_user IS NULL AND u.status<>".DRH." AND (u.official_code <> 'ADMIN' OR u.official_code IS NULL) "; WHERE cu.id_user IS NULL AND u.status<>".DRH." AND (u.official_code <> 'ADMIN' OR u.official_code IS NULL) ";
if ($_configuration['multiple_access_urls']==true) { if ($_configuration['multiple_access_urls']==true) {
$url_access_id = api_get_current_access_url_id(); $url_access_id = api_get_current_access_url_id();
if ($url_access_id !=-1) { if ($url_access_id !=-1) {
$tbl_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); $tbl_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$sql = "SELECT $sql = "SELECT u.user_id
u.user_id FROM $user_table u
FROM $user_table u LEFT JOIN $tbl_session_rel_course_user cu on u.user_id = cu.id_user and course_code='".api_get_course_id()."' AND id_session ='".api_get_session_id()."'
LEFT JOIN $tbl_session_rel_course_user cu on u.user_id = cu.id_user and course_code='".$_SESSION['_course']['id']."' AND id_session ='".$_SESSION["id_session"]."' INNER JOIN $tbl_url_rel_user as url_rel_user
INNER JOIN $tbl_url_rel_user as url_rel_user ON (url_rel_user.user_id = u.user_id)
ON (url_rel_user.user_id = u.user_id) WHERE cu.user_id IS NULL AND u.status<>".DRH." AND access_url_id= $url_access_id AND (u.official_code <> 'ADMIN' OR u.official_code IS NULL) ";
WHERE cu.user_id IS NULL AND u.status<>".DRH." AND access_url_id= $url_access_id AND (u.official_code <> 'ADMIN' OR u.official_code IS NULL) ";
} }
} }
} else { } else {
$sql = "SELECT u.user_id $sql = "SELECT u.user_id
@ -274,16 +268,17 @@ function get_number_of_users() {
if ($_configuration['multiple_access_urls']==true) { if ($_configuration['multiple_access_urls']==true) {
$url_access_id = api_get_current_access_url_id(); $url_access_id = api_get_current_access_url_id();
if ($url_access_id !=-1) { if ($url_access_id !=-1) {
$tbl_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); $tbl_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$sql = "SELECT $sql = "SELECT u.user_id
u.user_id FROM $user_table u
FROM $user_table u LEFT JOIN $course_user_table cu on u.user_id = cu.user_id and course_code='".$_SESSION['_course']['id']."'
LEFT JOIN $course_user_table cu on u.user_id = cu.user_id and course_code='".$_SESSION['_course']['id']."' INNER JOIN $tbl_url_rel_user as url_rel_user
INNER JOIN $tbl_url_rel_user as url_rel_user ON (url_rel_user.user_id = u.user_id)
ON (url_rel_user.user_id = u.user_id) WHERE cu.id_user IS NULL AND access_url_id= $url_access_id AND u.status<>".DRH." ";
WHERE cu.user_id IS NULL AND access_url_id= $url_access_id AND u.status<>".DRH." ";
} }
} }

@ -44,31 +44,26 @@ require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
//CHECK KEYS //CHECK KEYS
if (!isset ($_cid)) { if (!isset ($_cid)) {
header('location: '.$_configuration['root_web']); header('location: '.api_get_path(WEB_PATH));
exit;
} }
if (!api_is_platform_admin(true)) { if (!api_is_platform_admin(true)) {
if (!api_is_course_admin() && !api_is_coach()) { if (!api_is_course_admin() && !api_is_coach()) {
if (api_get_course_setting('allow_user_view_user_list')) { if (api_get_course_setting('allow_user_view_user_list') == 0) {
api_not_allowed(true); api_not_allowed(true);
} }
} }
} }
/* /*
-----------------------------------------------------------
Constants and variables Constants and variables
-----------------------------------------------------------
*/ */
$currentCourseID = Database::escape_string($_course['sysCode']); $currentCourseID = Database::escape_string($_course['sysCode']);
$is_western_name_order = api_is_western_name_order();
$is_western_name_order = api_is_western_name_order(); $sort_by_first_name = api_sort_by_first_name();
$sort_by_first_name = api_sort_by_first_name();
/*-------------------------------------- /* Unregistering a user section */
Unregistering a user section
--------------------------------------
*/
if (api_is_allowed_to_edit()) { if (api_is_allowed_to_edit()) {
if (isset($_POST['action'])) { if (isset($_POST['action'])) {
switch ($_POST['action']) { switch ($_POST['action']) {
@ -87,7 +82,6 @@ if (api_is_allowed_to_edit()) {
} }
if (api_is_allowed_to_edit()) { if (api_is_allowed_to_edit()) {
if ( isset ($_GET['action'])) { if ( isset ($_GET['action'])) {
switch ($_GET['action']) { switch ($_GET['action']) {
case 'export' : case 'export' :

Loading…
Cancel
Save