MDL-6805 Fix redirects in blog; MDL-6807 fix blog capability checks
[moodle.git] / blog / set_session_vars.php
CommitLineData
4a173181 1<?php
2/// inspired/taken from moodle calendar module's set.php file
3
4 require_once('../config.php');
4a173181 5
ab2f17b0 6 if (empty($CFG->bloglevel)) {
7 error('Blogging is disabled!');
8 }
9
aad6de92 10 $referrer = required_param('referrer', PARAM_URL);
4a173181 11
aad6de92 12 if (isset($SESSION->blog_editing_enabled)) {
13 $SESSION->blog_editing_enabled = !$SESSION->blog_editing_enabled;
14 } else {
15 $SESSION->blog_editing_enabled = true;
4a173181 16 }
aad6de92 17
4a173181 18 redirect($referrer);
9154b440 19?>