* Copyright 1999-2001 (c) VA Linux Systems
* Copyright 2002-2004 (c) GForge Team
* Copyright 2010 (c) Franck Villaume - Capgemini
+ * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
* http://fusionforge.org/
*
- * This file is part of FusionForge.
- *
- * FusionForge is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
*
* FusionForge is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with FusionForge; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
require_once('../../env.inc.php');
require_once $gfcommon.'include/pre.php';
-require_once $gfwww.'forum/include/ForumHTML.class.php';
+require_once $gfcommon.'forum/ForumHTML.class.php';
require_once $gfcommon.'forum/Forum.class.php';
-require_once $gfwww.'forum/admin/ForumAdmin.class.php';
+require_once $gfcommon.'forum/ForumAdmin.class.php';
require_once $gfcommon.'forum/ForumFactory.class.php';
require_once $gfcommon.'forum/ForumMessageFactory.class.php';
require_once $gfcommon.'forum/ForumMessage.class.php';
$group_id = getIntFromRequest('group_id');
$group_forum_id = getIntFromRequest('group_forum_id');
$deleteforum = getStringFromRequest('deleteforum');
-$feedback = htmlspecialchars(getStringFromRequest('feedback'));
global $HTML;
//
// Set up local objects
//
-$g =& group_get_object($group_id);
+$g = group_get_object($group_id);
if (!$g || !is_object($g) || $g->isError()) {
exit_no_group();
}
+if (!$g->usesForum()) {
+ exit_error(sprintf(_('%s does not use the Forum tool'),
+ $g->getPublicName()), 'forums');
+}
session_require_perm ('forum_admin', $group_id) ;
if (check_email_available($g, $g->getUnixName() . '-' . getStringFromRequest('forum_name'), $error_msg)) {
$fa = new ForumAdmin($group_id);
$feedback .= $fa->ExecuteAction("add_forum");
+ $g->normalizeAllRoles () ;
}
} else if (getStringFromRequest('change_status')) {
$fa = new ForumAdmin($group_id);
<strong>'._('Description').':</strong><br />
<input type="text" name="description" value="" size="40" maxlength="80" />
</p>
- <p>
- <strong>'._('Is Public?').'</strong><br />
- <input type="radio" name="is_public" value="1" checked="checked" />'._('Yes').' <br />
- <input type="radio" name="is_public" value="0" />'._('No').'
- </p>
- <p>
- <strong>'._('Allow Anonymous Posts?').'</strong><br />
- <input type="radio" name="allow_anonymous" value="1" />'._('Yes').'<br />
- <input type="radio" name="allow_anonymous" value="0" checked="checked" />'._('No').'
- </p>
- <p>
-
- html_build_select_box_from_assoc(array("0" => _('No Moderation') ,"1" => _('Moderated Level 1'),"2" => _('Moderated Level 2') ),"moderation_level",0) . '
- <br />' . _('Moderated Level 1') . ': ' . _('To moderate anonymous posts (if allowed in public forum) and posts from non-member users.') . '<br />' . _('Moderated Level 2') . ': ' . _('To moderate ALL posts.') . '<p>
-
+ <p>
<strong>'._('Email All Posts To:').'</strong><br />
<input type="text" name="send_all_posts_to" value="" size="60" />
</p>
echo '<p>'._('You can adjust forum features from here. Please note that private forums can still be viewed by members of your project, not the general public.').'</p>';
$fa = new ForumAdmin($f->Group->getID());
$fa->PrintAdminPendingOption($group_forum_id);
-
+
echo '
<form action="'.getStringFromServer('PHP_SELF').'" method="post">
<p>
<input type="hidden" name="change_status" value="y" />
<input type="hidden" name="group_forum_id" value="'. $f->getID() .'" />
<input type="hidden" name="group_id" value="'.$group_id.'" />
-
- <strong>'._('Allow Anonymous Posts?').'</strong><br />
- <input type="radio" name="allow_anonymous" value="1"'.(($f->AllowAnonymous() == 1)?' checked="checked"':'').' /> '._('Yes').'<br />
- <input type="radio" name="allow_anonymous" value="0"'.(($f->AllowAnonymous() == 0)?' checked="checked"':'').'/> '._('No').'
- </p>
- <p>
- <strong>'._('Is Public?').'</strong><br />
- <input type="radio" name="is_public" value="1"'.(($f->isPublic() == 1)?' checked="checked"':'').' /> '._('Yes').'<br />
- <input type="radio" name="is_public" value="0"'.(($f->isPublic() == 0)?' checked="checked"':'').' /> '._('No').'<br />
- <input type="radio" name="is_public" value="9"'.(($f->isPublic() == 9)?' checked="checked"':'').' />'._('Suspended').'<br />
- <p>' .
- html_build_select_box_from_assoc(array("0" => _('No Moderation') ,"1" => _('Moderated Level 1'),"2" => _('Moderated Level 2') ),"moderation_level",$f->getModerationLevel()) . '
- <br />' . _('Moderated Level 1') . ': ' . _('To moderate anonymous posts (if allowed in public forum) and posts from non-member users.') . '<br />' . _('Moderated Level 2') . ': ' . _('To moderate ALL posts.') . '<p>
-
-
<strong>'._('Forum Name').':</strong><br />
<input type="text" name="forum_name" value="'. $f->getName() .'" size="20" maxlength="30" />
</p>
} elseif ( getStringFromRequest("deletemsg") ) {
// delete message handling
-
+
$forum_id = getIntFromRequest("forum_id");
$thread_id = getIntFromRequest("thread_id");
$msg_id = getIntFromRequest("deletemsg");
forum_header(array('title'=>_('Delete a Message')));
echo '<center>
<form action="'.getStringFromServer('PHP_SELF').'" method="post">
- <h3>' . _('WARNING! You are about to permanently delete a message and all of its followups!!') . '</h3><p>
+ <h3>' . _('WARNING! You are about to permanently delete a message and all of its followups!!') . '</h3>
<p>
<input type="submit" name="ok" value="' . _('Yes') . '" />
- <input type="submit" name="cancel" value="' . _('No') . '" />
+ <input type="submit" name="cancel" value="' . _('No') . '" />
<input type="hidden" name="deletemsg" value="'.$msg_id.'" />
<input type="hidden" name="group_id" value="'.$group_id.'" />
<input type="hidden" name="forum_id" value="'.$forum_id.'" />
}
$subject = getStringFromRequest('subject');
$body = getStringFromRequest('body');
-
+
$sanitizer = new TextSanitizer();
$body = $sanitizer->SanitizeHtml($body);
-
+
$is_followup_to = getStringFromRequest('is_followup_to');
$form_key = getStringFromRequest('form_key');
$posted_by = getStringFromRequest('posted_by');
} elseif (getStringFromRequest("cancel")) {
// the user cancelled the request, go back to forum
session_redirect('/forum/message.php?msg_id='.$msg_id);
- } else {
+ } else {
//print the edit message confirmation
-
+
$f = new Forum ($fa->GetGroupObject(),$forum_id);
if (!$f || !is_object($f)) {
exit_error(_('Error Getting Forum'),'forums');
} elseif ($f->isError()) {
exit_error($f->getErrorMessage(),'forums');
}
-
+
$fm=new ForumMessage($f,$msg_id,false,false);
if (!$fm || !is_object($fm)) {
exit_error(_('Error Getting ForumMessage'),'forums');
} elseif ($fm->isError()) {
exit_error($fm->getErrorMessage(),'forums');
}
-
+
$fh = new ForumHTML($f);
if (!$fh || !is_object($fh)) {
exit_error(_('Error Getting ForumHTML'),'forums');
} elseif ($fh->isError()) {
exit_error($fh->getErrorMessage(),'forums');
}
-
+
forum_header(array('title'=>_('Edit a Message')));
$fh->showEditForm($fm);
forum_footer(array());
session_redirect('/forum/forum.php?thread_id='.$thread_id.'&forum_id='.$forum_id);
}
exit;
- } else {
+ } else {
// Display select box to select new forum
- forum_header(array('title'=>_('Forums: Administration')));
-
+ forum_header(array('title'=>_('Move Thread')));
+
$ff = new ForumFactory($g);
if (!$ff || !is_object($ff) || $ff->isError()) {
exit_error($ff->getErrorMessage(),'forums');
}
- $farr =& $ff->getForums();
+ $farr = $ff->getForums();
if ($ff->isError()) {
- echo '<h1>'.sprintf(_('No Forums Found For %s'), $g->getPublicName()) .'</h1>';
- echo '<div class="error">'.$ff->getErrorMessage().'</div>';
+ echo '<p class="error">'.sprintf(_('No Forums Found For %s'), $g->getPublicName())
+ . $ff->getErrorMessage().'</p>';
forum_footer(array());
exit;
}
$forums[$farr[$j]->getID()] = $farr[$j]->getName();
}
}
-
+
$f_from = new Forum ($fa->GetGroupObject(),$forum_id);
if (!$f_from || !is_object($f_from)) {
exit_error(_('Could Not Get Forum Object'),'forums');
} elseif ($f_from->isError()) {
exit_error($f_from->getErrorMessage(),'forums');
}
-
+
echo '<center>
<form action="'.getStringFromServer('PHP_SELF').'" method="post">
<p><strong>' . sprintf(_('Move thread from %s forum to the following forum:'), $f_from->getName()) . '</strong></p>
<input type="hidden" name="msg_id" value="'.$msg_id.'" />
<input type="hidden" name="return_to_message" value="'.$return_to_message.'" />' .
html_build_select_box_from_assoc($forums,'new_forum_id',$forum_id) .
- '<br /><br />
+ '<br />
<input type="submit" name="ok" value="' . _("Submit") . '" />
- <input type="submit" name="cancel" value="' . _("Cancel") . '" />
+ <input type="submit" name="cancel" value="' . _("Cancel") . '" />
</p>
</form>
</center>';
Show main page for choosing
either moderator or delete
*/
- forum_header(array('title'=>_('Forums: Administration')));
+ forum_header(array('title'=>_('Forums Administration')));
//
// Add new forum
exit_error($ff->getErrorMessage(),'forums');
}
- $farr =& $ff->getForumsAdmin();
+ $farr = $ff->getForumsAdmin();
if ($ff->isError()) {
- echo '<h1>'.sprintf(_('No Forums Found For %1$s'), $g->getPublicName()) .'</h1>';
- echo '<div class="error">'.$ff->getErrorMessage().'</div>';
+ echo '<p class="error">'.sprintf(_('No Forums Found For %s'), $g->getPublicName())
+ . $ff->getErrorMessage().'</p>';
forum_footer(array());
exit;
}