Vergleich managegroup.php - 1.8.9 - 1.8.37

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 40Zeile 40
$query = $db->simple_select("groupleaders", "*", "uid='{$mybb->user['uid']}' AND gid='{$gid}'");
$groupleader = $db->fetch_array($query);


$query = $db->simple_select("groupleaders", "*", "uid='{$mybb->user['uid']}' AND gid='{$gid}'");
$groupleader = $db->fetch_array($query);


if(!$groupleader['uid'] && $mybb->usergroup['cancp'] != 1)

if(!$groupleader && $mybb->usergroup['cancp'] != 1)

{
error($lang->not_leader_of_this_group);
}

{
error($lang->not_leader_of_this_group);
}

Zeile 63Zeile 63

$user = get_user_by_username($mybb->get_input('username'), $options);



$user = get_user_by_username($mybb->get_input('username'), $options);


	if($user['uid'])

	if($user)

	{
$additionalgroups = explode(',', $user['additionalgroups']);
if($user['usergroup'] != $gid && !in_array($gid, $additionalgroups))

	{
$additionalgroups = explode(',', $user['additionalgroups']);
if($user['usergroup'] != $gid && !in_array($gid, $additionalgroups))

Zeile 101Zeile 101

$user = get_user_by_username($mybb->get_input('inviteusername'), $options);



$user = get_user_by_username($mybb->get_input('inviteusername'), $options);


	if($user['uid'])

	if($user)

	{
$additionalgroups = explode(',', $user['additionalgroups']);
if($user['usergroup'] != $gid && !in_array($gid, $additionalgroups))
{
$query = $db->simple_select("joinrequests", "rid", "uid = '".(int)$user['uid']."' AND gid = '".(int)$gid."'", array("limit" => 1));
$pendinginvite = $db->fetch_array($query);

	{
$additionalgroups = explode(',', $user['additionalgroups']);
if($user['usergroup'] != $gid && !in_array($gid, $additionalgroups))
{
$query = $db->simple_select("joinrequests", "rid", "uid = '".(int)$user['uid']."' AND gid = '".(int)$gid."'", array("limit" => 1));
$pendinginvite = $db->fetch_array($query);

			if($pendinginvite['rid'])

			if($pendinginvite)

			{
error($lang->error_alreadyinvited);
}

			{
error($lang->error_alreadyinvited);
}

Zeile 197Zeile 197
}
elseif($mybb->input['action'] == "joinrequests")
{

}
elseif($mybb->input['action'] == "joinrequests")
{

	$users = "";

	$users = $joinrequests = '';

	$plugins->run_hooks("managegroup_joinrequests_start");

$query = $db->query("

	$plugins->run_hooks("managegroup_joinrequests_start");

$query = $db->query("

Zeile 236Zeile 236
	{
error_no_permission();
}

	{
error_no_permission();
}

 

$users = $mybb->get_input('removeuser', MyBB::INPUT_ARRAY);


$plugins->run_hooks("managegroup_do_manageusers_start");



$plugins->run_hooks("managegroup_do_manageusers_start");


	if(is_array($mybb->get_input('removeuser', MyBB::INPUT_ARRAY)))

	if(!empty($users))

	{

	{

		foreach($mybb->get_input('removeuser', MyBB::INPUT_ARRAY) as $uid)

		foreach($users as $uid)

		{
leave_usergroup($uid, $gid);
}

		{
leave_usergroup($uid, $gid);
}

Zeile 338Zeile 340
		case "pgsql":
case "sqlite":
$query = $db->simple_select("users", "*", "','||additionalgroups||',' LIKE '%,{$gid},%' OR usergroup='{$gid}'", array('order_by' => 'username'));

		case "pgsql":
case "sqlite":
$query = $db->simple_select("users", "*", "','||additionalgroups||',' LIKE '%,{$gid},%' OR usergroup='{$gid}'", array('order_by' => 'username'));

			break;

			break;

		default:
$query = $db->simple_select("users", "*", "CONCAT(',',additionalgroups,',') LIKE '%,{$gid},%' OR usergroup='{$gid}'", array('order_by' => 'username'));

		default:
$query = $db->simple_select("users", "*", "CONCAT(',',additionalgroups,',') LIKE '%,{$gid},%' OR usergroup='{$gid}'", array('order_by' => 'username'));

	}


	}


	$numusers = $db->num_rows($query);

$perpage = (int)$mybb->settings['membersperpage'];

	$numusers = $db->num_rows($query);

$perpage = (int)$mybb->settings['membersperpage'];

Zeile 355Zeile 357
	if($page && $page > 0)
{
$start = ($page-1) * $perpage;

	if($page && $page > 0)
{
$start = ($page-1) * $perpage;

 
		$pages = ceil($numusers / $perpage);
if($page > $pages)
{
$start = 0;
$page = 1;
}

	}
else
{

	}
else
{

Zeile 373Zeile 381
			$query = $db->simple_select("users", "*", "CONCAT(',',additionalgroups,',') LIKE '%,{$gid},%' OR usergroup='{$gid}'", array('order_by' => 'username', 'limit' => $perpage, 'limit_start' => $start));
}


			$query = $db->simple_select("users", "*", "CONCAT(',',additionalgroups,',') LIKE '%,{$gid},%' OR usergroup='{$gid}'", array('order_by' => 'username', 'limit' => $perpage, 'limit_start' => $start));
}


 
	$removeable_count = 0;

	$users = "";
while($user = $db->fetch_array($query))
{

	$users = "";
while($user = $db->fetch_array($query))
{

Zeile 407Zeile 416
		}

// Checkbox for user management - only if current user is allowed

		}

// Checkbox for user management - only if current user is allowed

		$checkbox = '';
if($groupleader['canmanagemembers'] == 1)










		$checkbox = $disabled = '';
if($user['usergroup'] == $gid)
{
$disabled = 'disabled="disabled"';
}
else
{
++$removeable_count;
}

if($groupleader['canmanagemembers'] == 1)

		{
eval("\$checkbox = \"".$templates->get("managegroup_user_checkbox")."\";");

		{
eval("\$checkbox = \"".$templates->get("managegroup_user_checkbox")."\";");

		}

		}


eval("\$users .= \"".$templates->get("managegroup_user")."\";");


eval("\$users .= \"".$templates->get("managegroup_user")."\";");

	}


	}


	if(!$users)

	if(!$users)

	{

	{

		eval("\$users = \"".$templates->get("managegroup_no_users")."\";");
}


		eval("\$users = \"".$templates->get("managegroup_no_users")."\";");
}


	$add_user = '';
$remove_users = '';

	$add_user = $remove_users = $invite_user = '';


	if($groupleader['canmanagemembers'] == 1)
{
eval("\$add_user = \"".$templates->get("managegroup_adduser")."\";");

	if($groupleader['canmanagemembers'] == 1)
{
eval("\$add_user = \"".$templates->get("managegroup_adduser")."\";");

		eval("\$remove_users = \"".$templates->get("managegroup_removeusers")."\";");




		if($removeable_count)
{
eval("\$remove_users = \"".$templates->get("managegroup_removeusers")."\";");
}

	}

if($usergroup['type'] == 5 && $groupleader['caninvitemembers'] == 1)

	}

if($usergroup['type'] == 5 && $groupleader['caninvitemembers'] == 1)