Vergleich admin/modules/user/groups.php - 1.8.4 - 1.8.6

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 351Zeile 351
			"caninvitemembers" => $mybb->get_input('caninvitemembers', MyBB::INPUT_INT)
);


			"caninvitemembers" => $mybb->get_input('caninvitemembers', MyBB::INPUT_INT)
);


		$plugins->run_hooks("admin_user_groups_add_leader_commit");







		$makeleadermember = $mybb->get_input('makeleadermember', MyBB::INPUT_INT);
if($makeleadermember == 1)
{
join_usergroup($user['uid'], $group['gid']);
}

$plugins->run_hooks("admin_user_groups_add_leader_commit");


$db->insert_query("groupleaders", $new_leader);


$db->insert_query("groupleaders", $new_leader);





		$cache->update_groupleaders();

// Log admin action

		$cache->update_groupleaders();

// Log admin action

		log_admin_action($user['uid'], $mybb->input['username'], $group['gid'], htmlspecialchars_uni($group['title']));

		log_admin_action($user['uid'], $user['username'], $group['gid'], htmlspecialchars_uni($group['title']));


flash_message("{$user['username']} ".$lang->success_user_made_leader, 'success');
admin_redirect("index.php?module=user-groups&action=leaders&gid={$group['gid']}");


flash_message("{$user['username']} ".$lang->success_user_made_leader, 'success');
admin_redirect("index.php?module=user-groups&action=leaders&gid={$group['gid']}");

	}

	}

	else
{
// Errors, show leaders page

	else
{
// Errors, show leaders page

Zeile 416Zeile 422
		if($leader['canmanagemembers'])
{
$canmanagemembers = $lang->yes;

		if($leader['canmanagemembers'])
{
$canmanagemembers = $lang->yes;

		}
else

		}
else

		{
$canmanagemembers = $lang->no;

		{
$canmanagemembers = $lang->no;

		}

		}


if($leader['canmanagerequests'])
{
$canmanagerequests = $lang->yes;


if($leader['canmanagerequests'])
{
$canmanagerequests = $lang->yes;

		}

		}

		else
{
$canmanagerequests = $lang->no;

		else
{
$canmanagerequests = $lang->no;

		}


		}


		if($leader['caninvitemembers'])
{
$caninvitemembers = $lang->yes;

		if($leader['caninvitemembers'])
{
$caninvitemembers = $lang->yes;

Zeile 458Zeile 464
	$table->output($lang->group_leaders_for.' '.htmlspecialchars_uni($group['title']));

$form = new Form("index.php?module=user-groups&action=add_leader&gid={$group['gid']}", "post");

	$table->output($lang->group_leaders_for.' '.htmlspecialchars_uni($group['title']));

$form = new Form("index.php?module=user-groups&action=add_leader&gid={$group['gid']}", "post");


if($errors)
{
$page->output_inline_error($errors);
}


if($errors)
{
$page->output_inline_error($errors);
}

	else
{
$mybb->input = array_merge($mybb->input, array(
"canmanagemembers" => 1,
"canmanagerequests" => 1,

	else
{
$mybb->input = array_merge($mybb->input, array(
"canmanagemembers" => 1,
"canmanagerequests" => 1,

				"caninvitemembers" => 1


				"caninvitemembers" => 1,
"makeleadermember" => 0

			)
);
}

			)
);
}

Zeile 478Zeile 485
	$form_container->output_row($lang->can_manage_group_members, $lang->can_manage_group_members_desc, $form->generate_yes_no_radio('canmanagemembers', $mybb->input['canmanagemembers']));
$form_container->output_row($lang->can_manage_group_join_requests, $lang->can_manage_group_join_requests_desc, $form->generate_yes_no_radio('canmanagerequests', $mybb->input['canmanagerequests']));
$form_container->output_row($lang->can_invite_group_members, $lang->can_invite_group_members_desc, $form->generate_yes_no_radio('caninvitemembers', $mybb->input['caninvitemembers']));

	$form_container->output_row($lang->can_manage_group_members, $lang->can_manage_group_members_desc, $form->generate_yes_no_radio('canmanagemembers', $mybb->input['canmanagemembers']));
$form_container->output_row($lang->can_manage_group_join_requests, $lang->can_manage_group_join_requests_desc, $form->generate_yes_no_radio('canmanagerequests', $mybb->input['canmanagerequests']));
$form_container->output_row($lang->can_invite_group_members, $lang->can_invite_group_members_desc, $form->generate_yes_no_radio('caninvitemembers', $mybb->input['caninvitemembers']));

	$buttons[] = $form->generate_submit_button($lang->save_group_leader);


	$form_container->output_row($lang->make_user_member, $lang->make_user_member_desc, $form->generate_yes_no_radio('makeleadermember', $mybb->input['makeleadermember']));


	$form_container->end();

	$form_container->end();

 

// Autocompletion for usernames
echo '
<link rel="stylesheet" href="../jscripts/select2/select2.css">
<script type="text/javascript" src="../jscripts/select2/select2.min.js?ver=1804"></script>
<script type="text/javascript">
<!--
$("#username").select2({
placeholder: "'.$lang->search_for_a_user.'",
minimumInputLength: 3,
maximumSelectionSize: 3,
multiple: false,
ajax: { // instead of writing the function to execute the request we use Select2\'s convenient helper
url: "../xmlhttp.php?action=get_users",
dataType: \'json\',
data: function (term, page) {
return {
query: term // search term
};
},
results: function (data, page) { // parse the results into the format expected by Select2.
// since we are using custom formatting functions we do not need to alter remote JSON data
return {results: data};
}
},
initSelection: function(element, callback) {
var query = $(element).val();
if (query !== "") {
$.ajax("../xmlhttp.php?action=get_users&getone=1", {
data: {
query: query
},
dataType: "json"
}).done(function(data) { callback(data); });
}
}
});
// -->
</script>';

$buttons[] = $form->generate_submit_button($lang->save_group_leader);

	$form->output_submit_wrapper($buttons);
$form->end();

	$form->output_submit_wrapper($buttons);
$form->end();





	$page->output_footer();
}

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

	$page->output_footer();
}

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

{
$query = $db->query("
SELECT l.*, u.username
FROM ".TABLE_PREFIX."groupleaders l

{
$query = $db->query("
SELECT l.*, u.username
FROM ".TABLE_PREFIX."groupleaders l

		INNER JOIN ".TABLE_PREFIX."users u ON (u.uid=l.uid)
WHERE l.lid='".$mybb->get_input('lid', MyBB::INPUT_INT)."'");
$leader = $db->fetch_array($query);

		INNER JOIN ".TABLE_PREFIX."users u ON (u.uid=l.uid)
WHERE l.lid='".$mybb->get_input('lid', MyBB::INPUT_INT)."'");
$leader = $db->fetch_array($query);

Zeile 518Zeile 565
		$plugins->run_hooks("admin_user_groups_delete_leader_commit");

// Delete the leader

		$plugins->run_hooks("admin_user_groups_delete_leader_commit");

// Delete the leader

		$db->delete_query("groupleaders", "lid='{$leader['lid']}'");

$plugins->run_hooks("admin_user_groups_delete_leader_commit_end");

		$db->delete_query("groupleaders", "lid='{$leader['lid']}'");







		$cache->update_groupleaders();



		$plugins->run_hooks("admin_user_groups_delete_leader_commit_end");

$cache->update_groupleaders();


// Log admin action


// Log admin action

		log_admin_action($leader['lid'], $leader['username'], $group['gid'], htmlspecialchars_uni($group['title']));

		log_admin_action($leader['uid'], $leader['username'], $group['gid'], htmlspecialchars_uni($group['title']));


flash_message($lang->success_group_leader_deleted, 'success');
admin_redirect("index.php?module=user-groups&action=leaders&gid={$group['gid']}");


flash_message($lang->success_group_leader_deleted, 'success');
admin_redirect("index.php?module=user-groups&action=leaders&gid={$group['gid']}");

	}

	}

	else
{
$page->output_confirm_action("index.php?module=user-groups&amp;action=delete_leader&amp;lid={$leader['lid']}", $lang->confirm_group_leader_deletion);
}

	else
{
$page->output_confirm_action("index.php?module=user-groups&amp;action=delete_leader&amp;lid={$leader['lid']}", $lang->confirm_group_leader_deletion);
}

}

}


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


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

Zeile 572Zeile 619
		$cache->update_groupleaders();

// Log admin action

		$cache->update_groupleaders();

// Log admin action

		log_admin_action($leader['lid'], $leader['username'], $group['gid'], htmlspecialchars_uni($group['title']));

		log_admin_action($leader['uid'], $leader['username'], $group['gid'], htmlspecialchars_uni($group['title']));


flash_message($lang->success_group_leader_updated, 'success');
admin_redirect("index.php?module=user-groups&action=leaders&gid={$group['gid']}");


flash_message($lang->success_group_leader_updated, 'success');
admin_redirect("index.php?module=user-groups&action=leaders&gid={$group['gid']}");

	}

	}


