diff --git a/main/social/search.php b/main/social/search.php index 55feb30a81..7b3c50d73f 100755 --- a/main/social/search.php +++ b/main/social/search.php @@ -16,8 +16,8 @@ if (api_get_setting('allow_social_tool') != 'true') { api_not_allowed(); } -$this_section = SECTION_SOCIAL; -$tool_name = get_lang('Search'); +$this_section = SECTION_SOCIAL; +$tool_name = get_lang('Search'); $interbreadcrumb[] = array('url' => 'profile.php', 'name' => get_lang('SocialNetwork')); $query = isset($_GET['q']) ? Security::remove_XSS($_GET['q']): null; diff --git a/main/tracking/course_access_details.php b/main/tracking/course_access_details.php index fac9a21c6f..04d73030d4 100755 --- a/main/tracking/course_access_details.php +++ b/main/tracking/course_access_details.php @@ -10,9 +10,6 @@ */ // TODO: Is this file deprecated? -/* - INIT SECTION -*/ $reqdate = $_REQUEST['reqdate']; $period = $_REQUEST['period']; $displayType = $_REQUEST['displayType']; @@ -20,7 +17,10 @@ require_once '../inc/global.inc.php'; $courseId = api_get_course_int_id(); -$interbreadcrumb[]= array ("url"=>"courseLog.php", "name"=> get_lang('ToolName')); +$interbreadcrumb[] = array( + "url" => "courseLog.php", + "name" => get_lang('ToolName'), +); $nameTools = get_lang('TrafficDetails'); @@ -38,7 +38,7 @@ td {border-bottom: thin dashed gray;} "; //@todo use Database library $TABLETRACK_ACCESS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS); -Display::display_header($nameTools,"Tracking"); +Display::display_header($nameTools, "Tracking"); // the variables for the days and the months // Defining the shorts for the days @@ -56,14 +56,12 @@ $is_allowedToTrack = $is_courseAdmin; 2149372861 ) - $reqdate = time(); - //** dislayed period - echo ""; //** menu echo " - - - "; + echo ""; // display information about this period - switch($period) { + switch ($period) { // all days case "year" : $sql = "SELECT UNIX_TIMESTAMP( access_date ) @@ -172,14 +165,12 @@ $is_allowedToTrack = $is_courseAdmin; AND YEAR( access_date ) = YEAR( FROM_UNIXTIME( '$reqdate' ) ) AND c_id = $courseId AND access_tool IS NULL "; - if($displayType == "day") - { + if ($displayType == "day") { $sql .= "ORDER BY DAYOFYEAR( access_date)"; $days_array = StatsUtils::daysTab($sql); StatsUtils::makeHitsTable($days_array,get_lang('PeriodDay')); - } - else // by hours by default - { + } else { + // by hours by default $sql .= "ORDER BY HOUR( access_date)"; $hours_array = StatsUtils::hoursTab($sql); StatsUtils:: makeHitsTable($hours_array,get_lang('PeriodHour')); @@ -199,10 +190,9 @@ $is_allowedToTrack = $is_courseAdmin; StatsUtils::makeHitsTable($hours_array,get_lang('PeriodHour')); break; } - } - else // not allowed to track - { - api_not_allowed(); + } else { + // not allowed to track + api_not_allowed(); } ?>
"; - switch($period) - { + if ($is_allowedToTrack) { + if (!isset($reqdate) || $reqdate < 0 || $reqdate > 2149372861) + $reqdate = time(); + //** dislayed period + echo "
"; + switch($period) { case "year" : echo date(" Y", $reqdate); break; @@ -80,32 +78,30 @@ $is_allowedToTrack = $is_courseAdmin; echo "
- "; + "; echo " ".get_lang('PeriodToDisplay')." : [".get_lang('PeriodYear')."] [".get_lang('PeriodMonth')."] [".get_lang('PeriodDay')."]    ||    ".get_lang('DetailView')." : "; - switch($period) - { + + switch($period) { case "year" : - //-- if period is "year" display can be by month, day or hour - echo " [".get_lang('PeriodMonth')."]"; + //-- if period is "year" display can be by month, day or hour + echo " [".get_lang('PeriodMonth')."]"; case "month" : - //-- if period is "month" display can be by day or hour - echo " [".get_lang('PeriodDay')."]"; + //-- if period is "month" display can be by day or hour + echo " [".get_lang('PeriodDay')."]"; case "day" : - //-- if period is "day" display can only be by hour - echo " [".get_lang('PeriodHour')."]"; - break; + //-- if period is "day" display can only be by hour + echo " [".get_lang('PeriodHour')."]"; + break; } echo "   ||   "; - switch($period) - { + switch ($period) { case "year" : // previous and next date must be evaluated // 30 days should be a good approximation @@ -136,12 +132,9 @@ $is_allowedToTrack = $is_courseAdmin; "; break; } - echo " -