Vergleich admin/modules/forum/management.php - 1.4.3 - 1.4.6

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * $Id: management.php 4131 2008-08-19 15:31:39Z Tikitiki $

 * $Id: management.php 4349 2009-04-14 19:46:21Z Tikitiki $

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 890Zeile 890
		$usergroups[$usergroup['gid']] = $usergroup;
}


		$usergroups[$usergroup['gid']] = $usergroup;
}


 
	$cached_forum_perms = $cache->read("forumpermissions");

	$field_list = array('canview', 'canpostthreads', 'canpostreplys', 'canpostpolls', 'canpostattachments');

$form_container = new FormContainer($lang->forum_permissions);

	$field_list = array('canview', 'canpostthreads', 'canpostreplys', 'canpostpolls', 'canpostattachments');

$form_container = new FormContainer($lang->forum_permissions);

Zeile 906Zeile 907
		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']])

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

				{

				{

					$perms = $existing_permissions[$usergroup['gid']];
$default_checked = false;
}

					$perms = $existing_permissions[$usergroup['gid']];
$default_checked = false;
}

Zeile 916Zeile 917
				{
$perms = $cached_forum_perms[$mybb->input['pid']][$usergroup['gid']];
$default_checked = true;

				{
$perms = $cached_forum_perms[$mybb->input['pid']][$usergroup['gid']];
$default_checked = true;

				}
}

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

				}
}

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

			}
}
else

			}
}
else

Zeile 945Zeile 946
			}
}


			}
}


 
		$all_check = "";

		$perm_check = "";
$all_checked = true;
foreach($field_list as $forum_permission)
{
if($usergroup[$forum_permission] == 1)

		$perm_check = "";
$all_checked = true;
foreach($field_list as $forum_permission)
{
if($usergroup[$forum_permission] == 1)

			{

			{

				$value = "true";

				$value = "true";

			}
else
{

			}
else
{

				$value = "false";
}


				$value = "false";
}


Zeile 986Zeile 988
					$all_checked = false;
}
if($perms[$forum_permission] == 1)

					$all_checked = false;
}
if($perms[$forum_permission] == 1)

				{

				{

					$perms_checked[$forum_permission] = 1;
}
else

					$perms_checked[$forum_permission] = 1;
}
else

Zeile 1018Zeile 1020
}

if($mybb->input['action'] == "edit")

}

if($mybb->input['action'] == "edit")

