Vergleich admin/modules/forum/management.php - 1.6.6 - 1.6.13

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: management.php 5620 2011-09-26 18:23:52Z ralgith $

 * $Id$

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 19Zeile 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(isset($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 30Zeile 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 299Zeile 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 312Zeile 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 370Zeile 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 445Zeile 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 499Zeile 502
		
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

Zeile 954Zeile 954
		$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->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(
'0' => $lang->use_default
);

$query = $db->simple_select("themes", "tid,name", "name!='((master))' AND name!='((master-backup))'", array('order_by' => 'name'));
while($style = $db->fetch_array($query))

	);

$form_container->output_row($lang->moderation_options, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $moderator_options)."</div>");

$styles = array(
'0' => $lang->use_default
);

$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 978Zeile 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 1040Zeile 1041
	);

$form_container->output_row($lang->misc_options, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $misc_options)."</div>");

	);

$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->end();

	echo "</div>";


	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 1094Zeile 1095
	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 1158Zeile 1159
		if($default_checked)
{
$inherited_text = $lang->inherited_permission;

		if($default_checked)
{
$inherited_text = $lang->inherited_permission;

		}

		}

		else
{
$inherited_text = $lang->custom_permission;

		else
{
$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)

			{
$field_select .= "<li id=\"field-{$perm}\">{$field_list2[$perm]}</li>";
}

			{
$field_select .= "<li id=\"field-{$perm}\">{$field_list2[$perm]}</li>";
}

		}