if(!$errors)
{


if(!$errors)
{

Zeile 629Zeile 676
		{
$errors[] = $lang->error_missing_namestyle_username;
}

		{
$errors[] = $lang->error_missing_namestyle_username;
}





		if(!$errors)
{
if($mybb->input['stars'] < 1)

		if(!$errors)
{
if($mybb->input['stars'] < 1)

Zeile 666Zeile 713
				foreach(array_keys($usergroup_permissions) as $field)
{
$new_usergroup[$field] = $existing_usergroup[$field];

				foreach(array_keys($usergroup_permissions) as $field)
{
$new_usergroup[$field] = $existing_usergroup[$field];

				}
}

$plugins->run_hooks("admin_user_groups_add_commit");

$gid = $db->insert_query("usergroups", $new_usergroup);

				}
}

$plugins->run_hooks("admin_user_groups_add_commit");

$gid = $db->insert_query("usergroups", $new_usergroup);


$plugins->run_hooks("admin_user_groups_add_commit_end");


$plugins->run_hooks("admin_user_groups_add_commit_end");





			// Are we copying permissions? If so, copy all forum permissions too
if($mybb->input['copyfrom'] > 0)
{

			// Are we copying permissions? If so, copy all forum permissions too
if($mybb->input['copyfrom'] > 0)
{

Zeile 684Zeile 731
					unset($forum_permission['pid']);
$forum_permission['gid'] = $gid;
$db->insert_query("forumpermissions", $forum_permission);

					unset($forum_permission['pid']);
$forum_permission['gid'] = $gid;
$db->insert_query("forumpermissions", $forum_permission);

				}
}


				}
}


			// Update the caches
