Permalink
Browse files

Merge branch 'MDL-34695_m22' of git://github.com/rwijaya/moodle into …

…MOODLE_22_STABLE
  • Loading branch information...
2 parents 6a992d7 + a8f5d38 commit 19fad758a1f2c4383d9d63d61882d5559e47758c @danpoltawski danpoltawski committed Nov 27, 2012
Showing with 7 additions and 5 deletions.
  1. +1 −1 mod/wiki/pagelib.php
  2. +6 −4 mod/wiki/view.php
View
@@ -941,7 +941,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);
}
View
@@ -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');
@@ -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:
*
@@ -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);
@@ -267,7 +270,6 @@
} else {
print_error('incorrectparameters');
}
-require_login($course, true, $cm);
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
require_capability('mod/wiki:viewpage', $context);

0 comments on commit 19fad75

Please sign in to comment.