$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)

		foreach($perms_checked as $perm => $value)

		{

		{

			if($value == 0)
{
$field_select .= "<li id=\"field-{$perm}\">{$field_list2[$perm]}</li>";

			if($value == 0)
{
$field_select .= "<li id=\"field-{$perm}\">{$field_list2[$perm]}</li>";

Zeile 1197Zeile 1198
		
$field_selected = array();
foreach($field_list as $forum_permission => $permission_title)

		
$field_selected = array();
foreach($field_list as $forum_permission => $permission_title)

		{

		{

			$field_options[$forum_permission] = $permission_title;
if($perms_checked[$forum_permission])
{

			$field_options[$forum_permission] = $permission_title;
if($perms_checked[$forum_permission])
{

Zeile 1234Zeile 1235
	$plugins->run_hooks("admin_forum_management_edit");

if(!$mybb->input['fid'])

	$plugins->run_hooks("admin_forum_management_edit");

if(!$mybb->input['fid'])

	{
flash_message($lang->error_invalid_fid, 'error');
admin_redirect("index.php?module=forum-management");
}


	{
flash_message($lang->error_invalid_fid, 'error');
admin_redirect("index.php?module=forum-management");
}


	$query = $db->simple_select("forums", "*", "fid='{$mybb->input['fid']}'");
$forum_data = $db->fetch_array($query);
if(!$forum_data)

	$query = $db->simple_select("forums", "*", "fid='{$mybb->input['fid']}'");
$forum_data = $db->fetch_array($query);
if(!$forum_data)

Zeile 1252Zeile 1253
	if($mybb->request_method == "post")
{
if(!trim($mybb->input['title']))

	if($mybb->request_method == "post")
{
if(!trim($mybb->input['title']))

		{

		{

			$errors[] = $lang->error_missing_title;
}


			$errors[] = $lang->error_missing_title;
}


Zeile 1261Zeile 1262
		if($pid == $mybb->input['fid'])
{
$errors[] = $lang->error_forum_parent_itself;

		if($pid == $mybb->input['fid'])
{
$errors[] = $lang->error_forum_parent_itself;

		}

		}

		else
{
$query = $db->simple_select("forums", "*", "pid='{$mybb->input['fid']}'");

		else
{
$query = $db->simple_select("forums", "*", "pid='{$mybb->input['fid']}'");

Zeile 1271Zeile 1272
				{
$errors[] = $lang->error_forum_parent_child;
break;

				{
$errors[] = $lang->error_forum_parent_child;
break;

				}
}
}


				}
}
}


		$type = $mybb->input['type'];

if($pid <= 0 && $type == "f")

		$type = $mybb->input['type'];

if($pid <= 0 && $type == "f")

Zeile 1349Zeile 1350
				while($child = $db->fetch_array($query))
{
$db->update_query("forums", array("parentlist" => make_parent_list($child['fid'])), "fid='{$child['fid']}'", 1);

				while($child = $db->fetch_array($query))
{
$db->update_query("forums", array("parentlist" => make_parent_list($child['fid'])), "fid='{$child['fid']}'", 1);

				}
}


				}
}


			$inherit = $mybb->input['default_permissions'];

foreach($mybb->input as $id => $permission)

			$inherit = $mybb->input['default_permissions'];

foreach($mybb->input as $id => $permission)

Zeile 1438Zeile 1439
		$forum_data['title'] = $forum_data['name'];
}


		$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))
{
$usergroups[$usergroup['gid']] = $usergroup;

	while($usergroup = $db->fetch_array($query))
{
$usergroups[$usergroup['gid']] = $usergroup;

Zeile 1468Zeile 1469
		$create_a_options_f['checked'] = true;
}
else

		$create_a_options_f['checked'] = true;
}
else

	{

	{

		$create_a_options_c['checked'] = true;
}


		$create_a_options_c['checked'] = true;
}


Zeile 1520Zeile 1521
	$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 1545Zeile 1547
	);

$default_sort_by = array(

	);

$default_sort_by = array(

		"" => $lang->board_default,

		"" => $lang->board_default,

		"subject" => $lang->sort_by_subject,
"lastpost" => $lang->sort_by_lastpost,
"starter" => $lang->sort_by_starter,

		"subject" => $lang->sort_by_subject,
"lastpost" => $lang->sort_by_lastpost,
"starter" => $lang->sort_by_starter,

Zeile 1553Zeile 1555
		"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,
"asc" => $lang->sort_order_asc,

	$default_sort_order = array(
"" => $lang->board_default,
"asc" => $lang->sort_order_asc,

Zeile 1565Zeile 1567
		$lang->default_date_cut."<br />\n".$form->generate_select_box('defaultdatecut', $default_date_cut, $forum_data['defaultdatecut'], array('checked' => $forum_data['defaultdatecut'], 'id' => 'defaultdatecut')),
$lang->default_sort_by."<br />\n".$form->generate_select_box('defaultsortby', $default_sort_by, $forum_data['defaultsortby'], array('checked' => $forum_data['defaultsortby'], 'id' => 'defaultsortby')),
$lang->default_sort_order."<br />\n".$form->generate_select_box('defaultsortorder', $default_sort_order, $forum_data['defaultsortorder'], array('checked' => $forum_data['defaultsortorder'], 'id' => 'defaultsortorder')),

		$lang->default_date_cut."<br />\n".$form->generate_select_box('defaultdatecut', $default_date_cut, $forum_data['defaultdatecut'], array('checked' => $forum_data['defaultdatecut'], 'id' => 'defaultdatecut')),
$lang->default_sort_by."<br />\n".$form->generate_select_box('defaultsortby', $default_sort_by, $forum_data['defaultsortby'], array('checked' => $forum_data['defaultsortby'], 'id' => 'defaultsortby')),
$lang->default_sort_order."<br />\n".$form->generate_select_box('defaultsortorder', $default_sort_order, $forum_data['defaultsortorder'], array('checked' => $forum_data['defaultsortorder'], 'id' => 'defaultsortorder')),

	);

$form_container->output_row($lang->default_view_options, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $view_options)."</div>");


	);

$form_container->output_row($lang->default_view_options, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $view_options)."</div>");


	$misc_options = array(
$form->generate_check_box('allowhtml', 1, $lang->allow_html, array('checked' => $forum_data['allowhtml'], 'id' => 'allowhtml')),
$form->generate_check_box('allowmycode', 1, $lang->allow_mycode, array('checked' => $forum_data['allowmycode'], 'id' => 'allowmycode')),

	$misc_options = array(
$form->generate_check_box('allowhtml', 1, $lang->allow_html, array('checked' => $forum_data['allowhtml'], 'id' => 'allowhtml')),
$form->generate_check_box('allowmycode', 1, $lang->allow_mycode, array('checked' => $forum_data['allowmycode'], 'id' => 'allowmycode')),

Zeile 1582Zeile 1584
	);

$form_container->output_row($lang->misc_options, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $misc_options)."</div>");

	);

