MDL-22112, create wiki's first page automatically without ask user questions, and add capability check to wiki_create_page function

This commit is contained in:
Dongsheng Cai 2010-05-03 05:49:36 +00:00
parent 9d88a01ba6
commit 3b5e2acbd1
2 changed files with 11 additions and 11 deletions

View file

@ -323,7 +323,8 @@ function wiki_refresh_page_links($page, $links) {
* @param int $userid
*/
function wiki_create_page($swid, $title, $format, $userid) {
global $DB;
global $DB, $PAGE;
require_capability('mod/wiki:editpage', $PAGE->context);
// if page exists
if ($page = wiki_get_page_by_title($swid, $title)) {
return $page->id;