This file is indexed.

/usr/share/moodle/mod/jclic/index.php is in jclicmoodle 0.1.0.11-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?PHP // $Id: index.php,v 1.4 2011-05-25 12:13:03 sarjona Exp $

/// This page lists all the instances of jclic in a particular course

    require_once("../../config.php");
    require_once("lib.php");

    $id = required_param('id', PARAM_INT);      // course

    if (! $course = get_record("course", "id", $id)) {
        error("Course ID is incorrect");
    }

    require_login($course->id);

    add_to_log($course->id, "jclic", "view all", "index.php?id=$course->id", "");


/// Get all required strings

    $strjclics = get_string("modulenameplural", "jclic");
    $strjclic  = get_string("modulename", "jclic");
    $strnotavailable = get_string("notavailable");


/// Print the header

    if ($course->category) {
        $navigation = "<A HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->";
    }

    print_header_simple("$strjclics", "", "$strjclics", "", "", true, "", navmenu($course));
    print_heading(get_string("modulename", "jclic"));

/// Get all the appropriate data

    if (! $jclics = get_all_instances_in_course("jclic", $course)) {
        notice("There are no jclics", "../../course/view.php?id=$course->id");
        die;
    }

/// Print the list of instances (your module will probably extend this)

    $strweek  = get_string("week");
    $strtopic  = get_string("topic");
    $strname  = get_string("name");
    $strdescription  = get_string("description");
	
    if ($course->format == "weeks" || $course->format == "topics") {
    	if ($course->format == "weeks") $first=$strweek;
    	else if ($course->format == "topics") $first=$strtopic;
    	if (isteacher($course->id)){
		$table->head  = array ($first, '&nbsp;&nbsp;&nbsp;'.$strname, $strdescription);
		$table->align = array ("CENTER", "LEFT", "LEFT", "CENTER");
        }else{
    		$strlastaccess  = get_string("lastaccess","jclic");
	    	$strscore  = get_string("score","jclic");
    		$strattempts  = get_string("attempts","jclic");
        	$table->head  = array ($first, '&nbsp;&nbsp;&nbsp;'.$strname, $strdescription,$strlastaccess,$strscore,$strattempts);
	        $table->align = array ("CENTER", "LEFT", "LEFT", "CENTER","CENTER","CENTER");
        }
        $table->wrap = array ("NOWRAP","NOWRAP");
    } else {
        $table->head  = array ($strname);
        $table->align = array ("LEFT", "LEFT", "LEFT");
    }

	if (isteacher($course->id)){
	    foreach ($jclics as $jclic) {
	        if (!$jclic->visible) {
	            //Show dimmed if the mod is hidden
	            $link = "<A class=\"dimmed\" HREF=\"view.php?id=$jclic->coursemodule\">$jclic->name</A>";
	        } else {
	            //Show normal if the mod is visible
	            $link = "<A HREF=\"view.php?id=$jclic->coursemodule\">$jclic->name</A>";
	        }

	        if ($course->format == "weeks" or $course->format == "topics") {
	            $table->data[] = array ($jclic->section, $link, $jclic->description);
	        } else {
	            $table->data[] = array ($link);
	        }
	    }

	    echo "<BR>";

	    print_table($table);
	}else{
	    foreach ($jclics as $jclic) {
	        if (!$jclic->visible) {
	            //Show dimmed if the mod is hidden
	            $link = "<A class=\"dimmed\" HREF=\"view.php?id=$jclic->coursemodule\">$jclic->name</A>";
	        } else {
	            //Show normal if the mod is visible
	            $link = "<A HREF=\"view.php?id=$jclic->coursemodule\">$jclic->name</A>";
	        }
		$sessions_summary=jclic_get_sessions_summary($jclic->id,$USER->id);
		$lastaccess='-';
		if ($sessions_summary->starttime>0) $lastaccess=date('d/m/Y H:i',strtotime($sessions_summary->starttime));
		$score=$sessions_summary->score.'%';
		$attempts=$sessions_summary->attempts;
		if ($jclic->maxattempts>0)$attempts.='/'.$jclic->maxattempts;

	        if ($course->format == "weeks" or $course->format == "topics") {
	            $table->data[] = array ($jclic->section, $link, $jclic->description,$lastaccess,$score,$attempts);
	        } else {
	            $table->data[] = array ($link);
	        }
	    }

	    echo "<BR>";

	    print_table($table);
	}

/// Finish the page

    print_footer($course);

?>