Removing $_configuration['tracking_enabled'] because its always true see #2808

skala
Julio Montoya 15 years ago
parent b61c08c4ce
commit 0a9c787fe5
  1. 8
      main/admin/statistics/index.php
  2. 9
      main/admin/user_list.php
  3. 19
      main/exercice/mark_free_answer.php
  4. 7
      main/exercice/savescores.php
  5. 2
      main/inc/global.inc.php
  6. 13
      main/inc/local.inc.php
  7. 2
      main/newscorm/lp_ajax_save_item.php
  8. 2
      main/newscorm/lp_comm.server.php
  9. 17
      main/tracking/courseLogCSV.php
  10. 15
      main/tracking/course_access_details.php
  11. 9
      main/tracking/logins_details.php
  12. 22
      main/tracking/personnalLog.php
  13. 13
      main/tracking/toolaccess_details.php
  14. 7
      main/tracking/userLog.php
  15. 9
      main/tracking/userlogCSV.php
  16. 2
      main/user/user.php
  17. 24
      main/user/userInfo.php

@ -18,13 +18,7 @@ $tool_name = get_lang('Statistics');
Display::display_header($tool_name); Display::display_header($tool_name);
api_display_tool_title($tool_name); api_display_tool_title($tool_name);
if (!$_configuration['tracking_enabled']) { require_once 'statistics.lib.php';
Display::display_warning_message(get_lang('TrackingDisabled'));
Display::display_footer();
exit;
}
require_once ('statistics.lib.php');
$strCourse = get_lang('Courses'); $strCourse = get_lang('Courses');
$strUsers = get_lang('Users'); $strUsers = get_lang('Users');