$cache->update_usergroups();
$cache->update_forumpermissions();

			// Update the caches
$cache->update_usergroups();
$cache->update_forumpermissions();

Zeile 728Zeile 775
	while($usergroup = $db->fetch_array($query))
{
$options[$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']);

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

	}

	}

	$form_container->output_row($lang->copy_permissions_from, $lang->copy_permissions_from_desc, $form->generate_select_box('copyfrom', $options, $mybb->input['copyfrom'], array('id' => 'copyfrom')), 'copyfrom');

$form_container->end();

	$form_container->output_row($lang->copy_permissions_from, $lang->copy_permissions_from_desc, $form->generate_select_box('copyfrom', $options, $mybb->input['copyfrom'], array('id' => 'copyfrom')), 'copyfrom');

$form_container->end();

Zeile 770Zeile 817
		if(my_strpos($mybb->input['namestyle'], "{username}") === false)
{
$errors[] = $lang->error_missing_namestyle_username;

		if(my_strpos($mybb->input['namestyle'], "{username}") === false)
{
$errors[] = $lang->error_missing_namestyle_username;

		}

		}


if($mybb->input['moderate'] == 1 && $mybb->input['invite'] == 1)
{


if($mybb->input['moderate'] == 1 && $mybb->input['invite'] == 1)
{

Zeile 784Zeile 831
				if($mybb->input['moderate'] == 1)
{
$mybb->input['type'] = "4";

				if($mybb->input['moderate'] == 1)
{
$mybb->input['type'] = "4";

				}

				}

				elseif($mybb->input['invite'] == 1)

				elseif($mybb->input['invite'] == 1)

				{

				{

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

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

				}

				}

				else
{
$mybb->input['type'] = "3";

				else
{
$mybb->input['type'] = "3";

Zeile 797Zeile 844
			else
{
$mybb->input['type'] = "2";

			else
{
$mybb->input['type'] = "2";

			}

			}


if($usergroup['type'] == 1)
{


if($usergroup['type'] == 1)
{

Zeile 1015Zeile 1062
		$form->generate_check_box("cancp", 1, $lang->can_access_admin_cp, array("checked" => $mybb->input['cancp']))
);
$form_container->output_row($lang->moderation_administration_options, "", "<div class=\"group_settings_bit\">".implode("</div><div class=\"group_settings_bit\">", $admin_options)."</div>");

		$form->generate_check_box("cancp", 1, $lang->can_access_admin_cp, array("checked" => $mybb->input['cancp']))
);
$form_container->output_row($lang->moderation_administration_options, "", "<div class=\"group_settings_bit\">".implode("</div><div class=\"group_settings_bit\">", $admin_options)."</div>");


$form_container->end();
echo "</div>";



$form_container->end();
echo "</div>";


	//
// FORUMS AND POSTS
//

	//
// FORUMS AND POSTS
//

Zeile 1220Zeile 1267

if($mybb->request_method == "post")
{


if($mybb->request_method == "post")
{

		// Move any users back to the registered group
$updated_users = array("usergroup" => 2);










		if($usergroup['isbannedgroup'] == 1)
{
// If banned group, move users to default banned group
$updated_users = array("usergroup" => 7);
}
else
{
// Move any users back to the registered group
$updated_users = array("usergroup" => 2);
}


		$db->update_query("users", $updated_users, "usergroup='{$usergroup['gid']}'");

$updated_users = array("displaygroup" => "usergroup");
$plugins->run_hooks("admin_user_groups_delete_commit");

		$db->update_query("users", $updated_users, "usergroup='{$usergroup['gid']}'");

$updated_users = array("displaygroup" => "usergroup");
$plugins->run_hooks("admin_user_groups_delete_commit");





		$db->update_query("users", $updated_users, "displaygroup='{$usergroup['gid']}'", "", true); // No quotes = displaygroup=usergroup

switch($db->type)

		$db->update_query("users", $updated_users, "displaygroup='{$usergroup['gid']}'", "", true); // No quotes = displaygroup=usergroup

switch($db->type)

Zeile 1243Zeile 1299
			leave_usergroup($user['uid'], $usergroup['gid']);
}


			leave_usergroup($user['uid'], $usergroup['gid']);
}


 
		$db->update_query("banned", array("gid" => 7), "gid='{$usergroup['gid']}'");
$db->update_query("banned", array("oldgroup" => 2), "oldgroup='{$usergroup['gid']}'");
$db->update_query("banned", array("olddisplaygroup" => "oldgroup"), "olddisplaygroup='{$usergroup['gid']}'", "", true); // No quotes = displaygroup=usergroup

$db->delete_query("forumpermissions", "gid='{$usergroup['gid']}'");
$db->delete_query("calendarpermissions", "gid='{$usergroup['gid']}'");
$db->delete_query("joinrequests", "gid='{$usergroup['gid']}'");
$db->delete_query("moderators", "id='{$usergroup['gid']}' AND isgroup='1'");

		$db->delete_query("groupleaders", "gid='{$usergroup['gid']}'");
$db->delete_query("usergroups", "gid='{$usergroup['gid']}'");


		$db->delete_query("groupleaders", "gid='{$usergroup['gid']}'");
$db->delete_query("usergroups", "gid='{$usergroup['gid']}'");


Zeile 1252Zeile 1316
		$cache->update_moderators();
$cache->update_usergroups();
$cache->update_forumpermissions();

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

 
		$cache->update_banned();


// Log admin action
log_admin_action($usergroup['gid'], htmlspecialchars_uni($usergroup['title']));


// Log admin action
log_admin_action($usergroup['gid'], htmlspecialchars_uni($usergroup['title']));

Zeile 1400Zeile 1465
		$leaders_list = '';
if(isset($leaders[$usergroup['gid']]))
{

		$leaders_list = '';
if(isset($leaders[$usergroup['gid']]))
{

			$leaders_list = "<br />{$lang->group_leaders}: ".implode(", ", $leaders[$usergroup['gid']]);

			$leaders_list = "<br />{$lang->group_leaders}: ".implode($lang->comma, $leaders[$usergroup['gid']]);

		}

$join_requests = '';

		}

$join_requests = '';