From 0a720c1da01d3fc8e93b70e2266fc66e6e5967a3 Mon Sep 17 00:00:00 2001 From: Matt Lebofsky Date: Mon, 22 Jan 2007 22:39:22 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=11935 --- checkin_notes | 9 +++++++++ html/inc/forum_forum.inc | 3 +++ html/ops/db_update.php | 2 +- html/user/forum_post.php | 12 ++++++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/checkin_notes b/checkin_notes index 3a5c7cbe0b..e297207b78 100755 --- a/checkin_notes +++ b/checkin_notes @@ -956,6 +956,15 @@ Matt 22 Jan 2007 html/ops db_update.php +Matt 22 Jan 2007 + - remaining development of dev blog stuff + + html/ + inc/ + forum_forum.inc + user/ + forum_post.inc + David 22 Jan 2007 - API: use boinc_fopen() instead of fopen() in string variant of boinc_resolve_filename() diff --git a/html/inc/forum_forum.inc b/html/inc/forum_forum.inc index 85b74f5781..8501a7bcb7 100644 --- a/html/inc/forum_forum.inc +++ b/html/inc/forum_forum.inc @@ -75,6 +75,9 @@ class Forum { function getCategory(){ return new Category($this->dbObj->category); } + function isDevBlog(){ + return $this->dbObj->is_dev_blog; + } /** * Increase the post count for the forum (default by one) diff --git a/html/ops/db_update.php b/html/ops/db_update.php index 485ddaa321..5a1a70238c 100644 --- a/html/ops/db_update.php +++ b/html/ops/db_update.php @@ -351,6 +351,6 @@ function update_12_22_2007() { } -//update_11_10_2006(); +//update_12_22_2007(); ?> diff --git a/html/user/forum_post.php b/html/user/forum_post.php index cb99ab0aff..45ce8fe943 100644 --- a/html/user/forum_post.php +++ b/html/user/forum_post.php @@ -18,6 +18,18 @@ check_banished($logged_in_user); $forumid = get_int("id"); $forum = new Forum($forumid); + +if ($forum->isDevBlog()){ + if ( + (!$logged_in_user->isSpecialUser(S_SCIENTIST)) && + (!$logged_in_user->isSpecialUser(S_DEV)) && + (!$logged_in_user->isSpecialUser(S_ADMIN)) + ) { + // Since this is a devBlog only people at the project can start threads here. + error_page("This forum is marked as a development blog, only people directly working with the project may start a new thread here.
However, you may post a reply to an existing thread."); + } +} + if (!$logged_in_user->isSpecialUser(S_MODERATOR) && ($logged_in_user->getTotalCredit()<$forum->getPostMinTotalCredit() || $logged_in_user->getExpavgCredit()<$forum->getPostMinExpavgCredit())) { //If user haven't got enough credit (according to forum regulations) //We do not tell the (ab)user how much this is - no need to make it easy for them to break the system.