Security fix to disallow guest uploading

This commit is contained in:
fiedorow 2005-06-16 15:10:40 +00:00
parent 00178c8b42
commit 890c016ac0
2 changed files with 5 additions and 0 deletions

View file

@ -41,6 +41,7 @@ $string['failedupdatefeedback'] = 'Failed to update submission feedback for user
$string['feedback'] = 'Feedback'; $string['feedback'] = 'Feedback';
$string['feedbackfromteacher'] = 'Feedback from the $a'; $string['feedbackfromteacher'] = 'Feedback from the $a';
$string['feedbackupdated'] = 'Submissions feedback updated for $a people'; $string['feedbackupdated'] = 'Submissions feedback updated for $a people';
$string['guestnoupload'] = 'Sorry, guests are not allowed to upload.';
$string['helpoffline'] = '<p>This is useful when the assignment is performed outside of Moodle. It could be $string['helpoffline'] = '<p>This is useful when the assignment is performed outside of Moodle. It could be
something elsewhere on the web or face-to-face.</p><p>Students can see a description of the assignment, something elsewhere on the web or face-to-face.</p><p>Students can see a description of the assignment,
but can\'t upload files or anything. Grading works normally, and students will get notifications of but can\'t upload files or anything. Grading works normally, and students will get notifications of

View file

@ -57,6 +57,10 @@ class assignment_uploadsingle extends assignment_base {
function upload() { function upload() {
global $CFG, $USER; global $CFG, $USER;
if (isguest($USER->id)) {
error(get_string('guestnoupload','assignment'));
}
$this->view_header(get_string('upload')); $this->view_header(get_string('upload'));
if (!$this->isopen()) { if (!$this->isopen()) {