Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: management.php 5162 2010-08-01 22:09:04Z RyanGordon $
| * $Id$
|
*/
// Disallow direct access to this file for security reasons
| */
// Disallow direct access to this file for security reasons
|
Zeile 19 | Zeile 19 |
---|
if($mybb->input['action'] == "add" || $mybb->input['action'] == "edit" || $mybb->input['action'] == "copy" || $mybb->input['action'] == "permissions" || !$mybb->input['action']) {
|
if($mybb->input['action'] == "add" || $mybb->input['action'] == "edit" || $mybb->input['action'] == "copy" || $mybb->input['action'] == "permissions" || !$mybb->input['action']) {
|
if($mybb->input['fid'] && ($mybb->input['action'] == "management" || $mybb->input['action'] == "edit" || $mybb->input['action'] == "copy" || !$mybb->input['action']))
| if(!empty($mybb->input['fid']) && ($mybb->input['action'] == "management" || $mybb->input['action'] == "edit" || $mybb->input['action'] == "copy" || !$mybb->input['action']))
|
{ $sub_tabs['view_forum'] = array( 'title' => $lang->view_forum,
| { $sub_tabs['view_forum'] = array( 'title' => $lang->view_forum,
|
Zeile 30 | Zeile 30 |
---|
$sub_tabs['add_child_forum'] = array( 'title' => $lang->add_child_forum, 'link' => "index.php?module=forum-management&action=add&pid=".$mybb->input['fid'],
|
$sub_tabs['add_child_forum'] = array( 'title' => $lang->add_child_forum, 'link' => "index.php?module=forum-management&action=add&pid=".$mybb->input['fid'],
|
'description' => $lang->add_child_forum_desc
| 'description' => $lang->view_forum_desc
|
); $sub_tabs['edit_forum_settings'] = array(
| ); $sub_tabs['edit_forum_settings'] = array(
|
Zeile 90 | Zeile 90 |
---|
if($mybb->input['pid'] == -1 && $mybb->input['type'] == 'f') {
|
if($mybb->input['pid'] == -1 && $mybb->input['type'] == 'f') {
|
$errors[] = $lang->error_forum_noparent;
| $errors[] = $lang->error_no_parent;
|
} if(!$errors)
| } if(!$errors)
|
Zeile 248 | Zeile 248 |
---|
$form_container->end();
$form_container = new FormContainer($lang->new_forum_settings);
|
$form_container->end();
$form_container = new FormContainer($lang->new_forum_settings);
|
$form_container->output_row($lang->create_a, $lang->create_a_desc, $form->generate_radio_button('type', 'f', $lang->forum, $create_a_options_f)."<br />\n".$form->generate_radio_button('type', 'c', $lang->category, $create_a_options_c));
| $form_container->output_row($lang->forum_type, $lang->forum_type_desc, $form->generate_radio_button('type', 'f', $lang->forum, $create_a_options_f)."<br />\n".$form->generate_radio_button('type', 'c', $lang->category, $create_a_options_c));
|
$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $copy_data['title'], array('id' => 'title')), 'title'); $form_container->output_row($lang->description, "", $form->generate_text_area('description', $copy_data['description'], array('id' => 'description')), 'description'); $form_container->output_row($lang->parent_forum." <em>*</em>", $lang->parent_forum_desc, $form->generate_forum_select('pid', $copy_data['pid'], array('id' => 'pid', 'main_option' => $lang->none)), 'pid');
| $form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $copy_data['title'], array('id' => 'title')), 'title'); $form_container->output_row($lang->description, "", $form->generate_text_area('description', $copy_data['description'], array('id' => 'description')), 'description'); $form_container->output_row($lang->parent_forum." <em>*</em>", $lang->parent_forum_desc, $form->generate_forum_select('pid', $copy_data['pid'], array('id' => 'pid', 'main_option' => $lang->none)), 'pid');
|
Zeile 299 | Zeile 299 |
---|
$forum = get_forum($fid); if($mod_data['isgroup']) {
|
$forum = get_forum($fid); if($mod_data['isgroup']) {
|
$mod = $mybb->usergroups[$mod_data['id']];
| $mod = $groupscache[$mod_data['id']];
|
} else {
| } else {
|
Zeile 312 | Zeile 312 |
---|
'canviewips' => intval($mybb->input['canviewips']), 'canopenclosethreads' => intval($mybb->input['canopenclosethreads']), 'canmanagethreads' => intval($mybb->input['canmanagethreads']),
|
'canviewips' => intval($mybb->input['canviewips']), 'canopenclosethreads' => intval($mybb->input['canopenclosethreads']), 'canmanagethreads' => intval($mybb->input['canmanagethreads']),
|
'canmovetononmodforum' => intval($mybb->input['canmovetononmodforum'])
| 'canmovetononmodforum' => intval($mybb->input['canmovetononmodforum']), 'canusecustomtools' => intval($mybb->input['canusecustomtools'])
|
); $db->update_query("moderators", $update_array, "mid='".intval($mybb->input['mid'])."'");
| ); $db->update_query("moderators", $update_array, "mid='".intval($mybb->input['mid'])."'");
|
Zeile 370 | Zeile 371 |
---|
$form->generate_check_box('canviewips', 1, $lang->can_view_ips, array('checked' => $mod_data['canviewips'], 'id' => 'canviewips')), $form->generate_check_box('canopenclosethreads', 1, $lang->can_open_close_threads, array('checked' => $mod_data['canopenclosethreads'], 'id' => 'canopenclosethreads')), $form->generate_check_box('canmanagethreads', 1, $lang->can_manage_threads, array('checked' => $mod_data['canmanagethreads'], 'id' => 'canmanagethreads')),
|
$form->generate_check_box('canviewips', 1, $lang->can_view_ips, array('checked' => $mod_data['canviewips'], 'id' => 'canviewips')), $form->generate_check_box('canopenclosethreads', 1, $lang->can_open_close_threads, array('checked' => $mod_data['canopenclosethreads'], 'id' => 'canopenclosethreads')), $form->generate_check_box('canmanagethreads', 1, $lang->can_manage_threads, array('checked' => $mod_data['canmanagethreads'], 'id' => 'canmanagethreads')),
|
$form->generate_check_box('canmovetononmodforum', 1, $lang->can_move_to_other_forums, array('checked' => $mod_data['canmovetononmodforum'], 'id' => 'canmovetononmodforum'))
| $form->generate_check_box('canmovetononmodforum', 1, $lang->can_move_to_other_forums, array('checked' => $mod_data['canmovetononmodforum'], 'id' => 'canmovetononmodforum')), $form->generate_check_box('canusecustomtools', 1, $lang->can_use_custom_tools, array('checked' => $mod_data['canusecustomtools'], 'id' => 'canusecustomtools'))
|
); $form_container->output_row($lang->moderator_permissions, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $moderator_permissions)."</div>");
| ); $form_container->output_row($lang->moderator_permissions, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $moderator_permissions)."</div>");
|
Zeile 445 | Zeile 447 |
---|
$result = $db->fetch_array($query); $fid = $result['fid']; $gid = $result['gid'];
|
$result = $db->fetch_array($query); $fid = $result['fid']; $gid = $result['gid'];
|
| $forum = get_forum($fid);
|
}
$field_list = array();
| }
$field_list = array();
|
Zeile 493 | Zeile 496 |
---|
$cache->update_forumpermissions(); $plugins->run_hooks("admin_forum_management_permissions_commit");
|
$cache->update_forumpermissions(); $plugins->run_hooks("admin_forum_management_permissions_commit");
|
|
|
// Log admin action log_admin_action($fid, $forum['name']);
|
// Log admin action log_admin_action($fid, $forum['name']);
|
|
|
if($mybb->input['ajax'] == 1) {
|
if($mybb->input['ajax'] == 1) {
|
echo "<script type=\"text/javascript\"> $('row_{$gid}').innerHTML = '".str_replace(array("'", "\t", "\n"), array("\\'", "", ""), retrieve_single_permissions_row($gid, $fid))."'; QuickPermEditor.init({$gid}); </script>\n";
| echo "<script type=\"text/javascript\">$('row_{$gid}').update('".str_replace(array("'", "\t", "\n"), array("\\'", "", ""), retrieve_single_permissions_row($gid, $fid))."'); QuickPermEditor.init({$gid});</script>";
|
die; } else
|
die; } else
|
{
| {
|
flash_message($lang->success_forum_permissions_saved, 'success'); admin_redirect("index.php?module=forum-management&fid={$fid}#tab_permissions"); }
| flash_message($lang->success_forum_permissions_saved, 'success'); admin_redirect("index.php?module=forum-management&fid={$fid}#tab_permissions"); }
|
Zeile 521 | Zeile 521 |
---|
$sub_tabs['edit_permissions'] = array( 'title' => $lang->forum_permissions, 'link' => "index.php?module=forum-management&action=permissions&fid=".$mybb->input['fid']."&gid=".$mybb->input['gid'],
|
$sub_tabs['edit_permissions'] = array( 'title' => $lang->forum_permissions, 'link' => "index.php?module=forum-management&action=permissions&fid=".$mybb->input['fid']."&gid=".$mybb->input['gid'],
|
'description' => $lang->forum_permissions_desc ); $page->add_breadcrumb_item($lang->forum_permissions2, "index.php?module=forum-management&fid=".$mybb->input['fid']."#tab_permissions");
| 'description' => $lang->forum_permissions_desc ); $page->add_breadcrumb_item($lang->forum_permissions2, "index.php?module=forum-management&fid=".$mybb->input['fid']."#tab_permissions");
|
} else { $query = $db->simple_select("forumpermissions", "fid", "pid='".intval($mybb->input['pid'])."'"); $mybb->input['fid'] = $db->fetch_field($query, "fid");
|
} else { $query = $db->simple_select("forumpermissions", "fid", "pid='".intval($mybb->input['pid'])."'"); $mybb->input['fid'] = $db->fetch_field($query, "fid");
|
|
|
$sub_tabs['edit_permissions'] = array( 'title' => $lang->forum_permissions, 'link' => "index.php?module=forum-management&action=permissions&pid=".intval($mybb->input['pid']),
| $sub_tabs['edit_permissions'] = array( 'title' => $lang->forum_permissions, 'link' => "index.php?module=forum-management&action=permissions&pid=".intval($mybb->input['pid']),
|
Zeile 545 | Zeile 545 |
---|
$page->output_nav_tabs($sub_tabs, 'edit_permissions'); } else
|
$page->output_nav_tabs($sub_tabs, 'edit_permissions'); } else
|
{
| {
|
echo "<div id=\"ModalContentContainer\"><div class=\"ModalTitle\">{$lang->forum_permissions}<a href=\"javascript:;\" id=\"modalClose\" class=\"float_right modalClose\"> </a></div><div class=\"ModalContent\">"; }
| echo "<div id=\"ModalContentContainer\"><div class=\"ModalTitle\">{$lang->forum_permissions}<a href=\"javascript:;\" id=\"modalClose\" class=\"float_right modalClose\"> </a></div><div class=\"ModalContent\">"; }
|
Zeile 592 | Zeile 592 |
---|
if(!$fid) { $fid = $permission_data['fid'];
|
if(!$fid) { $fid = $permission_data['fid'];
|
}
| }
|
if(!$gid) { $gid = $permission_data['gid'];
| if(!$gid) { $gid = $permission_data['gid'];
|
Zeile 611 | Zeile 611 |
---|
$forum = $db->fetch_array($query); $sperms = $permission_data;
|
$forum = $db->fetch_array($query); $sperms = $permission_data;
|
|
|
$sql = build_parent_list($fid); $query = $db->simple_select("forumpermissions", "*", "$sql AND gid='$gid'"); $customperms = $db->fetch_array($query); if($permission_data['pid'])
|
$sql = build_parent_list($fid); $query = $db->simple_select("forumpermissions", "*", "$sql AND gid='$gid'"); $customperms = $db->fetch_array($query); if($permission_data['pid'])
|
{
| {
|
$permission_data['usecustom'] = 1; echo $form->generate_hidden_field("pid", $pid);
|
$permission_data['usecustom'] = 1; echo $form->generate_hidden_field("pid", $pid);
|
}
| }
|
else { echo $form->generate_hidden_field("fid", $fid); echo $form->generate_hidden_field("gid", $gid); if(!$customperms['pid'])
|
else { echo $form->generate_hidden_field("fid", $fid); echo $form->generate_hidden_field("gid", $gid); if(!$customperms['pid'])
|
{
| {
|
$permission_data = usergroup_permissions($gid); } else
| $permission_data = usergroup_permissions($gid); } else
|
Zeile 641 | Zeile 641 |
---|
'canview' => 'viewing', 'canonlyviewownthreads' => 'viewing', 'candlattachments' => 'viewing',
|
'canview' => 'viewing', 'canonlyviewownthreads' => 'viewing', 'candlattachments' => 'viewing',
|
|
|
'canpostthreads' => 'posting_rating', 'canpostreplys' => 'posting_rating', 'canpostattachments' => 'posting_rating', 'canratethreads' => 'posting_rating',
|
'canpostthreads' => 'posting_rating', 'canpostreplys' => 'posting_rating', 'canpostattachments' => 'posting_rating', 'canratethreads' => 'posting_rating',
|
|
|
'caneditposts' => 'editing', 'candeleteposts' => 'editing', 'candeletethreads' => 'editing',
| 'caneditposts' => 'editing', 'candeleteposts' => 'editing', 'candeletethreads' => 'editing',
|
Zeile 657 | Zeile 657 |
---|
'cansearch' => 'misc', );
|
'cansearch' => 'misc', );
|
$plugins->run_hooks_by_ref("admin_forum_management_permission_groups", $groups);
| $groups = $plugins->run_hooks("admin_forum_management_permission_groups", $groups);
|
$tabs = array(); foreach(array_unique(array_values($groups)) as $group) { $lang_group = "group_".$group; $tabs[$group] = $lang->$lang_group;
|
$tabs = array(); foreach(array_unique(array_values($groups)) as $group) { $lang_group = "group_".$group; $tabs[$group] = $lang->$lang_group;
|
}
| }
|
if($mybb->input['ajax'] == 1) { $page->output_tab_control($tabs, false, "tabs2");
|
if($mybb->input['ajax'] == 1) { $page->output_tab_control($tabs, false, "tabs2");
|
}
| }
|
else { $page->output_tab_control($tabs);
| else { $page->output_tab_control($tabs);
|
Zeile 678 | Zeile 678 |
---|
$field_list = array(); $fields_array = $db->show_fields_from("forumpermissions"); foreach($fields_array as $field)
|
$field_list = array(); $fields_array = $db->show_fields_from("forumpermissions"); foreach($fields_array as $field)
|
{
| {
|
if(strpos($field['Field'], 'can') !== false) { if(array_key_exists($field['Field'], $groups))
|
if(strpos($field['Field'], 'can') !== false) { if(array_key_exists($field['Field'], $groups))
|
{
| {
|
$field_list[$groups[$field['Field']]][] = $field['Field']; } else { $field_list['misc'][] = $field['Field']; }
|
$field_list[$groups[$field['Field']]][] = $field['Field']; } else { $field_list['misc'][] = $field['Field']; }
|
} }
| } }
|
foreach(array_unique(array_values($groups)) as $group) { $lang_group = "group_".$group;
| foreach(array_unique(array_values($groups)) as $group) { $lang_group = "group_".$group;
|
Zeile 713 | Zeile 713 |
---|
echo "</div><div class=\"ModalButtonRow\">"; $buttons[] = $form->generate_submit_button($lang->cancel, array('id' => 'modalCancel')); $buttons[] = $form->generate_submit_button($lang->save_permissions, array('id' => 'modalSubmit'));
|
echo "</div><div class=\"ModalButtonRow\">"; $buttons[] = $form->generate_submit_button($lang->cancel, array('id' => 'modalCancel')); $buttons[] = $form->generate_submit_button($lang->save_permissions, array('id' => 'modalSubmit'));
|
$form->output_submit_wrapper($buttons); echo "</div>"; $form->end();
| $form->output_submit_wrapper($buttons); echo "</div>"; $form->end();
|
echo "</div>"; } else
| echo "</div>"; } else
|
Zeile 863 | Zeile 863 |
---|
{ $page->output_inline_error($errors); $forum_data = $mybb->input;
|
{ $page->output_inline_error($errors); $forum_data = $mybb->input;
|
}
| }
|
else { $forum_data['type'] = "f";
| else { $forum_data['type'] = "f";
|
Zeile 929 | Zeile 929 |
---|
}
$form_container = new FormContainer($lang->add_forum);
|
}
$form_container = new FormContainer($lang->add_forum);
|
$form_container->output_row($lang->create_a, $lang->create_a_desc, $form->generate_radio_button('type', 'f', $lang->forum, $create_a_options_f)."<br />\n".$form->generate_radio_button('type', 'c', $lang->category, $create_a_options_c));
| $form_container->output_row($lang->forum_type, $lang->forum_type_desc, $form->generate_radio_button('type', 'f', $lang->forum, $create_a_options_f)."<br />\n".$form->generate_radio_button('type', 'c', $lang->category, $create_a_options_c));
|
$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $forum_data['title'], array('id' => 'title')), 'title'); $form_container->output_row($lang->description, "", $form->generate_text_area('description', $forum_data['description'], array('id' => 'description')), 'description'); $form_container->output_row($lang->parent_forum." <em>*</em>", $lang->parent_forum_desc, $form->generate_forum_select('pid', $forum_data['pid'], array('id' => 'pid', 'main_option' => $lang->none)), 'pid');
| $form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $forum_data['title'], array('id' => 'title')), 'title'); $form_container->output_row($lang->description, "", $form->generate_text_area('description', $forum_data['description'], array('id' => 'description')), 'description'); $form_container->output_row($lang->parent_forum." <em>*</em>", $lang->parent_forum_desc, $form->generate_forum_select('pid', $forum_data['pid'], array('id' => 'pid', 'main_option' => $lang->none)), 'pid');
|
Zeile 939 | Zeile 939 |
---|
echo "<div id=\"additional_options_link\"><strong><a href=\"#\" onclick=\"$('additional_options_link').toggle(); $('additional_options').toggle(); return false;\">{$lang->show_additional_options}</a></strong><br /><br /></div>"; echo "<div id=\"additional_options\" style=\"display: none;\">"; $form_container = new FormContainer("<div class=\"float_right\" style=\"font-weight: normal;\"><a href=\"#\" onclick=\"$('additional_options_link').toggle(); $('additional_options').toggle(); return false;\">{$lang->hide_additional_options}</a></div>".$lang->additional_forum_options);
|
echo "<div id=\"additional_options_link\"><strong><a href=\"#\" onclick=\"$('additional_options_link').toggle(); $('additional_options').toggle(); return false;\">{$lang->show_additional_options}</a></strong><br /><br /></div>"; echo "<div id=\"additional_options\" style=\"display: none;\">"; $form_container = new FormContainer("<div class=\"float_right\" style=\"font-weight: normal;\"><a href=\"#\" onclick=\"$('additional_options_link').toggle(); $('additional_options').toggle(); return false;\">{$lang->hide_additional_options}</a></div>".$lang->additional_forum_options);
|
$form_container->output_row($lang->forum_link, $lang->forum_link_desc, $form->generate_text_box('linkto', $forum_data['linkto'], array('id' => 'linkto')), 'linkto'); $form_container->output_row($lang->forum_password, $lang->forum_password_desc, $form->generate_text_box('password', $forum_data['password'], array('id' => 'password')), 'password'); $access_options = array( $form->generate_check_box('active', 1, $lang->forum_is_active."<br />\n<small>{$lang->forum_is_active_desc}</small>", array('checked' => $forum_data['active'], 'id' => 'active')), $form->generate_check_box('open', 1, $lang->forum_is_open."<br />\n<small>{$lang->forum_is_open_desc}</small>", array('checked' => $forum_data['open'], 'id' => 'open')) ); $form_container->output_row($lang->access_options, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $access_options)."</div>");
| $form_container->output_row($lang->forum_link, $lang->forum_link_desc, $form->generate_text_box('linkto', $forum_data['linkto'], array('id' => 'linkto')), 'linkto'); $form_container->output_row($lang->forum_password, $lang->forum_password_desc, $form->generate_text_box('password', $forum_data['password'], array('id' => 'password')), 'password'); $access_options = array( $form->generate_check_box('active', 1, $lang->forum_is_active."<br />\n<small>{$lang->forum_is_active_desc}</small>", array('checked' => $forum_data['active'], 'id' => 'active')), $form->generate_check_box('open', 1, $lang->forum_is_open."<br />\n<small>{$lang->forum_is_open_desc}</small>", array('checked' => $forum_data['open'], 'id' => 'open')) ); $form_container->output_row($lang->access_options, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $access_options)."</div>");
|
$moderator_options = array( $form->generate_check_box('modposts', 1, $lang->mod_new_posts, array('checked' => $forum_data['modposts'], 'id' => 'modposts')), $form->generate_check_box('modthreads', 1, $lang->mod_new_threads, array('checked' => $forum_data['modthreads'], 'id' => 'modthreads')), $form->generate_check_box('modattachments', 1, $lang->mod_new_attachments, array('checked' => $forum_data['modattachments'], 'id' => 'modattachments')), $form->generate_check_box('mod_edit_posts', 1, $lang->mod_after_edit, array('checked' => $forum_data['mod_edit_posts'], 'id' => 'mod_edit_posts'))
|
$moderator_options = array( $form->generate_check_box('modposts', 1, $lang->mod_new_posts, array('checked' => $forum_data['modposts'], 'id' => 'modposts')), $form->generate_check_box('modthreads', 1, $lang->mod_new_threads, array('checked' => $forum_data['modthreads'], 'id' => 'modthreads')), $form->generate_check_box('modattachments', 1, $lang->mod_new_attachments, array('checked' => $forum_data['modattachments'], 'id' => 'modattachments')), $form->generate_check_box('mod_edit_posts', 1, $lang->mod_after_edit, array('checked' => $forum_data['mod_edit_posts'], 'id' => 'mod_edit_posts'))
|
);
| );
|
$form_container->output_row($lang->moderation_options, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $moderator_options)."</div>"); $styles = array(
| $form_container->output_row($lang->moderation_options, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $moderator_options)."</div>"); $styles = array(
|
Zeile 965 | Zeile 965 |
---|
$query = $db->simple_select("themes", "tid,name", "name!='((master))' AND name!='((master-backup))'", array('order_by' => 'name')); while($style = $db->fetch_array($query)) {
|
$query = $db->simple_select("themes", "tid,name", "name!='((master))' AND name!='((master-backup))'", array('order_by' => 'name')); while($style = $db->fetch_array($query)) {
|
$styles[$style['tid']] = $style['name'];
| $styles[$style['tid']] = htmlspecialchars_uni($style['name']);
|
} $style_options = array(
| } $style_options = array(
|
Zeile 978 | Zeile 978 |
---|
$display_methods = array( '0' => $lang->dont_display_rules, '1' => $lang->display_rules_inline,
|
$display_methods = array( '0' => $lang->dont_display_rules, '1' => $lang->display_rules_inline,
|
| '3' => $lang->display_rules_inline_new,
|
'2' => $lang->display_rules_link );
| '2' => $lang->display_rules_link );
|
Zeile 1043 | Zeile 1044 |
---|
$form_container->end(); echo "</div>";
|
$form_container->end(); echo "</div>";
|
$query = $db->simple_select("usergroups", "*", "", array("order_dir" => "name"));
| $query = $db->simple_select("usergroups", "*", "", array("order" => "name"));
|
while($usergroup = $db->fetch_array($query)) { $usergroups[$usergroup['gid']] = $usergroup;
| while($usergroup = $db->fetch_array($query)) { $usergroups[$usergroup['gid']] = $usergroup;
|
Zeile 1086 | Zeile 1087 |
---|
foreach($input_permissions as $input_permission) { $mybb->input['permissions'][$usergroup['gid']][$input_permission] = 1;
|
foreach($input_permissions as $input_permission) { $mybb->input['permissions'][$usergroup['gid']][$input_permission] = 1;
|
} } } }
| } } } }
|
foreach($usergroups as $usergroup) { $perms = array();
|
foreach($usergroups as $usergroup) { $perms = array();
|
if($mybb->input['default_permissions'][$usergroup['gid']])
| if(isset($mybb->input['default_permissions']) && $mybb->input['default_permissions'][$usergroup['gid']])
|
{ if(is_array($existing_permissions) && $existing_permissions[$usergroup['gid']]) {
| { if(is_array($existing_permissions) && $existing_permissions[$usergroup['gid']]) {
|
Zeile 1104 | Zeile 1105 |
---|
elseif(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['fid']][$usergroup['gid']]) { $perms = $cached_forum_perms[$forum_data['fid']][$usergroup['gid']];
|
elseif(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['fid']][$usergroup['gid']]) { $perms = $cached_forum_perms[$forum_data['fid']][$usergroup['gid']];
|
$default_checked = true; }
| $default_checked = true; }
|
else if(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['pid']][$usergroup['gid']]) { $perms = $cached_forum_perms[$forum_data['pid']][$usergroup['gid']];
| else if(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['pid']][$usergroup['gid']]) { $perms = $cached_forum_perms[$forum_data['pid']][$usergroup['gid']];
|
Zeile 1126 | Zeile 1127 |
---|
if($mybb->input['default_permissions'][$usergroup['gid']]) { $default_checked = true;
|
if($mybb->input['default_permissions'][$usergroup['gid']]) { $default_checked = true;
|
} else {
| } else {
|
$default_checked = false; } if($mybb->input['permissions'][$usergroup['gid']][$forum_permission])
|
$default_checked = false; } if($mybb->input['permissions'][$usergroup['gid']][$forum_permission])
|
{ $perms_checked[$forum_permission] = 1; } else { $perms_checked[$forum_permission] = 0;
| { $perms_checked[$forum_permission] = 1; } else { $perms_checked[$forum_permission] = 0;
|
} } else
| } } else
|
Zeile 1152 | Zeile 1153 |
---|
$perms_checked[$forum_permission] = 0; } }
|
$perms_checked[$forum_permission] = 0; } }
|
}
| }
|
$usergroup['title'] = htmlspecialchars_uni($usergroup['title']); if($default_checked)
| $usergroup['title'] = htmlspecialchars_uni($usergroup['title']); if($default_checked)
|
Zeile 1164 | Zeile 1165 |
---|
$inherited_text = $lang->custom_permission; }
|
$inherited_text = $lang->custom_permission; }
|
$form_container->output_cell("<strong>{$usergroup['title']}</strong><br />".$form->generate_check_box("default_permissions[{$usergroup['gid']}]", 1, "", array("id" => "default_permissions_{$usergroup['gid']}", "checked" => $default_checked, "onclick" => $default_click))." <small><label for=\"default_permissions_{$usergroup['gid']}\">{$lang->permissions_use_group_default}</label></small>");
| $form_container->output_cell("<strong>{$usergroup['title']}</strong><br />".$form->generate_check_box("default_permissions[{$usergroup['gid']}]", 1, "", array("id" => "default_permissions_{$usergroup['gid']}", "checked" => $default_checked))." <small><label for=\"default_permissions_{$usergroup['gid']}\">{$lang->permissions_use_group_default}</label></small>");
|
$field_select = "<div class=\"quick_perm_fields\">\n";
|
$field_select = "<div class=\"quick_perm_fields\">\n";
|
$field_select .= "<div class=\"enabled\"><div class=\"fields_title\">{$lang->enabled}</div><ul id=\"fields_enabled_{$usergroup['gid']}\">\n"; foreach($perms_checked as $perm => $value)
| $field_select .= "<div class=\"enabled\"><ul id=\"fields_enabled_{$usergroup['gid']}\">\n"; foreach($perms_checked as $perm => $value)
|
{ if($value == 1) {
| { if($value == 1) {
|
Zeile 1176 | Zeile 1177 |
---|
} } $field_select .= "</ul></div>\n";
|
} } $field_select .= "</ul></div>\n";
|
$field_select .= "<div class=\"disabled\"><div class=\"fields_title\">{$lang->disabled}</div><ul id=\"fields_disabled_{$usergroup['gid']}\">\n";
| $field_select .= "<div class=\"disabled\"><ul id=\"fields_disabled_{$usergroup['gid']}\">\n";
|
foreach($perms_checked as $perm => $value) { if($value == 0)
| foreach($perms_checked as $perm => $value) { if($value == 0)
|
Zeile 1244 | Zeile 1245 |
---|
if(!$forum_data) { flash_message($lang->error_invalid_fid, 'error');
|
if(!$forum_data) { flash_message($lang->error_invalid_fid, 'error');
|
admin_redirect("index.php?module=forum-management"); } $fid = intval($mybb->input['fid']);
| admin_redirect("index.php?module=forum-management"); } $fid = intval($mybb->input['fid']);
|
if($mybb->request_method == "post") { if(!trim($mybb->input['title']))
| if($mybb->request_method == "post") { if(!trim($mybb->input['title']))
|
Zeile 1263 | Zeile 1264 |
---|
$errors[] = $lang->error_forum_parent_itself; } else
|
$errors[] = $lang->error_forum_parent_itself; } else
|
{
| {
|
$query = $db->simple_select("forums", "*", "pid='{$mybb->input['fid']}'"); while($child = $db->fetch_array($query)) {
| $query = $db->simple_select("forums", "*", "pid='{$mybb->input['fid']}'"); while($child = $db->fetch_array($query)) {
|
Zeile 1285 | Zeile 1286 |
---|
if($type == 'c' && $forum_data['type'] == 'f') { $query = $db->simple_select('threads', 'COUNT(tid) as num_threads', "fid = '{$fid}'");
|
if($type == 'c' && $forum_data['type'] == 'f') { $query = $db->simple_select('threads', 'COUNT(tid) as num_threads', "fid = '{$fid}'");
|
if($db->fetch_field($query, "num_threads") > 0) {
| if($db->fetch_field($query, "num_threads") > 0) {
|
$errors[] = $lang->error_not_empty; } }
|
$errors[] = $lang->error_not_empty; } }
|
| if(!empty($mybb->input['linkto']) && empty($forum_data['linkto'])) { $query = $db->simple_select('threads', 'COUNT(tid) as num_threads', "fid = '{$fid}'", array("limit" => 1)); if($db->fetch_field($query, "num_threads") > 0) { $errors[] = $lang->error_forum_link_not_empty; } }
|
if(!$errors) {
| if(!$errors) {
|
Zeile 1333 | Zeile 1344 |
---|
if($pid != $forum_data['pid']) { // Update the parentlist of this forum.
|
if($pid != $forum_data['pid']) { // Update the parentlist of this forum.
|
$db->update_query("forums", array("parentlist" => make_parent_list($fid)), "fid='{$fid}'", 1);
| $db->update_query("forums", array("parentlist" => make_parent_list($fid)), "fid='{$fid}'");
|
// Rebuild the parentlist of all of the subforums of this forum switch($db->type)
| // Rebuild the parentlist of all of the subforums of this forum switch($db->type)
|
Zeile 1348 | Zeile 1359 |
---|
while($child = $db->fetch_array($query)) {
|
while($child = $db->fetch_array($query)) {
|
$db->update_query("forums", array("parentlist" => make_parent_list($child['fid'])), "fid='{$child['fid']}'", 1);
| $db->update_query("forums", array("parentlist" => make_parent_list($child['fid'])), "fid='{$child['fid']}'");
|
} }
| } }
|
Zeile 1358 | Zeile 1369 |
---|
{ // Make sure we're only skipping inputs that don't start with "fields_" and aren't fields_default_ or fields_inherit_ if(strpos($id, 'fields_') === false || (strpos($id, 'fields_default_') !== false || strpos($id, 'fields_inherit_') !== false))
|
{ // Make sure we're only skipping inputs that don't start with "fields_" and aren't fields_default_ or fields_inherit_ if(strpos($id, 'fields_') === false || (strpos($id, 'fields_default_') !== false || strpos($id, 'fields_inherit_') !== false))
|
{ continue; } list(, $gid) = explode('fields_', $id);
| { continue; } list(, $gid) = explode('fields_', $id);
|
if($mybb->input['fields_default_'.$gid] == $permission && $mybb->input['fields_inherit_'.$gid] == 1) { $inherit[$gid] = 1;
| if($mybb->input['fields_default_'.$gid] == $permission && $mybb->input['fields_inherit_'.$gid] == 1) { $inherit[$gid] = 1;
|
Zeile 1411 | Zeile 1422 |
---|
log_admin_action($fid, $mybb->input['title']); flash_message($lang->success_forum_updated, 'success');
|
log_admin_action($fid, $mybb->input['title']); flash_message($lang->success_forum_updated, 'success');
|
admin_redirect("index.php?module=forum-management");
| admin_redirect("index.php?module=forum-management&fid={$fid}");
|
} }
| } }
|
Zeile 1432 | Zeile 1443 |
---|
{ $page->output_inline_error($errors); $forum_data = $mybb->input;
|
{ $page->output_inline_error($errors); $forum_data = $mybb->input;
|
}
| }
|
else { $forum_data['title'] = $forum_data['name']; }
|
else { $forum_data['title'] = $forum_data['name']; }
|
$query = $db->simple_select("usergroups", "*", "", array("order_dir" => "name"));
| $query = $db->simple_select("usergroups", "*", "", array("order" => "name"));
|
while($usergroup = $db->fetch_array($query))
|
while($usergroup = $db->fetch_array($query))
|
{
| {
|
$usergroups[$usergroup['gid']] = $usergroup; }
| $usergroups[$usergroup['gid']] = $usergroup; }
|
Zeile 1473 | Zeile 1484 |
---|
}
$form_container = new FormContainer($lang->edit_forum);
|
}
$form_container = new FormContainer($lang->edit_forum);
|
$form_container->output_row($lang->create_a, $lang->create_a_desc, $form->generate_radio_button('type', 'f', $lang->forum, $create_a_options_f)."<br />\n".$form->generate_radio_button('type', 'c', $lang->category, $create_a_options_c));
| $form_container->output_row($lang->forum_type, $lang->forum_type_desc, $form->generate_radio_button('type', 'f', $lang->forum, $create_a_options_f)."<br />\n".$form->generate_radio_button('type', 'c', $lang->category, $create_a_options_c));
|
$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $forum_data['title'], array('id' => 'title')), 'title'); $form_container->output_row($lang->description, "", $form->generate_text_area('description', $forum_data['description'], array('id' => 'description')), 'description'); $form_container->output_row($lang->parent_forum." <em>*</em>", $lang->parent_forum_desc, $form->generate_forum_select('pid', $forum_data['pid'], array('id' => 'pid', 'main_option' => $lang->none)), 'pid');
| $form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $forum_data['title'], array('id' => 'title')), 'title'); $form_container->output_row($lang->description, "", $form->generate_text_area('description', $forum_data['description'], array('id' => 'description')), 'description'); $form_container->output_row($lang->parent_forum." <em>*</em>", $lang->parent_forum_desc, $form->generate_forum_select('pid', $forum_data['pid'], array('id' => 'pid', 'main_option' => $lang->none)), 'pid');
|
Zeile 1513 | Zeile 1524 |
---|
$style_options = array( $form->generate_check_box('overridestyle', 1, $lang->override_user_style, array('checked' => $forum_data['overridestyle'], 'id' => 'overridestyle')), $lang->forum_specific_style."<br />\n".$form->generate_select_box('style', $styles, $forum_data['style'], array('id' => 'style'))
|
$style_options = array( $form->generate_check_box('overridestyle', 1, $lang->override_user_style, array('checked' => $forum_data['overridestyle'], 'id' => 'overridestyle')), $lang->forum_specific_style."<br />\n".$form->generate_select_box('style', $styles, $forum_data['style'], array('id' => 'style'))
|
); $form_container->output_row($lang->style_options, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $style_options)."</div>");
| ); $form_container->output_row($lang->style_options, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $style_options)."</div>");
|
$display_methods = array( '0' => $lang->dont_display_rules, '1' => $lang->display_rules_inline,
|
$display_methods = array( '0' => $lang->dont_display_rules, '1' => $lang->display_rules_inline,
|
| '3' => $lang->display_rules_inline_new,
|
'2' => $lang->display_rules_link
|
'2' => $lang->display_rules_link
|
);
| );
|
$forum_rules = array( $lang->display_method."<br />\n".$form->generate_select_box('rulestype', $display_methods, $forum_data['rulestype'], array('checked' => $forum_data['rulestype'], 'id' => 'rulestype')),
| $forum_rules = array( $lang->display_method."<br />\n".$form->generate_select_box('rulestype', $display_methods, $forum_data['rulestype'], array('checked' => $forum_data['rulestype'], 'id' => 'rulestype')),
|
Zeile 1553 | Zeile 1565 |
---|
"rating" => $lang->sort_by_rating, "replies" => $lang->sort_by_replies, "views" => $lang->sort_by_views,
|
"rating" => $lang->sort_by_rating, "replies" => $lang->sort_by_replies, "views" => $lang->sort_by_views,
|
);
| );
|
$default_sort_order = array( "" => $lang->board_default,
| $default_sort_order = array( "" => $lang->board_default,
|
Zeile 1579 | Zeile 1591 |
---|
$form->generate_check_box('allowtratings', 1, $lang->allow_thread_ratings, array('checked' => $forum_data['allowtratings'], 'id' => 'allowtratings')), $form->generate_check_box('showinjump', 1, $lang->show_forum_jump, array('checked' => $forum_data['showinjump'], 'id' => 'showinjump')), $form->generate_check_box('usepostcounts', 1, $lang->use_postcounts, array('checked' => $forum_data['usepostcounts'], 'id' => 'usepostcounts'))
|
$form->generate_check_box('allowtratings', 1, $lang->allow_thread_ratings, array('checked' => $forum_data['allowtratings'], 'id' => 'allowtratings')), $form->generate_check_box('showinjump', 1, $lang->show_forum_jump, array('checked' => $forum_data['showinjump'], 'id' => 'showinjump')), $form->generate_check_box('usepostcounts', 1, $lang->use_postcounts, array('checked' => $forum_data['usepostcounts'], 'id' => 'usepostcounts'))
|
);
| );
|
$form_container->output_row($lang->misc_options, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $misc_options)."</div>"); $form_container->end();
| $form_container->output_row($lang->misc_options, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $misc_options)."</div>"); $form_container->end();
|
Zeile 1590 | Zeile 1602 |
---|
'canpostthreads' => $lang->permissions_canpostthreads, 'canpostreplys' => $lang->permissions_canpostreplys, 'canpostpolls' => $lang->permissions_canpostpolls,
|
'canpostthreads' => $lang->permissions_canpostthreads, 'canpostreplys' => $lang->permissions_canpostreplys, 'canpostpolls' => $lang->permissions_canpostpolls,
|
);
| );
|
$field_list2 = array( 'canview' => $lang->perm_drag_canview,
| $field_list2 = array( 'canview' => $lang->perm_drag_canview,
|
Zeile 1663 | Zeile 1675 |
---|
{ $perms = $existing_permissions[$usergroup['gid']]; $default_checked = false;
|
{ $perms = $existing_permissions[$usergroup['gid']]; $default_checked = false;
|
} elseif(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['fid']][$usergroup['gid']])
| } elseif(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['fid']][$usergroup['gid']])
|
{ $perms = $cached_forum_perms[$forum_data['fid']][$usergroup['gid']]; $default_checked = true;
| { $perms = $cached_forum_perms[$forum_data['fid']][$usergroup['gid']]; $default_checked = true;
|
Zeile 1842 | Zeile 1854 |
---|
$mod = $db->fetch_array($query); $db->delete_query("moderators", "mid='{$mid}'");
|
$mod = $db->fetch_array($query); $db->delete_query("moderators", "mid='{$mid}'");
|
$query = $db->simple_select("moderators", "*", "id='{$mod['id']}' AND isgroup='0'"); if($db->num_rows($query) == 0) { $updatequery = array( "usergroup" => "2" ); $db->update_query("users", $updatequery, "uid='{$mod['id']}' AND usergroup != '4' AND usergroup != '3'"); }
| |
$cache->update_moderators();
|
$cache->update_moderators();
|
|
|
$plugins->run_hooks("admin_forum_management_deletemod_commit");
|
$plugins->run_hooks("admin_forum_management_deletemod_commit");
|
|
|
$forum = get_forum($fid); // Log admin action if ($isgroup)
|
$forum = get_forum($fid); // Log admin action if ($isgroup)
|
{ log_admin_action($mod['id'], $mod['title'], $forum['fid'], $forum['name']); }
| { log_admin_action($mid, $mod['title'], $forum['fid'], $forum['name']); }
|
else {
|
else {
|
log_admin_action($mod['id'], $mod['username'], $forum['fid'], $forum['name']);
| log_admin_action($mid, $mod['username'], $forum['fid'], $forum['name']);
|
} flash_message($lang->success_moderator_deleted, 'success');
| } flash_message($lang->success_moderator_deleted, 'success');
|
Zeile 1899 | Zeile 1903 |
---|
{ $fid = intval($mybb->input['fid']); $forum_info = get_forum($fid);
|
{ $fid = intval($mybb->input['fid']); $forum_info = get_forum($fid);
|
|
|
$query = $db->simple_select("forums", "posts,unapprovedposts,threads,unapprovedthreads", "fid='{$fid}'"); $stats = $db->fetch_array($query);
|
$query = $db->simple_select("forums", "posts,unapprovedposts,threads,unapprovedthreads", "fid='{$fid}'"); $stats = $db->fetch_array($query);
|
|
|
// Delete the forum $db->delete_query("forums", "fid='$fid'");
|
// Delete the forum $db->delete_query("forums", "fid='$fid'");
|
|
|
switch($db->type) { case "pgsql":
| switch($db->type) { case "pgsql":
|
Zeile 1924 | Zeile 1928 |
---|
$stats['unapprovedposts'] += $forum['unapprovedposts']; $stats['threads'] += $forum['threads']; $stats['unapprovedthreads'] += $forum['unapprovedthreads'];
|
$stats['unapprovedposts'] += $forum['unapprovedposts']; $stats['threads'] += $forum['threads']; $stats['unapprovedthreads'] += $forum['unapprovedthreads'];
|
}
/** * This slab of code pulls out the moderators for this forum, * checks if they moderate any other forums, and if they don't * it moves them back to the registered usergroup */
$query = $db->simple_select("moderators", "*", "fid='$fid' AND isgroup='0'"); while($mod = $db->fetch_array($query)) { $moderators[$mod['id']] = $mod['id']; } if(is_array($moderators)) { $mod_list = implode(",", $moderators); $query = $db->simple_select("moderators", "*", "fid != '$fid' AND id IN ($mod_list) AND isgroup='0'"); while($mod = $db->fetch_array($query)) { unset($moderators[$mod['id']]); } } if(is_array($moderators)) { $mod_list = implode(",", $moderators); if($mod_list) { $updatequery = array( "usergroup" => "2" ); $db->update_query("users", $updatequery, "uid IN ($mod_list) AND usergroup='6'"); }
| |
} switch($db->type)
| } switch($db->type)
|
Zeile 2004 | Zeile 1974 |
---|
if(!$mybb->input['action']) { $plugins->run_hooks("admin_forum_management_start");
|
if(!$mybb->input['action']) { $plugins->run_hooks("admin_forum_management_start");
|
| if(!isset($mybb->input['fid'])) { $mybb->input['fid'] = 0; }
|
$fid = intval($mybb->input['fid']);
|
$fid = intval($mybb->input['fid']);
|
| if($fid) { $forum = get_forum($fid); }
|
if($mybb->request_method == "post") {
|
if($mybb->request_method == "post") {
|
if($fid) { $forum = get_forum($fid); }
| |
if($mybb->input['update'] == "permissions") { $inherit = array();
| if($mybb->input['update'] == "permissions") { $inherit = array();
|
Zeile 2074 | Zeile 2051 |
---|
} elseif($mybb->input['add'] == "moderators") {
|
} elseif($mybb->input['add'] == "moderators") {
|
| |
$forum = get_forum($fid); if(!$forum)
|
$forum = get_forum($fid); if(!$forum)
|
{
| {
|
flash_message($lang->error_invalid_forum, 'error'); admin_redirect("index.php?module=forum-management&fid={$fid}#tab_moderators");
|
flash_message($lang->error_invalid_forum, 'error'); admin_redirect("index.php?module=forum-management&fid={$fid}#tab_moderators");
|
} if (!empty($mybb->input['usergroup'])) { $query = $db->simple_select("usergroups", "gid AS id, title AS name", "title='".$db->escape_string($mybb->input['usergroup'])."'", array('limit' => 1));
| } if(!empty($mybb->input['usergroup'])) {
|
$isgroup = 1;
|
$isgroup = 1;
|
| $gid = intval($mybb->input['usergroup']);
if(!$groupscache[$gid]) { // Didn't select a valid moderator flash_message($lang->error_moderator_not_found, 'error'); admin_redirect("index.php?module=forum-management&fid={$fid}#tab_moderators"); }
$newmod = array( "id" => $gid, "name" => $groupscache[$gid]['title'] );
|
} else { $query = $db->simple_select("users", "uid AS id, username AS name", "username='".$db->escape_string($mybb->input['username'])."'", array('limit' => 1));
|
} else { $query = $db->simple_select("users", "uid AS id, username AS name", "username='".$db->escape_string($mybb->input['username'])."'", array('limit' => 1));
|
| if(!$db->num_rows($query)) { flash_message($lang->error_moderator_not_found, 'error'); admin_redirect("index.php?module=forum-management&fid={$fid}#tab_moderators"); }
|
$isgroup = 0;
|
$isgroup = 0;
|
| $newmod = $db->fetch_array($query);
|
}
|
}
|
$newmod = $db->fetch_array($query);
|
|
if($newmod['id']) { $query = $db->simple_select("moderators", "id", "id='".$newmod['id']."' AND fid='".$fid."' AND isgroup='{$isgroup}'", array('limit' => 1));
|
if($newmod['id']) { $query = $db->simple_select("moderators", "id", "id='".$newmod['id']."' AND fid='".$fid."' AND isgroup='{$isgroup}'", array('limit' => 1));
|
$mod = $db->fetch_array($query); if(!$mod['id'])
| if(!$db->num_rows($query))
|
{ $new_mod = array( "fid" => $fid,
| { $new_mod = array( "fid" => $fid,
|
Zeile 2107 | Zeile 2103 |
---|
"canviewips" => 1, "canopenclosethreads" => 1, "canmanagethreads" => 1,
|
"canviewips" => 1, "canopenclosethreads" => 1, "canmanagethreads" => 1,
|
"canmovetononmodforum" => 1
| "canmovetononmodforum" => 1, "canusecustomtools" => 1
|
);
|
);
|
|
|
$mid = $db->insert_query("moderators", $new_mod); if(!$isgroup) { $db->update_query("users", array('usergroup' => 6), "uid='{$newmod['id']}' AND usergroup='2'"); }
|
$mid = $db->insert_query("moderators", $new_mod); if(!$isgroup) { $db->update_query("users", array('usergroup' => 6), "uid='{$newmod['id']}' AND usergroup='2'"); }
|
|
|
$cache->update_moderators();
|
$cache->update_moderators();
|
| |
$plugins->run_hooks("admin_forum_management_start_moderators_commit"); // Log admin action
|
$plugins->run_hooks("admin_forum_management_start_moderators_commit"); // Log admin action
|
log_admin_action('addmod', $new_mod['fid'], $newmod['name'], $fid, $forum['name']);
| log_admin_action('addmod', $mid, $newmod['name'], $fid, $forum['name']);
|
flash_message($lang->success_moderator_added, 'success'); admin_redirect("index.php?module=forum-management&action=editmod&mid={$mid}");
| flash_message($lang->success_moderator_added, 'success'); admin_redirect("index.php?module=forum-management&action=editmod&mid={$mid}");
|
Zeile 2189 | Zeile 2187 |
---|
'subforums' => $lang->subforums, 'permissions' => $lang->forum_permissions, 'moderators' => $lang->moderators,
|
'subforums' => $lang->subforums, 'permissions' => $lang->forum_permissions, 'moderators' => $lang->moderators,
|
);
| );
|
$page->output_tab_control($tabs); echo "<div id=\"tab_subforums\">\n";
|
$page->output_tab_control($tabs); echo "<div id=\"tab_subforums\">\n";
|
if(!is_array($forum_cache))
| if(!isset($forum_cache) || !is_array($forum_cache))
|
{ cache_forums(); } $form_container = new FormContainer($lang->sprintf($lang->in_forums, $forum_cache[$fid]['name']));
|
{ cache_forums(); } $form_container = new FormContainer($lang->sprintf($lang->in_forums, $forum_cache[$fid]['name']));
|
}
| }
|
else { $form_container = new FormContainer($lang->manage_forums);
|
else { $form_container = new FormContainer($lang->manage_forums);
|
}
| }
|
$form_container->output_row_header($lang->forum); $form_container->output_row_header($lang->order, array("class" => "align_center", 'width' => '5%')); $form_container->output_row_header($lang->controls, array("class" => "align_center", 'style' => 'width: 200px'));
| $form_container->output_row_header($lang->forum); $form_container->output_row_header($lang->order, array("class" => "align_center", 'width' => '5%')); $form_container->output_row_header($lang->controls, array("class" => "align_center", 'style' => 'width: 200px'));
|
Zeile 2213 | Zeile 2211 |
---|
$submit_options = array(); if($form_container->num_rows() == 0)
|
$submit_options = array(); if($form_container->num_rows() == 0)
|
{
| {
|
$form_container->output_cell($lang->no_forums, array('colspan' => 3)); $form_container->construct_row(); $submit_options = array('disabled' => true);
| $form_container->output_cell($lang->no_forums, array('colspan' => 3)); $form_container->construct_row(); $submit_options = array('disabled' => true);
|
Zeile 2227 | Zeile 2225 |
---|
$form->output_submit_wrapper($buttons); if(!$fid)
|
$form->output_submit_wrapper($buttons); if(!$fid)
|
{ $form->end();
| { $form->end();
|
} if($fid)
| } if($fid)
|
Zeile 2236 | Zeile 2234 |
---|
echo "</div>\n"; $form->end();
|
echo "</div>\n"; $form->end();
|
$query = $db->simple_select("usergroups", "*", "", array("order_dir" => "name"));
| $query = $db->simple_select("usergroups", "*", "", array("order" => "name"));
|
while($usergroup = $db->fetch_array($query)) { $usergroups[$usergroup['gid']] = $usergroup;
| while($usergroup = $db->fetch_array($query)) { $usergroups[$usergroup['gid']] = $usergroup;
|
Zeile 2288 | Zeile 2286 |
---|
$perms = $existing_permissions[$usergroup['gid']]; $default_checked = false; }
|
$perms = $existing_permissions[$usergroup['gid']]; $default_checked = false; }
|
elseif(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['fid']][$usergroup['gid']])
| elseif(is_array($cached_forum_perms) && $cached_forum_perms[$forum['fid']][$usergroup['gid']])
|
{
|
{
|
$perms = $cached_forum_perms[$forum_data['fid']][$usergroup['gid']];
| $perms = $cached_forum_perms[$forum['fid']][$usergroup['gid']];
|
$default_checked = true;
|
$default_checked = true;
|
} else if(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['pid']][$usergroup['gid']]) { $perms = $cached_forum_perms[$forum_data['pid']][$usergroup['gid']]; $default_checked = true; } } if(!$perms) { $perms = $usergroup; $default_checked = true; } } else { if(is_array($existing_permissions) && $existing_permissions[$usergroup['gid']])
| } else if(is_array($cached_forum_perms) && $cached_forum_perms[$forum['pid']][$usergroup['gid']]) { $perms = $cached_forum_perms[$forum['pid']][$usergroup['gid']]; $default_checked = true; } } if(!$perms) { $perms = $usergroup; $default_checked = true; } } else { if(isset($existing_permissions) && is_array($existing_permissions) && $existing_permissions[$usergroup['gid']])
|
{ $perms = $existing_permissions[$usergroup['gid']]; $default_checked = false;
|
{ $perms = $existing_permissions[$usergroup['gid']]; $default_checked = false;
|
} elseif(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['fid']][$usergroup['gid']]) { $perms = $cached_forum_perms[$forum_data['fid']][$usergroup['gid']]; $default_checked = true; } else if(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['pid']][$usergroup['gid']])
| } elseif(is_array($cached_forum_perms) && isset($cached_forum_perms[$forum['fid']]) && $cached_forum_perms[$forum['fid']][$usergroup['gid']]) { $perms = $cached_forum_perms[$forum['fid']][$usergroup['gid']]; $default_checked = true; } else if(is_array($cached_forum_perms) && $cached_forum_perms[$forum['pid']][$usergroup['gid']])
|
{
|
{
|
$perms = $cached_forum_perms[$forum_data['pid']][$usergroup['gid']];
| $perms = $cached_forum_perms[$forum['pid']][$usergroup['gid']];
|
$default_checked = true; }
| $default_checked = true; }
|
Zeile 2331 | Zeile 2329 |
---|
} } foreach($field_list as $forum_permission => $forum_perm_title)
|
} } foreach($field_list as $forum_permission => $forum_perm_title)
|
{
| {
|
if(isset($mybb->input['permissions']))
|
if(isset($mybb->input['permissions']))
|
{
| {
|
if($mybb->input['permissions'][$usergroup['gid']][$forum_permission]) { $perms_checked[$forum_permission] = 1;
| if($mybb->input['permissions'][$usergroup['gid']][$forum_permission]) { $perms_checked[$forum_permission] = 1;
|
Zeile 2347 | Zeile 2345 |
---|
{ if($perms[$forum_permission] == 1) {
|
{ if($perms[$forum_permission] == 1) {
|
$perms_checked[$forum_permission] = 1;
| $perms_checked[$forum_permission] = 1;
|
} else {
| } else {
|
Zeile 2369 | Zeile 2367 |
---|
$form_container->output_cell("<strong>{$usergroup['title']}</strong> <small style=\"vertical-align: middle;\">({$inherited_text})</small>"); $field_select = "<div class=\"quick_perm_fields\">\n";
|
$form_container->output_cell("<strong>{$usergroup['title']}</strong> <small style=\"vertical-align: middle;\">({$inherited_text})</small>"); $field_select = "<div class=\"quick_perm_fields\">\n";
|
$field_select .= "<div class=\"enabled\"><div class=\"fields_title\">{$lang->enabled}</div><ul id=\"fields_enabled_{$usergroup['gid']}\">\n";
| $field_select .= "<div class=\"enabled\"><ul id=\"fields_enabled_{$usergroup['gid']}\">\n";
|
foreach($perms_checked as $perm => $value) { if($value == 1)
| foreach($perms_checked as $perm => $value) { if($value == 1)
|
Zeile 2378 | Zeile 2376 |
---|
} } $field_select .= "</ul></div>\n";
|
} } $field_select .= "</ul></div>\n";
|
$field_select .= "<div class=\"disabled\"><div class=\"fields_title\">{$lang->disabled}</div><ul id=\"fields_disabled_{$usergroup['gid']}\">\n";
| $field_select .= "<div class=\"disabled\"><ul id=\"fields_disabled_{$usergroup['gid']}\">\n";
|
foreach($perms_checked as $perm => $value) { if($value == 0)
| foreach($perms_checked as $perm => $value) { if($value == 0)
|
Zeile 2424 | Zeile 2422 |
---|
$form_container->construct_row(array('id' => 'row_'.$usergroup['gid'])); $ids[] = $usergroup['gid'];
|
$form_container->construct_row(array('id' => 'row_'.$usergroup['gid'])); $ids[] = $usergroup['gid'];
|
}
| }
|
$form_container->end(); $buttons = array();
| $form_container->end(); $buttons = array();
|
Zeile 2460 | Zeile 2458 |
---|
if($moderator['isgroup']) { $moderator['img'] = "<img src=\"styles/{$page->style}/images/icons/group.gif\" alt=\"{$lang->group}\" title=\"{$lang->group}\" />";
|
if($moderator['isgroup']) { $moderator['img'] = "<img src=\"styles/{$page->style}/images/icons/group.gif\" alt=\"{$lang->group}\" title=\"{$lang->group}\" />";
|
$form_container->output_cell("{$moderator['img']} <a href=\"index.php?module=user-groups&action=edit&gid={$moderator['id']}\">".htmlspecialchars_uni($moderator['title'])."</a>");
| $form_container->output_cell("{$moderator['img']} <a href=\"index.php?module=user-groups&action=edit&gid={$moderator['id']}\">".htmlspecialchars_uni($moderator['title'])." ({$lang->usergroup} {$moderator['id']})</a>");
|
$form_container->output_cell("<a href=\"index.php?module=forum-management&action=editmod&mid={$moderator['mid']}\">{$lang->edit}</a>", array("class" => "align_center")); $form_container->output_cell("<a href=\"index.php?module=forum-management&action=deletemod&id={$moderator['id']}&isgroup=1&fid={$fid}&my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_moderator_deletion}')\">{$lang->delete}</a>", array("class" => "align_center"));
|
$form_container->output_cell("<a href=\"index.php?module=forum-management&action=editmod&mid={$moderator['mid']}\">{$lang->edit}</a>", array("class" => "align_center")); $form_container->output_cell("<a href=\"index.php?module=forum-management&action=deletemod&id={$moderator['id']}&isgroup=1&fid={$fid}&my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_moderator_deletion}')\">{$lang->delete}</a>", array("class" => "align_center"));
|
}
| }
|
else { $moderator['img'] = "<img src=\"styles/{$page->style}/images/icons/user.gif\" alt=\"{$lang->user}\" title=\"{$lang->user}\" />";
| else { $moderator['img'] = "<img src=\"styles/{$page->style}/images/icons/user.gif\" alt=\"{$lang->user}\" title=\"{$lang->user}\" />";
|
Zeile 2471 | Zeile 2469 |
---|
$form_container->output_cell("<a href=\"index.php?module=forum-management&action=editmod&mid={$moderator['mid']}\">{$lang->edit}</a>", array("class" => "align_center")); $form_container->output_cell("<a href=\"index.php?module=forum-management&action=deletemod&id={$moderator['id']}&isgroup=0&fid={$fid}&my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_moderator_deletion}')\">{$lang->delete}</a>", array("class" => "align_center")); }
|
$form_container->output_cell("<a href=\"index.php?module=forum-management&action=editmod&mid={$moderator['mid']}\">{$lang->edit}</a>", array("class" => "align_center")); $form_container->output_cell("<a href=\"index.php?module=forum-management&action=deletemod&id={$moderator['id']}&isgroup=0&fid={$fid}&my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_moderator_deletion}')\">{$lang->delete}</a>", array("class" => "align_center")); }
|
$form_container->construct_row(); }
| $form_container->construct_row(); }
|
if($form_container->num_rows() == 0) { $form_container->output_cell($lang->no_moderators, array('colspan' => 3));
| if($form_container->num_rows() == 0) { $form_container->output_cell($lang->no_moderators, array('colspan' => 3));
|
Zeile 2486 | Zeile 2484 |
---|
$form = new Form("index.php?module=forum-management", "post", "management"); echo $form->generate_hidden_field("fid", $mybb->input['fid']); echo $form->generate_hidden_field("add", "moderators");
|
$form = new Form("index.php?module=forum-management", "post", "management"); echo $form->generate_hidden_field("fid", $mybb->input['fid']); echo $form->generate_hidden_field("add", "moderators");
|
| // Usergroup Moderator if(!is_array($usergroups)) { $usergroups = $groupscache; }
foreach($usergroups as $group) { $modgroups[$group['gid']] = $lang->usergroup." ".$group['gid'].": ".$group['title']; }
if(!isset($mybb->input['usergroup'])) { $mybb->input['usergroup'] = ''; }
if(!isset($mybb->input['username'])) { $mybb->input['username'] = ''; }
|
$form_container = new FormContainer($lang->add_usergroup_as_moderator);
|
$form_container = new FormContainer($lang->add_usergroup_as_moderator);
|
$form_container->output_row($lang->usergroup." <em>*</em>", $lang->moderator_usergroup_desc, $form->generate_text_box('usergroup', $mybb->input['usergroup'], array('id' => 'usergroup')), 'usergroup'); $form_container->end(); // Autocompletion for usergroups echo ' <script type="text/javascript" src="../jscripts/autocomplete.js?ver=1400"></script> <script type="text/javascript"> <!-- new autoComplete("usergroup", "../xmlhttp.php?action=get_usergroups", {valueSpan: "usergroup"}); // --> </script>';
| $form_container->output_row($lang->usergroup." <em>*</em>", $lang->moderator_usergroup_desc, $form->generate_select_box('usergroup', $modgroups, $mybb->input['usergroup'], array('id' => 'usergroup')), 'usergroup'); $form_container->end();
|
$buttons[] = $form->generate_submit_button($lang->add_usergroup_moderator); $form->output_submit_wrapper($buttons); $form->end();
| $buttons[] = $form->generate_submit_button($lang->add_usergroup_moderator); $form->output_submit_wrapper($buttons); $form->end();
|
Zeile 2510 | Zeile 2521 |
---|
$form_container = new FormContainer($lang->add_user_as_moderator); $form_container->output_row($lang->username." <em>*</em>", $lang->moderator_username_desc, $form->generate_text_box('username', $mybb->input['username'], array('id' => 'username')), 'username'); $form_container->end();
|
$form_container = new FormContainer($lang->add_user_as_moderator); $form_container->output_row($lang->username." <em>*</em>", $lang->moderator_username_desc, $form->generate_text_box('username', $mybb->input['username'], array('id' => 'username')), 'username'); $form_container->end();
|
|
|
// Autocompletion for usernames echo ' <script type="text/javascript" src="../jscripts/autocomplete.js?ver=1400"></script>
| // Autocompletion for usernames echo ' <script type="text/javascript" src="../jscripts/autocomplete.js?ver=1400"></script>
|