In order to ensure that when a teacher hides a resource or an activity that students...
authorgustav_delius <gustav_delius>
Wed, 16 Feb 2005 10:40:48 +0000 (10:40 +0000)
committergustav_delius <gustav_delius>
Wed, 16 Feb 2005 10:40:48 +0000 (10:40 +0000)
commitec81373f501eea91312491f3a3b2ae370467dab6
tree876c5ab738857a4db3ce11602f80d6fae795f463
parent25ecf09aa11c76d90675cb643b32b4a8883f7549
In order to ensure that when a teacher hides a resource or an activity that students really can't get at it, even if they know the direct links to its pages, I have given an optional third argument $cm to the functions  require_login() and require_course_login(). Pages showing information about a particular course module now pass the course module object in this third argument. The login functions will then test if either the course module is visible or the user is a teacher. If neither is the case then the user is redirected to the course homepage after being shown a message "Sorry, this activity is currently hidden".

(While I was at it I also turned the autologinguests off for most module pages, except on the index.php pages and the view.php pages for those modules that allow guests)
96 files changed:
lib/moodlelib.php
mod/assignment/submissions.php
mod/assignment/upload.php
mod/assignment/version.php
mod/assignment/view.php
mod/attendance/add.php
mod/attendance/version.php
mod/attendance/view.php
mod/chat/gui_header_js/index.php
mod/chat/gui_sockets/index.php
mod/chat/report.php
mod/chat/version.php
mod/chat/view.php
mod/choice/report.php
mod/choice/version.php
mod/choice/view.php
mod/dialogue/dialogues.php
mod/dialogue/version.php
mod/dialogue/view.php
mod/exercise/assessments.php
mod/exercise/submissions.php
mod/exercise/upload.php
mod/exercise/version.php
mod/exercise/view.php
mod/forum/discuss.php
mod/forum/index.php
mod/forum/lib.php
mod/forum/post.php
mod/forum/search.php
mod/forum/subscribe.php
mod/forum/subscribers.php
mod/forum/version.php
mod/forum/view.php
mod/glossary/approve.php
mod/glossary/comment.php
mod/glossary/comments.php
mod/glossary/deleteentry.php
mod/glossary/edit.php
mod/glossary/editcategories.php
mod/glossary/export.php
mod/glossary/formats.php
mod/glossary/import.php
mod/glossary/print.php
mod/glossary/rate.php
mod/glossary/showentry.php
mod/glossary/version.php
mod/journal/edit.php
mod/journal/report.php
mod/journal/version.php
mod/journal/view.php
mod/lesson/import.php
mod/lesson/lesson.php
mod/lesson/report.php
mod/lesson/version.php
mod/lesson/view.php
mod/quiz/attempt.php
mod/quiz/category.php
mod/quiz/edit.php
mod/quiz/export.php
mod/quiz/import.php
mod/quiz/multiple.php
mod/quiz/question.php
mod/quiz/questiontypes/datasetdependent/categorydatasetdefinitions.php
mod/quiz/report.php
mod/quiz/review.php
mod/quiz/version.php
mod/quiz/view.php
mod/resource/fetch.php
mod/resource/lib.php
mod/resource/version.php
mod/scorm/cmi.php
mod/scorm/index.php
mod/scorm/playscorm.php
mod/scorm/report.php
mod/scorm/scormAPI.php
mod/scorm/version.php
mod/scorm/view.php
mod/survey/details.php
mod/survey/download.php
mod/survey/graph.php
mod/survey/report.php
mod/survey/save.php
mod/survey/version.php
mod/survey/view.php
mod/wiki/admin.php
mod/wiki/version.php
mod/wiki/view.php
mod/workshop/assess.php
mod/workshop/assessments.php
mod/workshop/index.php
mod/workshop/submissions.php
mod/workshop/upload.php
mod/workshop/version.php
mod/workshop/view.php
mod/workshop/viewassessment.php
version.php