@ -252,7 +252,7 @@ function login_user($user_id) {
$uidReset = false; $uidReset = false;
if ($user_id) { // a uid is given (log in succeeded) if ($user_id) { // a uid is given (log in succeeded)
if ($_configuration['tracking_enabled']) {
$sql_query = "SELECT user.*, a.user_id is_admin, $sql_query = "SELECT user.*, a.user_id is_admin,
UNIX_TIMESTAMP(login.login_date) login_date UNIX_TIMESTAMP(login.login_date) login_date
FROM $main_user_table FROM $main_user_table
@ -262,13 +262,6 @@ function login_user($user_id) {
ON user.user_id = login.login_user_id ON user.user_id = login.login_user_id
WHERE user.user_id = '".$user_id."' WHERE user.user_id = '".$user_id."'
ORDER BY login.login_date DESC LIMIT 1"; ORDER BY login.login_date DESC LIMIT 1";
} else {
$sql_query = "SELECT user.*, a.user_id is_admin
FROM $main_user_table
LEFT JOIN $main_admin_table a
ON user.user_id = a.user_id
WHERE user.user_id = '".$user_id."'";
}
$sql_result = Database::query($sql_query); $sql_result = Database::query($sql_query);

@ -103,14 +103,10 @@ $interbreadcrumb[]=array("url" => "exercice.php","name" => get_lang('Exercices')
$my_msg = 'No change.'; $my_msg = 'No change.';
if($action == 'mark'){ if ($action == 'mark') {
if (!empty($_POST['score']) AND $_POST['score'] < $obj_question->selectWeighting() AND $_POST['score'] >= 0){ if (!empty($_POST['score']) AND $_POST['score'] < $obj_question->selectWeighting() AND $_POST['score'] >= 0) {
//mark the user mark into the database using something similar to the following function: //mark the user mark into the database using something similar to the following function:
global $_configuration;
if($_configuration['tracking_enabled'])
{
$exercise_table = Database::get_statistic_table('track_e_exercices'); $exercise_table = Database::get_statistic_table('track_e_exercices');
#$tbl_learnpath_user = Database::get_course_table('learnpath_user'); #$tbl_learnpath_user = Database::get_course_table('learnpath_user');
#global $origin, $tbl_learnpath_user, $learnpath_id, $learnpath_item_id; #global $origin, $tbl_learnpath_user, $learnpath_id, $learnpath_item_id;
@ -132,18 +128,14 @@ if($action == 'mark'){
}else{ }else{
$my_score = $_POST['score']; $my_score = $_POST['score'];
$reallyNow = time(); $reallyNow = time();
$sql = "INSERT INTO $exercise_table $sql = "INSERT INTO $exercise_table (
(
exe_user_id, exe_user_id,
exe_cours_id, exe_cours_id,
exe_exo_id, exe_exo_id,
exe_result, exe_result,
exe_weighting, exe_weighting,
exe_date exe_date
) ) VALUES (
VALUES
(
'".Database::escape_string($my_usr)."', '".Database::escape_string($my_usr)."',
'".Database::escape_string($my_cid)."', '".Database::escape_string($my_cid)."',
'".Database::escape_string($my_exe)."', '".Database::escape_string($my_exe)."',
@ -165,8 +157,7 @@ if($action == 'mark'){
} }
//Database::query($sql); //Database::query($sql);
//return 0; //return 0;
} } else {
}else{
$my_msg .= get_lang('TotalScoreTooBig'); $my_msg .= get_lang('TotalScoreTooBig');
} }
} }

@ -50,18 +50,13 @@ $jscript2run = '';
* @return void * @return void
*/ */
function save_scores($file, $score) { function save_scores($file, $score) {
global $_configuration, $origin, global $origin, $_user, $_cid,
$_user, $_cid,
$TABLETRACK_HOTPOTATOES; $TABLETRACK_HOTPOTATOES;
// if tracking is disabled record nothing // if tracking is disabled record nothing
$weighting = 100; // 100% $weighting = 100; // 100%
$reallyNow = time(); $reallyNow = time();
$date = date("Y-m-d H:i:s", $reallyNow); $date = date("Y-m-d H:i:s", $reallyNow);
if (!$_configuration['tracking_enabled']) {
return 0;
}
if ($_user['user_id']) { if ($_user['user_id']) {
$user_id = $_user['user_id']; $user_id = $_user['user_id'];
} else { } else {

@ -517,7 +517,7 @@ $text_dir = api_get_text_direction();
//Update of the logout_date field in the table track_e_login (needed for the calculation of the total connection time) //Update of the logout_date field in the table track_e_login (needed for the calculation of the total connection time)
if ($_configuration['tracking_enabled'] && !isset($_SESSION['login_as']) && isset($_user)) { if (!isset($_SESSION['login_as']) && isset($_user)) {
// if $_SESSION['login_as'] is set, then the user is an admin logged as the user // if $_SESSION['login_as'] is set, then the user is an admin logged as the user
$tbl_track_login = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN); $tbl_track_login = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN);

@ -585,7 +585,7 @@ if (isset($uidReset) && $uidReset) { // session data refresh requested
{ {
$user_table = Database::get_main_table(TABLE_MAIN_USER); $user_table = Database::get_main_table(TABLE_MAIN_USER);
$admin_table = Database::get_main_table(TABLE_MAIN_ADMIN); $admin_table = Database::get_main_table(TABLE_MAIN_ADMIN);
if ($_configuration['tracking_enabled']) {
$sql = "SELECT user.*, a.user_id is_admin, UNIX_TIMESTAMP(login.login_date) login_date $sql = "SELECT user.*, a.user_id is_admin, UNIX_TIMESTAMP(login.login_date) login_date
FROM $user_table FROM $user_table
LEFT JOIN $admin_table a LEFT JOIN $admin_table a
@ -594,13 +594,6 @@ if (isset($uidReset) && $uidReset) { // session data refresh requested
ON user.user_id = login.login_user_id ON user.user_id = login.login_user_id
WHERE user.user_id = '".$_user['user_id']."' WHERE user.user_id = '".$_user['user_id']."'
ORDER BY login.login_date DESC LIMIT 1"; ORDER BY login.login_date DESC LIMIT 1";
} else {
$sql = "SELECT user.*, a.user_id is_admin
FROM $user_table
LEFT JOIN $admin_table a
ON user.user_id = a.user_id
WHERE user.user_id = '".$_user['user_id']."'";
}
$result = Database::query($sql); $result = Database::query($sql);
@ -707,7 +700,7 @@ if (isset($cidReset) && $cidReset) { // course session data refresh requested or
} }
} }
if ($_configuration['tracking_enabled'] && !isset($_SESSION['login_as'])) { if (!isset($_SESSION['login_as'])) {
//We add a new record in the course tracking table //We add a new record in the course tracking table
$course_tracking_table = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS); $course_tracking_table = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
$time = api_get_datetime(); $time = api_get_datetime();
@ -760,7 +753,7 @@ if (isset($cidReset) && $cidReset) { // course session data refresh requested or
list($_SESSION['session_name']) = Database::fetch_array($rs); list($_SESSION['session_name']) = Database::fetch_array($rs);
} }
if ($_configuration['tracking_enabled'] && !isset($_SESSION['login_as'])) { if (!isset($_SESSION['login_as'])) {
$course_tracking_table = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS); $course_tracking_table = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
if (isset($_configuration['session_lifetime'])) { if (isset($_configuration['session_lifetime'])) {

@ -179,7 +179,7 @@ function save_item($lp_id, $user_id, $view_id, $item_id, $score = -1, $max = -1,
if ($debug > 1) { error_log('End of save_item()', 0); } if ($debug > 1) { error_log('End of save_item()', 0); }
} }
if ($_configuration['tracking_enabled'] && !isset($_SESSION['login_as'])) { if (!isset($_SESSION['login_as'])) {
// If $_SESSION['login_as'] is set, then the user is an admin logged as the user. // If $_SESSION['login_as'] is set, then the user is an admin logged as the user.
$tbl_track_login = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN); $tbl_track_login = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN);

@ -163,7 +163,7 @@ function save_item($lp_id, $user_id, $view_id, $item_id, $score = -1, $max = -1,
if ($debug > 1) { error_log('End of xajax_save_item()', 0); } if ($debug > 1) { error_log('End of xajax_save_item()', 0); }
} }
if ($_configuration['tracking_enabled'] && !isset($_SESSION['login_as'])) { if (!isset($_SESSION['login_as'])) {
// If $_SESSION['login_as'] is set, then the user is an admin logged as the user. // If $_SESSION['login_as'] is set, then the user is an admin logged as the user.
$tbl_track_login = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN); $tbl_track_login = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN);

@ -72,8 +72,7 @@ $title[0]=get_lang('StatsOfCourse')." : ".$_course['official_code'];
// check if uid is prof of this group // check if uid is prof of this group
if($is_allowedToTrack && $_configuration['tracking_enabled']) if ($is_allowedToTrack) {
{
// show all : view must be equal to the sum of all view values (1024+512+...+64) // show all : view must be equal to the sum of all view values (1024+512+...+64)
// show none : less than the tiniest value // show none : less than the tiniest value
/*echo "<div> /*echo "<div>
@ -463,18 +462,6 @@ if($is_allowedToTrack && $_configuration['tracking_enabled'])
echo api_html_entity_decode($title_line, ENT_COMPAT); echo api_html_entity_decode($title_line, ENT_COMPAT);
echo api_html_entity_decode($line, ENT_COMPAT); echo api_html_entity_decode($line, ENT_COMPAT);
exit; exit;
} else {
}
// not allowed
else
{
if(!$_configuration['tracking_enabled'])
{
echo get_lang('TrackingDisabled');
}
else
{
api_not_allowed(); api_not_allowed();
}
} }

@ -58,7 +58,7 @@ $is_allowedToTrack = $is_courseAdmin;
</h3> </h3>
<table width="100%" cellpadding="2" cellspacing="3" border="0"> <table width="100%" cellpadding="2" cellspacing="3" border="0">
<?php <?php
if( $is_allowedToTrack && $_configuration['tracking_enabled']) if ($is_allowedToTrack)
{ {
if( !isset($reqdate) || $reqdate < 0 || $reqdate > 2149372861 ) if( !isset($reqdate) || $reqdate < 0 || $reqdate > 2149372861 )
$reqdate = time(); $reqdate = time();
@ -209,23 +209,10 @@ $is_allowedToTrack = $is_courseAdmin;
} }
} }
else // not allowed to track else // not allowed to track
{
if(!$_configuration['tracking_enabled'])
{
echo get_lang('TrackingDisabled');
}
else
{ {
api_not_allowed(); api_not_allowed();
} }
}
?> ?>
</table> </table>
<?php <?php
Display::display_footer(); Display::display_footer();
?>

@ -76,7 +76,7 @@ $is_allowedToTrackEverybodyInCourse = $is_courseAdmin; // allowed to track all s
<?php <?php
// check if uid is tutor of this group // check if uid is tutor of this group
if( ( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse ) && $_configuration['tracking_enabled'] ) if( ( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse ))
{ {
if( $is_allowedToTrackEverybodyInCourse ) if( $is_allowedToTrackEverybodyInCourse )
{ {
@ -246,14 +246,7 @@ if( ( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse ) && $_configura
// not allowed // not allowed
else else
{ {
if(!$_configuration['tracking_enabled'])
{
echo get_lang('TrackingDisabled');
}
else
{
api_not_allowed(); api_not_allowed();
}
} }
?> ?>

@ -60,15 +60,10 @@ include(api_get_path(LIBRARY_PATH)."statsUtils.lib.inc.php");
Display::display_header($nameTools,"Tracking"); Display::display_header($nameTools,"Tracking");
api_display_tool_title($nameTools); api_display_tool_title($nameTools);
/* /* MAIN SECTION */
==============================================================================
MAIN SECTION // show all : view must be equal to the sum of all view values (1024+512+...+64)
============================================================================== // show none : 0
*/
if ( $_configuration['tracking_enabled'] )
{
// show all : view must be equal to the sum of all view values (1024+512+...+64)
// show none : 0
echo " echo "
<table width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" border=\"0\"> <table width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" border=\"0\">
@ -277,12 +272,5 @@ if ( $_configuration['tracking_enabled'] )
"; ";
} }
*/ */
echo "\n</table>"; echo "</table>";
}
else
{
echo get_lang('TrackingDisabled');
}
Display::display_footer(); Display::display_footer();
?>

@ -88,7 +88,7 @@ $reqdate=$_REQUEST['reqdate'];
$is_allowedToTrack = $is_platformAdmin; $is_allowedToTrack = $is_platformAdmin;
$courseCodeEqualcidIfNeeded = ""; $courseCodeEqualcidIfNeeded = "";
} }
if( $is_allowedToTrack && $_configuration['tracking_enabled']) if( $is_allowedToTrack)
{ {
// list of all tools // list of all tools
if (!isset($tool)) if (!isset($tool))
@ -268,18 +268,9 @@ $reqdate=$_REQUEST['reqdate'];
break; break;
} }
} }
} } else { // not allowed to track
else // not allowed to track
{
if(!$_configuration['tracking_enabled'])
{
echo $langTrackingDisabled;
}
else
{
echo get_lang('NotAllowed'); echo get_lang('NotAllowed');
} }
}
echo '</table>'; echo '</table>';
// footer // footer
Display::display_footer(); Display::display_footer();

@ -134,7 +134,7 @@ $is_allowedToTrackEverybodyInCourse = $is_allowedToTrack; // allowed to track al
<table width="100%" cellpadding="2" cellspacing="3" border="0"> <table width="100%" cellpadding="2" cellspacing="3" border="0">
<?php <?php
// check if uid is tutor of this group // check if uid is tutor of this group
if( ( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse ) && $_configuration['tracking_enabled'] ) { if( ( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse )) {
if(!$uInfo && !isset($uInfo) ) { if(!$uInfo && !isset($uInfo) ) {
/* /*
* Display list of user of this group * Display list of user of this group
@ -387,12 +387,7 @@ if( ( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse ) && $_configura
} }
} else { } else {
// not allowed // not allowed
if(!$_configuration['tracking_enabled'])
{
echo get_lang('TrackingDisabled');
} else {
api_not_allowed(); api_not_allowed();
}
} }
?> ?>
</table> </table>

@ -122,7 +122,7 @@ $line='';
$title_line=''; $title_line='';
// check if uid is tutor of this group // check if uid is tutor of this group
if( ( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse ) && $_configuration['tracking_enabled'] ) if( ( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse))
{ {
if(!$uInfo && !isset($uInfo) ) if(!$uInfo && !isset($uInfo) )
{ {
@ -366,12 +366,5 @@ if( ( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse ) && $_configura
// not allowed // not allowed
else else
{ {
if(!$_configuration['tracking_enabled'])
{
echo get_lang('TrackingDisabled');
}
else
{
api_not_allowed(); api_not_allowed();
}
} }

@ -312,7 +312,7 @@ if (isset($message)) {
//statistics //statistics
event_access_tool(TOOL_USER); event_access_tool(TOOL_USER);
/* Setting the permissions for this page */ /* Setting the permissions for this page */
$is_allowed_to_track = ($is_courseAdmin || $is_courseTutor) && $_configuration['tracking_enabled']; $is_allowed_to_track = ($is_courseAdmin || $is_courseTutor);
// Tool introduction // Tool introduction

@ -1,4 +1,4 @@
<?php // $Id: userInfo.php 20951 2009-05-23 19:07:59Z ivantcholakov $ <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
@ -56,13 +56,10 @@ if ($tool_info['visibility'] == 1 ) {
$interbreadcrumb[] = array ('url' => 'user.php', 'name' => get_lang('Users')); $interbreadcrumb[] = array ('url' => 'user.php', 'name' => get_lang('Users'));
} }
if ($origin != 'learnpath') if ($origin != 'learnpath') { //so we are not in learnpath tool
{ //so we are not in learnpath tool
Display :: display_header($nameTools, "User"); Display :: display_header($nameTools, "User");
$origin = Security::remove_XSS($_GET['origin']); $origin = Security::remove_XSS($_GET['origin']);
} } else {
else
{
?> <link rel="stylesheet" type="text/css" href="<?php echo api_get_path(WEB_CODE_PATH);?>css/default.css" /> <?php ?> <link rel="stylesheet" type="text/css" href="<?php echo api_get_path(WEB_CODE_PATH);?>css/default.css" /> <?php
} }
@ -100,22 +97,14 @@ $userIdViewer = $_user['user_id']; // id fo the user currently online
$allowedToEditContent = ($userIdViewer == $userIdViewed) || $is_platformAdmin; $allowedToEditContent = ($userIdViewer == $userIdViewed) || $is_platformAdmin;
$allowedToEditDef = api_is_allowed_to_edit(null, true); $allowedToEditDef = api_is_allowed_to_edit(null, true);
$is_allowedToTrack = api_is_allowed_to_edit(null, true) && $_configuration['tracking_enabled']; $is_allowedToTrack = api_is_allowed_to_edit(null, true);
// Library connection // Library connection
require_once ("userInfoLib.php"); require_once ("userInfoLib.php");
/* /* FUNCTIONS */
==============================================================================
FUNCTIONS
==============================================================================
*/
/* /* COMMANDS SECTION */
==============================================================================
COMMANDS SECTION
==============================================================================
*/
$displayMode = "viewContentList"; $displayMode = "viewContentList";
$removeDef = Security::remove_XSS($_GET['removeDef']); $removeDef = Security::remove_XSS($_GET['removeDef']);
@ -619,4 +608,3 @@ elseif ($displayMode == "viewContentEdit") {
//echo "<div class=\"actions\"><a href=\"user.php?".api_get_cidreq()."&amp;origin=".$origin."\">".get_lang('BackUser')."</a></div>\n"; //echo "<div class=\"actions\"><a href=\"user.php?".api_get_cidreq()."&amp;origin=".$origin."\">".get_lang('BackUser')."</a></div>\n";
/* FOOTER */ /* FOOTER */
Display :: display_footer(); Display :: display_footer();
?>
Loading…
Cancel
Save