Completely disable all blog scripts when blog system disabled from site preferences MDL-6803
This commit is contained in:
@@ -17,7 +17,7 @@ class block_blog_menu extends block_base {
|
||||
$course = SITEID;
|
||||
}
|
||||
|
||||
if ($CFG->bloglevel < BLOG_USER_LEVEL) {
|
||||
if (empty($CFG->bloglevel)) {
|
||||
$this->content->text = '';
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
@@ -43,6 +43,11 @@ class block_blog_tags extends block_base {
|
||||
|
||||
global $CFG, $SITE, $COURSE;
|
||||
|
||||
if (empty($CFG->bloglevel)) {
|
||||
$this->content->text = '';
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
if (empty($this->config->timewithin)) {
|
||||
$this->config->timewithin = BLOGDEFAULTTIMEWITHIN;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,10 @@ require_login();
|
||||
$courseid = optional_param('courseid', SITEID, PARAM_INT);
|
||||
$act = optional_param('act','',PARAM_ALPHA);
|
||||
|
||||
if (empty($CFG->bloglevel)) {
|
||||
error('Blogging is disabled!');
|
||||
}
|
||||
|
||||
// detemine where the user is coming from in case we need to send them back there
|
||||
if (!$referrer = optional_param('referrer','', PARAM_URL)) {
|
||||
if (isset($_SERVER['HTTP_REFERER'])) {
|
||||
|
||||
@@ -26,6 +26,9 @@ $postid = optional_param('postid',0,PARAM_INT);
|
||||
$filtertype = optional_param('filtertype', '', PARAM_ALPHA);
|
||||
$filterselect = optional_param('filterselect', 0, PARAM_INT);
|
||||
|
||||
if (empty($CFG->bloglevel)) {
|
||||
error('Blogging is disabled!');
|
||||
}
|
||||
|
||||
|
||||
/// overwrite filter code here
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
require_login();
|
||||
global $USER;
|
||||
|
||||
if (empty($CFG->bloglevel)) {
|
||||
error('Blogging is disabled!');
|
||||
}
|
||||
|
||||
// detemine where the user is coming from in case we need to send them back there
|
||||
|
||||
if (!$referrer = optional_param('referrer','', PARAM_URL)) {
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
|
||||
require_once('../config.php');
|
||||
|
||||
if (empty($CFG->bloglevel)) {
|
||||
error('Blogging is disabled!');
|
||||
}
|
||||
|
||||
$referrer = required_param('referrer', PARAM_URL);
|
||||
|
||||
if (isset($SESSION->blog_editing_enabled)) {
|
||||
|
||||
@@ -6,6 +6,10 @@ require_login();
|
||||
//form process
|
||||
$mode = optional_param('mode','',PARAM_ALPHA);
|
||||
|
||||
if (empty($CFG->bloglevel)) {
|
||||
error('Blogging is disabled!');
|
||||
}
|
||||
|
||||
$context = get_context_instance(CONTEXT_SYSTEM, SITEID);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user