isError()) {
exit_no_group();
}
$p =& $g->getPermission( session_get_user() );
if (!$p || !is_object($p) || $p->isError()) {
exit_permission_denied();
}
if (getStringFromRequest('post_changes')) {
/*
Update the DB to reflect the changes
*/
if ($deleteforum) {
/*
Deleting entire forum
*/
$fa = new ForumAdmin($group_id);
$feedback .= $fa->ExecuteAction("delete_forum");
$group_forum_id=0;
$deleteforum=0;
} else if (getStringFromRequest('add_forum')) {
if (!form_key_is_valid(getStringFromRequest('form_key'))) {
exit_form_double_submit();
}
$fa = new ForumAdmin($group_id);
$feedback .= $fa->ExecuteAction("add_forum");
} else if (getStringFromRequest('change_status')) {
$fa = new ForumAdmin($group_id);
$feedback .= $fa->ExecuteAction("change_status");
}
}
if (getStringFromRequest('add_forum')) {
/*
Show the form for adding forums
*/
forum_header(array('title'=>_('MISSINGTEXT:forum_admin_addforum/title:TEXTMISSING')));
echo '
'._('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.').'
'; $fa = new ForumAdmin(); if ($fa->Authorized($group_id)) { if ($fa->isForumAdmin($group_forum_id)) { $fa->PrintAdminPendingOption($group_forum_id); } } echo '';
//echo ''._('Delete Message').'
';
echo ''._('Delete entire forum and all content').'
';
forum_footer(array());
} elseif ($deleteforum && $group_forum_id) {
$f = new Forum ($g,$group_forum_id);
if (!$f || !is_object($f)) {
exit_error('Error','Could Not Get Forum Object');
} elseif ($f->isError()) {
exit_error('Error',$f->getErrorMessage());
} elseif (!$f->userIsAdmin()) {
exit_permission_denied();
}
forum_header(array('title'=>_('Delete')));
echo '
'._('You are about to permanently and irretrievably delete this entire forum and all its contents!').'
Return to the forum'; forum_footer(array()); } elseif (getStringFromRequest("cancel")) { // the user cancelled the request, go back to forum echo ""; } else { //print the delete message confirmation forum_header(array('title'=>_('Delete a Message'))); echo '
Return to the forum'; forum_footer(array()); } elseif (getStringFromRequest("cancel")) { // the user cancelled the request, go back to forum echo ""; } else { //print the edit message confirmation $f = new Forum ($fa->GetGroupObject(),$forum_id); if (!$f || !is_object($f)) { exit_error('Error','Could Not Get Forum Object'); } elseif ($f->isError()) { exit_error('Error',$f->getErrorMessage()); } $fm=new ForumMessage($f,$msg_id,false,false); if (!$fm || !is_object($fm)) { exit_error(_('Error'),_('Error')); } elseif ($fm->isError()) { exit_error(_('Error'),$fm->getErrorMessage()); } $fh = new ForumHTML($f); if (!$fh || !is_object($fh)) { exit_error(_('Error'),_('Error')); } elseif ($fh->isError()) { exit_error(_('Error'),$fh->getErrorMessage()); } forum_header(array('title'=>_('Edit a Message'))); $fh->showEditForm($fm); forum_footer(array()); } } else { exit_permission_denied(); } } else { //manage auth errors if ($fa->isGroupIdError()) { exit_no_group(); } elseif ($fa->isPermissionDeniedError()) { exit_permission_denied(); } } } else { /* Show main page for choosing either moderator or delete */ forum_header(array('title'=>_('Forums: Administration'))); // // Add new forum // if ($p->isForumAdmin()) { $fa = new ForumAdmin(); $fa->PrintAdminOptions(); } // // Get existing forums // $ff=new ForumFactory($g); if (!$ff || !is_object($ff) || $ff->isError()) { exit_error(_('Error'),$ff->getErrorMessage()); } $farr =& $ff->getForums(); if ($ff->isError()) { echo '
'; } } forum_footer(array()); } } else { /* Not logged in or insufficient privileges */ if (!$group_id) { exit_no_group(); } else { exit_permission_denied(); } } ?>