$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->end();


	$cached_forum_perms = $cache->read("forumpermissions");
$field_list = array(
'canview' => $lang->permissions_canview,

	$cached_forum_perms = $cache->read("forumpermissions");
$field_list = array(
'canview' => $lang->permissions_canview,

Zeile 1615Zeile 1617
			{
$input_permissions = $mybb->input['fields_'.$usergroup['gid']];
if(!is_array($input_permissions))

			{
$input_permissions = $mybb->input['fields_'.$usergroup['gid']];
if(!is_array($input_permissions))

				{

				{

					// Convering the comma separated list from Javascript form into a variable
$input_permissions = explode(',' , $input_permissions);
}
foreach($input_permissions as $input_permission)

					// Convering the comma separated list from Javascript form into a variable
$input_permissions = explode(',' , $input_permissions);
}
foreach($input_permissions as $input_permission)

				{

				{

					$mybb->input['permissions'][$usergroup['gid']][$input_permission] = 1;

					$mybb->input['permissions'][$usergroup['gid']][$input_permission] = 1;

				}
}

				}
}

		}
}


		}
}


Zeile 1633Zeile 1635
		if(isset($mybb->input['default_permissions']))
{
if($mybb->input['default_permissions'][$usergroup['gid']])

		if(isset($mybb->input['default_permissions']))
{
if($mybb->input['default_permissions'][$usergroup['gid']])

			{

			{

				if(is_array($existing_permissions) && $existing_permissions[$usergroup['gid']])
{
$perms = $existing_permissions[$usergroup['gid']];
$default_checked = false;
}
elseif(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['fid']][$usergroup['gid']])

				if(is_array($existing_permissions) && $existing_permissions[$usergroup['gid']])
{
$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;
}

					$perms = $cached_forum_perms[$forum_data['fid']][$usergroup['gid']];
$default_checked = true;
}

Zeile 1648Zeile 1650
				{
$perms = $cached_forum_perms[$forum_data['pid']][$usergroup['gid']];
$default_checked = true;

				{
$perms = $cached_forum_perms[$forum_data['pid']][$usergroup['gid']];
$default_checked = true;

				}
}

if(!$perms)
{
$perms = $usergroup;
$default_checked = true;
}
}
else
{

				}
}

