Skip to content

Commit

Permalink
Completely disable all blog scripts when blog system disabled from si…
Browse files Browse the repository at this point in the history
…te preferences MDL-6803
  • Loading branch information
skodak committed Oct 3, 2006
1 parent 9731624 commit ab2f17b
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion blocks/blog_menu/block_blog_menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 5 additions & 0 deletions blocks/blog_tags/block_blog_tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 4 additions & 0 deletions blog/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'])) {
Expand Down
3 changes: 3 additions & 0 deletions blog/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions blog/preferences.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
4 changes: 4 additions & 0 deletions blog/set_session_vars.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
4 changes: 4 additions & 0 deletions blog/tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);


Expand Down

0 comments on commit ab2f17b

Please sign in to comment.