Skip to content

Commit

Permalink
Merge branch 'MDL-34695' of git://github.com/rwijaya/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed Nov 27, 2012
2 parents 0fa3d61 + e8c07ff commit 908957b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mod/wiki/pagelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ function create_page($pagetitle) {
}
if (empty($this->subwiki)) {
// If subwiki is not set then try find one and set else create one.
if (!$this->subwiki = wiki_get_subwiki_by_group($this->wid, $groupid)) {
if (!$this->subwiki = wiki_get_subwiki_by_group($this->wid, $groupid, $this->uid)) {
$swid = wiki_add_subwiki($PAGE->activityrecord->id, $groupid, $this->uid);
$this->subwiki = wiki_get_subwiki($swid);
}
Expand Down
10 changes: 6 additions & 4 deletions mod/wiki/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
// Checking course instance
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);

require_login($course, true, $cm);

// Checking wiki instance
if (!$wiki = wiki_get_wiki($cm->instance)) {
print_error('incorrectwikiid', 'wiki');
Expand Down Expand Up @@ -138,6 +140,7 @@
// Checking course instance
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);

require_login($course, true, $cm);
/*
* Case 2:
*
Expand Down Expand Up @@ -166,9 +169,9 @@
}

// Checking course instance
if (!$course = $DB->get_record("course", array("id" => $cm->course))) {
print_error('coursemisconf');
}
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);

require_login($course, true, $cm);

$groupmode = groups_get_activity_groupmode($cm);

Expand Down Expand Up @@ -267,7 +270,6 @@
} else {
print_error('incorrectparameters');
}
require_login($course, true, $cm);

$context = context_module::instance($cm->id);
require_capability('mod/wiki:viewpage', $context);
Expand Down

0 comments on commit 908957b

Please sign in to comment.