4 * GForge Forum Pending Messages Detail
6 * Portions Copyright 1999-2001 (c) VA Linux Systems
7 * The rest Copyright 2002-2004 (c) GForge Team
12 * This file is part of GForge.
14 * GForge is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
19 * GForge is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with GForge; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 by Daniel Perez - 2005
33 require_once('../../env.inc.php');
34 require_once $gfwww.'include/pre.php';
35 require_once $gfwww.'forum/include/ForumHTML.class.php';
36 require_once $gfwww.'forum/admin/ForumAdmin.class.php';
37 require_once $gfcommon.'forum/Forum.class.php';
38 require_once $gfcommon.'forum/ForumMessage.class.php';
40 $msg_id = getIntFromRequest("msg_id");
41 $group_id = getIntFromRequest('group_id');
42 $forum_id = getIntFromRequest("forum_id");
46 $fa = new ForumAdmin();
48 if ( (!$forum_id) || (!$group_id) || (!$msg_id) ) {
51 if ($fa->Authorized($group_id)) {
52 //user authorized, continue check
53 if ($fa->isForumAdmin($forum_id)) {
55 forum_header(array());
56 $g =& $fa->GetGroupObject();
57 $f=new Forum($g,$forum_id);
58 if (!$f || !is_object($f)) {
59 exit_error(_('Error'),"Error getting new Forum");
60 } elseif ($f->isError()) {
61 exit_error(_('Error'),$f->getErrorMessage());
63 $fm = new ForumMessage($f,$msg_id,false,true); //create the pending message
64 if (!$fm || !is_object($fm)) {
65 exit_error(_('Error'), "Error getting new ForumMessage");
66 } elseif ($fm->isError()) {
67 exit_error(_('Error'),"Error getting new ForumMessage: ".$fm->getErrorMessage());
69 $fhtml = new ForumHTML($f);
70 if (!$fhtml || !is_object($fhtml)) {
71 exit_error(_('Error'), "Error getting new ForumHTML");
72 } elseif ($fhtml->isError()) {
73 exit_error(_('Error'),$fhtml->getErrorMessage());
75 echo $fhtml->showPendingMessage($fm);
76 $HTML->footer(array());
79 exit_permission_denied();
82 exit_permission_denied();
88 // c-file-style: "bsd"