Site Participant List

Site Participant List

by Kunal Kapoor -
Number of replies: 1

Hello everyone.

I've been frantically searching the forums to find an answer to this, if I have missed anything, please forgive me.

My Problem:

I want to show the Participant list on the main front page of my Moodle installation. I want both students and teachers to see it (which I found in the Variables section of the Admin panel). I understand that students on the same course can see each others profiles, but they can't see each other on the main site.

My Objective:

What I do want it to do is have all students be able view each others profiles on the main site.

My Solution:

To achieve my objective, all I did was comment out lines 67-76 out from /user/view.php :

67    if ($course->id == SITEID and !$currentuser) {  // To reduce possibility of "browsing" userbase at site level
68        if (!isteacherinanycourse() and !isteacherinanycourse($user->id) ) {  // Teachers can browse and be browsed at site level
69            print_header("$personalprofile: ", "$personalprofile: ",
70                          "<a href=\"index.php?id=$course->id\">$participants</a>",
71                          "", "", true, "&nbsp;", navmenu($course));
72            print_heading(get_string('usernotavailable', 'error'));
73            print_footer($course);
74            die;
75        }
76    }

My Questions:

I hope by doing this I haven't caused any issues anywhere else on the site. My questions are:

  1. Is what I've done safe?
  2. Can I modify the site so that students can show/hide their profile to other students? If so, does a hack like this already exist?

My being grateful for any help big grin:

I'd like to thank in advance for any help received.

With my best regards,
Kunal Kapoor

Average of ratings: -
In reply to Kunal Kapoor

Re: Site Participant List

by Timothy Takemoto -
Independently, I came upon the same solution to the same problem. I think it is safe.