{

{

	$plugins->run_hooks("admin_forum_management_edit");

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

	$plugins->run_hooks("admin_forum_management_edit");

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

Zeile 1049Zeile 1051
		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 1128Zeile 1130
				{
$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']}'", 1);
}

			}

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

			}

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

			
foreach($mybb->input['permissions'] as $gid => $permission)
{
foreach(array('canview','canpostthreads','canpostreplys','canpostpolls','canpostattachments') as $name)
{
if($permission[$name])

			
foreach($mybb->input['permissions'] as $gid => $permission)
{
foreach(array('canview','canpostthreads','canpostreplys','canpostpolls','canpostattachments') as $name)
{
if($permission[$name])

					{

					{

						$permissions[$name][$gid] = 1;

						$permissions[$name][$gid] = 1;

					}

					}

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

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

			}


			}


			$cache->update_forums();

$canview = $permissions['canview'];

			$cache->update_forums();

$canview = $permissions['canview'];

Zeile 1179Zeile 1181
	{
$page->output_inline_error($errors);
$forum_data = $mybb->input;

	{
$page->output_inline_error($errors);
$forum_data = $mybb->input;

	}

	}

	else

	else

	{

	{

		$forum_data['title'] = $forum_data['name'];

		$forum_data['title'] = $forum_data['name'];

	}

	}

	
$query = $db->simple_select("usergroups", "*", "", array("order_dir" => "name"));
while($usergroup = $db->fetch_array($query))

	
$query = $db->simple_select("usergroups", "*", "", array("order_dir" => "name"));
while($usergroup = $db->fetch_array($query))

	{

	{

		$usergroups[$usergroup['gid']] = $usergroup;
}


		$usergroups[$usergroup['gid']] = $usergroup;
}


Zeile 1195Zeile 1197
	while($existing = $db->fetch_array($query))
{
$existing_permissions[$existing['gid']] = $existing;

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

	}

	}

	
$types = array(
'f' => $lang->forum,
'c' => $lang->category

	
$types = array(
'f' => $lang->forum,
'c' => $lang->category

	);


	);


	$create_a_options_f = array(
'id' => 'forum'

	$create_a_options_f = array(
'id' => 'forum'

	);


	);


	$create_a_options_c = array(
'id' => 'category'
);

if($forum_data['type'] == "f")

	$create_a_options_c = array(
'id' => 'category'
);

if($forum_data['type'] == "f")

	{

	{

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

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

Zeile 1243Zeile 1245
		$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>");


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


Zeile 1274Zeile 1276
		$lang->display_method."<br />\n".$form->generate_select_box('rulestype', $display_methods, $forum_data['rulestype'], array('checked' => $forum_data['rulestype'], 'id' => 'rulestype')),
$lang->title."<br />\n".$form->generate_text_box('rulestitle', $forum_data['rulestitle'], array('checked' => $forum_data['rulestitle'], 'id' => 'rulestitle')),
$lang->rules."<br />\n".$form->generate_text_area('rules', $forum_data['rules'], array('checked' => $forum_data['rules'], 'id' => 'rules'))

		$lang->display_method."<br />\n".$form->generate_select_box('rulestype', $display_methods, $forum_data['rulestype'], array('checked' => $forum_data['rulestype'], 'id' => 'rulestype')),
$lang->title."<br />\n".$form->generate_text_box('rulestitle', $forum_data['rulestitle'], array('checked' => $forum_data['rulestitle'], 'id' => 'rulestitle')),
$lang->rules."<br />\n".$form->generate_text_area('rules', $forum_data['rules'], array('checked' => $forum_data['rules'], 'id' => 'rules'))

	);


	);


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

$default_date_cut = array(

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

$default_date_cut = array(

Zeile 1306Zeile 1308
		"" => $lang->board_default,
"asc" => $lang->sort_order_asc,
"desc" => $lang->sort_order_desc,

		"" => $lang->board_default,
"asc" => $lang->sort_order_asc,
"desc" => $lang->sort_order_desc,

	);

	);

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

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

Zeile 1351Zeile 1353
			if($mybb->input['default_permissions'][$usergroup['gid']])
{
if(is_array($existing_permissions) && $existing_permissions[$usergroup['gid']])

			if($mybb->input['default_permissions'][$usergroup['gid']])
{
if(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']])

				elseif(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['fid']][$usergroup['gid']])

				{

				{

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

			if(!$perms)

			{

			{

				$perms = $usergroup;
$default_checked = true;
}

				$perms = $usergroup;
$default_checked = true;
}

Zeile 1381Zeile 1383
				$default_checked = false;
}
elseif(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['fid']][$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']];

				$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 1397Zeile 1399
				$default_checked = true;
}
}

				$default_checked = true;
}
}

 
		$all_check = "";

		$perm_check = "";
$all_checked = true;
foreach($field_list as $forum_permission)

		$perm_check = "";
$all_checked = true;
foreach($field_list as $forum_permission)

Zeile 1511Zeile 1514
		
$db->delete_query("moderators", "mid='{$mid}'");
$query = $db->simple_select("moderators", "*", "uid='{$mod['uid']}'");

		
$db->delete_query("moderators", "mid='{$mid}'");
$query = $db->simple_select("moderators", "*", "uid='{$mod['uid']}'");

		if($db->fetch_array($query))

		if($db->num_rows($query) == 0)

		{
$updatequery = array(
"usergroup" => "2"

		{
$updatequery = array(
"usergroup" => "2"

Zeile 1533Zeile 1536
	else
{
$page->output_confirm_action("index.php?module=forum/management&amp;action=deletemod&amp;fid={$mod['fid']}&amp;uid={$mod['uid']}", $lang->confirm_moderator_deletion);

	else
{
$page->output_confirm_action("index.php?module=forum/management&amp;action=deletemod&amp;fid={$mod['fid']}&amp;uid={$mod['uid']}", $lang->confirm_moderator_deletion);

	}

	}

}

if($mybb->input['action'] == "delete")
{
$plugins->run_hooks("admin_forum_management_delete");

}

if($mybb->input['action'] == "delete")
{
$plugins->run_hooks("admin_forum_management_delete");

	

	

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


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


Zeile 1547Zeile 1550
	if(!$forum['fid'])
{
flash_message($lang->error_invalid_forum, 'error');

	if(!$forum['fid'])
{
flash_message($lang->error_invalid_forum, 'error');

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


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


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

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

Zeile 1562Zeile 1565
		$forum_info = get_forum($fid);
// Delete the forum
$db->delete_query("forums", "fid='$fid'");

		$forum_info = get_forum($fid);
// Delete the forum
$db->delete_query("forums", "fid='$fid'");

		switch($db->type)
{
case "pgsql":

		switch($db->type)
{
case "pgsql":

			case "sqlite3":
case "sqlite2":
$query = $db->simple_select("forums", "*", "','|| parentlist|| ',' LIKE '%,$fid,%'");

			case "sqlite3":
case "sqlite2":
$query = $db->simple_select("forums", "*", "','|| parentlist|| ',' LIKE '%,$fid,%'");

Zeile 1595Zeile 1598
			$mod_list = implode(",", $moderators);
$query = $db->simple_select("moderators", "*", "fid != '$fid' AND uid IN ($mod_list)");
while($mod = $db->fetch_array($query))

			$mod_list = implode(",", $moderators);
$query = $db->simple_select("moderators", "*", "fid != '$fid' AND uid IN ($mod_list)");
while($mod = $db->fetch_array($query))

			{

			{

				unset($moderators[$mod['uid']]);

				unset($moderators[$mod['uid']]);

			}
}

			}
}

		
if(is_array($moderators))
{

		
if(is_array($moderators))
{

Zeile 1609Zeile 1612
					"usergroup" => "2"
);
$db->update_query("users", $updatequery, "uid IN ($mod_list) AND usergroup='6'");

					"usergroup" => "2"
);
$db->update_query("users", $updatequery, "uid IN ($mod_list) AND usergroup='6'");

			}
}


			}
}


		switch($db->type)
{
case "pgsql":

		switch($db->type)
{
case "pgsql":

Zeile 1626Zeile 1629
		$db->delete_query("threads", "fid='{$fid}' {$delquery}");
$db->delete_query("posts", "fid='{$fid}' {$delquery}");
$db->delete_query("moderators", "fid='{$fid}' {$delquery}");

		$db->delete_query("threads", "fid='{$fid}' {$delquery}");
$db->delete_query("posts", "fid='{$fid}' {$delquery}");
$db->delete_query("moderators", "fid='{$fid}' {$delquery}");




		$db->delete_query("forumsubscriptions", "fid='{$fid}' {$delquery}");


		$cache->update_forums();
$cache->update_moderators();
$cache->update_forumpermissions();

		$cache->update_forums();
$cache->update_moderators();
$cache->update_forumpermissions();

Zeile 1658Zeile 1662
		if($mybb->input['update'] == "permissions")
{
$inherit = $mybb->input['default_permissions'];

		if($mybb->input['update'] == "permissions")
{
$inherit = $mybb->input['default_permissions'];

 
			
if(empty($mybb->input['permissions']))
{
$mybb->input['permissions'] = array();
}

			
foreach($mybb->input['permissions'] as $gid => $permission)
{

			
foreach($mybb->input['permissions'] as $gid => $permission)
{

Zeile 1919Zeile 1928
					$default_checked = true;
}
}

					$default_checked = true;
}
}

 
			
$all_check = "";

			$perm_check = "";
$all_checked = true;
foreach($field_list as $forum_permission)

			$perm_check = "";
$all_checked = true;
foreach($field_list as $forum_permission)