Browse files

Completely disable all blog scripts when blog system disabled from si…

…te preferences MDL-6803
  • Loading branch information...
1 parent 9731624 commit ab2f17b05b760b9f5b40faaacc55a0653ccdefdb skodak committed Oct 3, 2006
View
2 blocks/blog_menu/block_blog_menu.php
@@ -17,7 +17,7 @@ function get_content() {
$course = SITEID;
}
- if ($CFG->bloglevel < BLOG_USER_LEVEL) {
+ if (empty($CFG->bloglevel)) {
$this->content->text = '';
return $this->content;
}
View
5 blocks/blog_tags/block_blog_tags.php
@@ -43,6 +43,11 @@ function get_content() {
global $CFG, $SITE, $COURSE;
+ if (empty($CFG->bloglevel)) {
+ $this->content->text = '';
+ return $this->content;
+ }
+
if (empty($this->config->timewithin)) {
$this->config->timewithin = BLOGDEFAULTTIMEWITHIN;
}
View
4 blog/edit.php
@@ -7,6 +7,10 @@
$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'])) {
View
3 blog/index.php
@@ -26,6 +26,9 @@
$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
View
4 blog/preferences.php
@@ -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)) {
View
4 blog/set_session_vars.php
@@ -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)) {
View
4 blog/tags.php
@@ -6,6 +6,10 @@
//form process
$mode = optional_param('mode','',PARAM_ALPHA);
+if (empty($CFG->bloglevel)) {
+ error('Blogging is disabled!');
+}
+
$context = get_context_instance(CONTEXT_SYSTEM, SITEID);

0 comments on commit ab2f17b

Please sign in to comment.