course)) { error("Course is misconfigured"); } if (! $wiki = get_record("wiki", "id", $cm->instance)) { error("Course module is incorrect"); } if(!confirm_sesskey()) { error("Session key not set"); } if(!data_submitted()) { error("Only POST requests accepted"); } require_course_login($course, true, $cm); $modcontext = get_context_instance(CONTEXT_MODULE, $cm->id); if(!has_capability('mod/wiki:overridelock', $modcontext)) { error("You do not have the capability to override editing locks"); } $actions = explode('/', $page,2); if(count($actions)!=2) { error("Unsupported page value"); } $pagename=addslashes($actions[1]); if(!delete_records('wiki_locks','pagename',$pagename,'wikiid', $wiki->id)) { error('Unable to delete lock record'); } redirect("view.php?id=$id&page=".urlencode($page)); ?>