Skip to content

Commit 1607ec7

Browse files
Reorder function arguments
1 parent c4b4ff8 commit 1607ec7

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

discussion.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
}
106106

107107
// Has the user the capability to view the post?
108-
if (!moodleoverflow_user_can_see_post($moodleoverflow, $discussion, $post, null, $cm)) {
108+
if (!moodleoverflow_user_can_see_post($moodleoverflow, $discussion, $post, $cm)) {
109109
throw new moodle_exception('noviewdiscussionspermission', 'moodleoverflow',
110110
"$CFG->wwwroot/mod/moodleoverflow/view.php?m=$moodleoverflow->id");
111111
}

lib.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ function moodleoverflow_pluginfile($course, $cm, $context, $filearea, array $arg
448448
}
449449

450450
// Make sure we're allowed to see it...
451-
if (!moodleoverflow_user_can_see_post($moodleoverflow, $discussion, $post, null, $cm)) {
451+
if (!moodleoverflow_user_can_see_post($moodleoverflow, $discussion, $post, $cm)) {
452452
return false;
453453
}
454454

@@ -827,7 +827,7 @@ function moodleoverflow_send_mails() {
827827
}
828828

829829
// Make sure the current user is allowed to see the post.
830-
if (!moodleoverflow_user_can_see_post($moodleoverflow, $discussion, $post, null, $cm)) {
830+
if (!moodleoverflow_user_can_see_post($moodleoverflow, $discussion, $post, $cm)) {
831831
mtrace('User ' . $userto->id . ' can not see ' . $post->id . '. Not sending message.');
832832
continue;
833833
}

locallib.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -515,12 +515,12 @@ function moodleoverflow_get_post_full($postid) {
515515
* @param object $moodleoverflow
516516
* @param object $discussion
517517
* @param object $post
518-
* @param null $user
519518
* @param object $cm
519+
* @param null $user
520520
*
521521
* @return bool
522522
*/
523-
function moodleoverflow_user_can_see_post($moodleoverflow, $discussion, $post, $user = null, $cm) {
523+
function moodleoverflow_user_can_see_post($moodleoverflow, $discussion, $post, $cm, $user = null) {
524524
global $USER, $DB;
525525

526526
// Retrieve the modulecontext.
@@ -1044,7 +1044,7 @@ function moodleoverflow_print_post($post, $discussion, $moodleoverflow, $cm, $co
10441044
}
10451045

10461046
// Check if the user has the capability to see posts.
1047-
if (!moodleoverflow_user_can_see_post($moodleoverflow, $discussion, $post, null, $cm)) {
1047+
if (!moodleoverflow_user_can_see_post($moodleoverflow, $discussion, $post, $cm)) {
10481048

10491049
// No dummy message is requested.
10501050
if (!$dummyifcantsee) {

0 commit comments

Comments
 (0)