Completely disable all blog scripts when blog system disabled from site preferences MDL-6803

This commit is contained in:
skodak
2006-10-03 19:21:35 +00:00
parent 9731624c87
commit ab2f17b05b
7 changed files with 25 additions and 1 deletions
+1 -1
View File
@@ -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;
}
+5
View File
@@ -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;
}
+4
View File
@@ -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'])) {
+3
View File
@@ -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
+4
View File
@@ -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)) {
+4
View File
@@ -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)) {
+4
View File
@@ -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);