]> git.mjollnir.org Git - moodle.git/commitdiff
Completely disable all blog scripts when blog system disabled from site preferences...
authorskodak <skodak>
Tue, 3 Oct 2006 19:21:35 +0000 (19:21 +0000)
committerskodak <skodak>
Tue, 3 Oct 2006 19:21:35 +0000 (19:21 +0000)
blocks/blog_menu/block_blog_menu.php
blocks/blog_tags/block_blog_tags.php
blog/edit.php
blog/index.php
blog/preferences.php
blog/set_session_vars.php
blog/tags.php

index 6520d06b6724cbe7e8277681206ff99fd8fe341e..86714ecb034e4ff5cb16971896a3fea6cc9f7deb 100755 (executable)
@@ -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;
         }
index 78da2aa3bc772a829ed70c7c7af76cee2d4afa14..dd894bb77ecc3a343aba9b69f64234a03915f3da 100644 (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;
         }
index 65bf431ddec084159bf0c92a99c9f09f201637ff..075a6a0cb62d8e13ac12ab8b25a287dce93ecdb8 100755 (executable)
@@ -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'])) {
index 0d8f7bfa6c0fd20c6216dd2b864a36bd1631c992..e27f05d9671cf6443d0ac636d34bf4bf1dde75d9 100755 (executable)
@@ -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
index 599f3d1b82ac589a303aa4651488a63526775361..518da93d90a31b20cae2c45668db587adc80c9ef 100755 (executable)
@@ -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)) {
index 680a40faec1720777cfeeb5cff058b627ba4b554..1cad1ef41ca40fd19d91314d3c447da08b205222 100644 (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)) {
index cf0f80475f56e70a95b2aa7d8ae7870cbd7c5e09..47bd10c0d485568ffb2313caae9820e7d00a62ae 100755 (executable)
@@ -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);