if(!$perms)
{
$perms = $usergroup;
$default_checked = true;
}
}
else
{

			if(is_array($existing_permissions) && $existing_permissions[$usergroup['gid']])
{
$perms = $existing_permissions[$usergroup['gid']];
$default_checked = false;

			if(is_array($existing_permissions) && $existing_permissions[$usergroup['gid']])
{
$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']];

			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']];

				$default_checked = true;
}

				$default_checked = true;
}

			
if(!$perms)
{

			
if(!$perms)
{

Zeile 1696Zeile 1698
				}
}
else

				}
}
else

			{
if($perms[$forum_permission] == 1)

			{
if($perms[$forum_permission] == 1)

				{
$perms_checked[$forum_permission] = 1;
}

				{
$perms_checked[$forum_permission] = 1;
}

Zeile 1809Zeile 1811
	if(!$mod['mid'])
{
flash_message($lang->error_invalid_moderator, 'error');

	if(!$mod['mid'])
{
flash_message($lang->error_invalid_moderator, 'error');

		admin_redirect("index.php?module=forum-management&fid={$fid}");
}

// User clicked no

		admin_redirect("index.php?module=forum-management&fid={$fid}");
}

// User clicked no

	if($mybb->input['no'])
{
admin_redirect("index.php?module=forum-management&fid={$fid}");

	if($mybb->input['no'])
{
admin_redirect("index.php?module=forum-management&fid={$fid}");

Zeile 1859Zeile 1861
		// Log admin action
if ($isgroup)
{

		// 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 1891Zeile 1893

// User clicked no
if($mybb->input['no'])


// User clicked no
if($mybb->input['no'])

	{
admin_redirect("index.php?module=forum-management");
}


	{
admin_redirect("index.php?module=forum-management");
}


	if($mybb->request_method == "post")
{
$fid = intval($mybb->input['fid']);

	if($mybb->request_method == "post")
{
$fid = intval($mybb->input['fid']);

Zeile 2004Zeile 2006
if(!$mybb->input['action'])
{
$plugins->run_hooks("admin_forum_management_start");

if(!$mybb->input['action'])
{
$plugins->run_hooks("admin_forum_management_start");

	$fid = intval($mybb->input['fid']);

 




 
	if(!isset($mybb->input['fid']))
{
$mybb->input['fid'] = 0;
}

$fid = intval($mybb->input['fid']);

	if($fid)
{
$forum = get_forum($fid);

	if($fid)
{
$forum = get_forum($fid);

	}


	}


	if($mybb->request_method == "post")
{
if($mybb->input['update'] == "permissions")

	if($mybb->request_method == "post")
{
if($mybb->input['update'] == "permissions")

Zeile 2020Zeile 2027
			{
// 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;
}


					continue;
}


Zeile 2039Zeile 2046
					$permission = explode(',', $permission);
$permission = array_flip($permission);
foreach($permission as $name => $value)

					$permission = explode(',', $permission);
$permission = array_flip($permission);
foreach($permission as $name => $value)

					{

					{

						$permission[$name] = 1;
}
}

						$permission[$name] = 1;
}
}

Zeile 2048Zeile 2055
					if($permission[$name])
{
$permissions[$name][$gid] = 1;

					if($permission[$name])
{
$permissions[$name][$gid] = 1;

					}

					}

					else
{
$permissions[$name][$gid] = 0;

					else
{
$permissions[$name][$gid] = 0;

Zeile 2128Zeile 2135
						"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);

					);

$mid = $db->insert_query("moderators", $new_mod);

Zeile 2142Zeile 2150
					$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 2204Zeile 2212
	
$form = new Form("index.php?module=forum-management", "post", "management");
echo $form->generate_hidden_field("fid", $mybb->input['fid']);

	
$form = new Form("index.php?module=forum-management", "post", "management");
echo $form->generate_hidden_field("fid", $mybb->input['fid']);

	

	

	if($fid)
{
$tabs = array(

	if($fid)
{
$tabs = array(

Zeile 2216Zeile 2224
		$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();
}

		{
cache_forums();
}

Zeile 2258Zeile 2266
		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 2319Zeile 2327
					{
$perms = $cached_forum_perms[$forum['pid']][$usergroup['gid']];
$default_checked = true;

					{
$perms = $cached_forum_perms[$forum['pid']][$usergroup['gid']];
$default_checked = true;

					}
}

if(!$perms)
{
$perms = $usergroup;
$default_checked = true;
}
}

					}
}

if(!$perms)
{
$perms = $usergroup;
$default_checked = true;
}
}

			else
{

			else
{

				if(is_array($existing_permissions) && $existing_permissions[$usergroup['gid']])

				if(isset($existing_permissions) && is_array($existing_permissions) && $existing_permissions[$usergroup['gid']])

				{
$perms = $existing_permissions[$usergroup['gid']];

				{
$perms = $existing_permissions[$usergroup['gid']];

					$default_checked = false;
}
elseif(is_array($cached_forum_perms) && $cached_forum_perms[$forum['fid']][$usergroup['gid']])
{
$perms = $cached_forum_perms[$forum['fid']][$usergroup['gid']];
$default_checked = true;

					$default_checked = false;
}
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['pid']][$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;

					$default_checked = true;

				}

if(!$perms)

				}

if(!$perms)

Zeile 2357Zeile 2365
				if(isset($mybb->input['permissions']))
{
if($mybb->input['permissions'][$usergroup['gid']][$forum_permission])

				if(isset($mybb->input['permissions']))
{
if($mybb->input['permissions'][$usergroup['gid']][$forum_permission])

					{
$perms_checked[$forum_permission] = 1;
}
else
{

					{
$perms_checked[$forum_permission] = 1;
}
else
{

						$perms_checked[$forum_permission] = 0;
}
}
else

						$perms_checked[$forum_permission] = 0;
}
}
else

				{

				{

					if($perms[$forum_permission] == 1)
{
$perms_checked[$forum_permission] = 1;

					if($perms[$forum_permission] == 1)
{
$perms_checked[$forum_permission] = 1;

Zeile 2375Zeile 2383
					{
$perms_checked[$forum_permission] = 0;
}

					{
$perms_checked[$forum_permission] = 0;
}

				}
}

				}
}

			$usergroup['title'] = htmlspecialchars_uni($usergroup['title']);

if($default_checked == 1)

			$usergroup['title'] = htmlspecialchars_uni($usergroup['title']);

if($default_checked == 1)

Zeile 2386Zeile 2394
			else
{
$inherited_text = $lang->custom_permission;

			else
{
$inherited_text = $lang->custom_permission;

			}


			}


			$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";
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 2400Zeile 2408
				}
}
$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)

			foreach($perms_checked as $perm => $value)

			{

			{

				if($value == 0)
{
$field_select .= "<li id=\"field-{$perm}\">{$field_list2[$perm]}</li>";

				if($value == 0)
{
$field_select .= "<li id=\"field-{$perm}\">{$field_list2[$perm]}</li>";

				}

				}

			}
$field_select .= "</ul></div></div>\n";
$field_select .= $form->generate_hidden_field("fields_".$usergroup['gid'], @implode(",", @array_keys($perms_checked, '1')), array('id' => 'fields_'.$usergroup['gid']));

			}
$field_select .= "</ul></div></div>\n";
$field_select .= $form->generate_hidden_field("fields_".$usergroup['gid'], @implode(",", @array_keys($perms_checked, '1')), array('id' => 'fields_'.$usergroup['gid']));

Zeile 2438Zeile 2446
			{
$form_container->output_cell("<a href=\"index.php?module=forum-management&amp;action=permissions&amp;pid={$perms['pid']}\" onclick=\"modal = new MyModal({type: 'ajax', url: 'index.php?module=forum-management&action=permissions&pid={$perms['pid']}&ajax=1'}); return false;\">{$lang->edit_permissions}</a>", array("class" => "align_center"));
$form_container->output_cell("<a href=\"index.php?module=forum-management&amp;action=clear_permission&amp;pid={$perms['pid']}&amp;my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_clear_custom_permission}')\">{$lang->clear_custom_perms}</a>", array("class" => "align_center"));

			{
$form_container->output_cell("<a href=\"index.php?module=forum-management&amp;action=permissions&amp;pid={$perms['pid']}\" onclick=\"modal = new MyModal({type: 'ajax', url: 'index.php?module=forum-management&action=permissions&pid={$perms['pid']}&ajax=1'}); return false;\">{$lang->edit_permissions}</a>", array("class" => "align_center"));
$form_container->output_cell("<a href=\"index.php?module=forum-management&amp;action=clear_permission&amp;pid={$perms['pid']}&amp;my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_clear_custom_permission}')\">{$lang->clear_custom_perms}</a>", array("class" => "align_center"));

			}
else
{

			}
else
{

				$form_container->output_cell("<a href=\"index.php?module=forum-management&amp;action=permissions&amp;gid={$usergroup['gid']}&amp;fid={$fid}\"  onclick=\"modal = new MyModal({type: 'ajax', url: 'index.php?module=forum-management&action=permissions&gid={$usergroup['gid']}&fid={$fid}&ajax=1'}); return false;\">{$lang->set_custom_perms}</a>", array("class" => "align_center", "colspan" => 2));
}
$form_container->construct_row(array('id' => 'row_'.$usergroup['gid']));

				$form_container->output_cell("<a href=\"index.php?module=forum-management&amp;action=permissions&amp;gid={$usergroup['gid']}&amp;fid={$fid}\"  onclick=\"modal = new MyModal({type: 'ajax', url: 'index.php?module=forum-management&action=permissions&gid={$usergroup['gid']}&fid={$fid}&ajax=1'}); return false;\">{$lang->set_custom_perms}</a>", array("class" => "align_center", "colspan" => 2));
}
$form_container->construct_row(array('id' => 'row_'.$usergroup['gid']));

Zeile 2518Zeile 2526
		foreach($usergroups as $group)
{
$modgroups[$group['gid']] = $lang->usergroup." ".$group['gid'].": ".$group['title'];

		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);