Vergleich managegroup.php - 1.8.3 - 1.8.30

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 19Zeile 19
// Load language files
$lang->load("managegroup");


// Load language files
$lang->load("managegroup");


$gid = $mybb->get_input('gid', 1);

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

if(!isset($groupscache[$gid]))
{
error($lang->invalid_group);
}
$usergroup = $groupscache[$gid];

if(!isset($groupscache[$gid]))
{
error($lang->invalid_group);
}
$usergroup = $groupscache[$gid];

$lang->nav_group_management = $lang->sprintf($lang->nav_group_management, $usergroup['title']);

$lang->nav_group_management = $lang->sprintf($lang->nav_group_management, htmlspecialchars_uni($usergroup['title']));

add_breadcrumb($lang->nav_group_memberships, "usercp.php?action=usergroups");
add_breadcrumb($lang->nav_group_management, "managegroup.php?gid=$gid");


add_breadcrumb($lang->nav_group_memberships, "usercp.php?action=usergroups");
add_breadcrumb($lang->nav_group_management, "managegroup.php?gid=$gid");


Zeile 169Zeile 169
	$plugins->run_hooks("managegroup_do_joinrequests_start");

$uidin = null;

	$plugins->run_hooks("managegroup_do_joinrequests_start");

$uidin = null;

	if(is_array($mybb->get_input('request', 2)))

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

	{
$uidin = array();

	{
$uidin = array();

		foreach($mybb->get_input('request', 2) as $uid => $what)

		foreach($mybb->get_input('request', MyBB::INPUT_ARRAY) as $uid => $what)

		{
if($what == "accept")
{

		{
if($what == "accept")
{

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 212Zeile 212
		$user['reason'] = htmlspecialchars_uni($user['reason']);
$altbg = alt_trow();
$regdate = my_date($mybb->settings['dateformat'], $user['regdate']);

		$user['reason'] = htmlspecialchars_uni($user['reason']);
$altbg = alt_trow();
$regdate = my_date($mybb->settings['dateformat'], $user['regdate']);

 
		$user['username'] = htmlspecialchars_uni($user['username']);

		$user['profilelink'] = build_profile_link($user['username'], $user['uid']);
eval("\$users .= \"".$templates->get("managegroup_joinrequests_request")."\";");
}
if(!$users)
{
error($lang->no_requests);

		$user['profilelink'] = build_profile_link($user['username'], $user['uid']);
eval("\$users .= \"".$templates->get("managegroup_joinrequests_request")."\";");
}
if(!$users)
{
error($lang->no_requests);

	}
$lang->join_requests = $lang->sprintf($lang->join_requests_title,htmlspecialchars_uni($usergroup['title']));

$plugins->run_hooks("managegroup_joinrequests_end");

	}
$lang->join_requests = $lang->sprintf($lang->join_requests_title, htmlspecialchars_uni($usergroup['title']));

$plugins->run_hooks("managegroup_joinrequests_end");


eval("\$joinrequests = \"".$templates->get("managegroup_joinrequests")."\";");
output_page($joinrequests);


eval("\$joinrequests = \"".$templates->get("managegroup_joinrequests")."\";");
output_page($joinrequests);

Zeile 230Zeile 231
{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));





	if($groupleader['canmanagemembers'] == 0)
{
error_no_permission();
}

	if($groupleader['canmanagemembers'] == 0)
{
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', 2)))

	if(!empty($users))

	{

	{

		foreach($mybb->get_input('removeuser', 2) as $uid)

		foreach($users as $uid)

		{
leave_usergroup($uid, $gid);
}

		{
leave_usergroup($uid, $gid);
}

Zeile 258Zeile 261
{
$plugins->run_hooks("managegroup_start");


{
$plugins->run_hooks("managegroup_start");


	$lang->members_of = $lang->sprintf($lang->members_of, $usergroup['title']);
$lang->add_member = $lang->sprintf($lang->add_member, $usergroup['title']);
$lang->invite_member = $lang->sprintf($lang->invite_member, $usergroup['title']);

	$lang->members_of = $lang->sprintf($lang->members_of, htmlspecialchars_uni($usergroup['title']));
$lang->add_member = $lang->sprintf($lang->add_member, htmlspecialchars_uni($usergroup['title']));
$lang->invite_member = $lang->sprintf($lang->invite_member, htmlspecialchars_uni($usergroup['title']));

	$joinrequests = '';
if($usergroup['type'] == 5)
{

	$joinrequests = '';
if($usergroup['type'] == 5)
{

Zeile 274Zeile 277
		{
$lang->num_requests_pending = $lang->sprintf($lang->num_requests_pending, $numrequests['req']);
eval("\$joinrequests = \"".$templates->get("managegroup_requestnote")."\";");

		{
$lang->num_requests_pending = $lang->sprintf($lang->num_requests_pending, $numrequests['req']);
eval("\$joinrequests = \"".$templates->get("managegroup_requestnote")."\";");

		}

		}

		$usergrouptype = $lang->group_public_moderated;
}
elseif($usergroup['type'] == 3)

		$usergrouptype = $lang->group_public_moderated;
}
elseif($usergroup['type'] == 3)

Zeile 299Zeile 302
		LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=g.uid)
WHERE g.gid = '{$gid}'
");

		LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=g.uid)
WHERE g.gid = '{$gid}'
");

 

$leaders_array = array();


	if($db->num_rows($query))
{
$loop = 1;

	if($db->num_rows($query))
{
$loop = 1;

Zeile 306Zeile 312
		$leader_count = $db->num_rows($query);
while($leader = $db->fetch_array($query))
{

		$leader_count = $db->num_rows($query);
while($leader = $db->fetch_array($query))
{

			$leader_name = format_name(htmlspecialchars_uni($leader['username']), $leader['usergroup'], $leader['displaygroup']);


			$leader['username'] = htmlspecialchars_uni($leader['username']);
$leader_name = format_name($leader['username'], $leader['usergroup'], $leader['displaygroup']);

			$leader_profile_link = build_profile_link($leader_name, $leader['uid']);

			$leader_profile_link = build_profile_link($leader_name, $leader['uid']);






$leaders_array[] = $leader['uid'];


			// Get commas...
if($loop != $leader_count)

			// Get commas...
if($loop != $leader_count)

			{

			{

				$comma = $lang->comma;
}
else

				$comma = $lang->comma;
}
else

Zeile 321Zeile 330

++$loop;
eval("\$leaders .= \"".$templates->get("managegroup_leaders_bit")."\";");


++$loop;
eval("\$leaders .= \"".$templates->get("managegroup_leaders_bit")."\";");

		}

eval("\$group_leaders = \"".$templates->get("managegroup_leaders")."\";");
}

		}

eval("\$group_leaders = \"".$templates->get("managegroup_leaders")."\";");
}


switch($db->type)


switch($db->type)

	{

	{

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

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


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


	$numusers = $db->num_rows($query);
/*if(!$numusers && !$numrequests)
{
error($lang->group_no_members);
}*/
$perpage = $mybb->settings['membersperpage'];
$page = $mybb->get_input('page', 1);



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

$perpage = (int)$mybb->settings['membersperpage'];
if($perpage < 1)
{
$perpage = 20;
}

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

	if($page && $page > 0)
{

	if($page && $page > 0)
{

		$start = ($page-1) *$perpage;







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

	}
else
{

	}
else
{

Zeile 353Zeile 370
		$page = 1;
}
$multipage = multipage($numusers, $perpage, $page, "managegroup.php?gid=".$gid);

		$page = 1;
}
$multipage = multipage($numusers, $perpage, $page, "managegroup.php?gid=".$gid);

 

switch($db->type)
{
case "pgsql":
case "sqlite":
$query = $db->simple_select("users", "*", "','||additionalgroups||',' LIKE '%,{$gid},%' OR usergroup='{$gid}'", array('order_by' => 'username', 'limit' => $perpage, 'limit_start' => $start));
break;
default:
$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 373Zeile 402
		{
$email = '';
}

		{
$email = '';
}

		$query1 = $db->simple_select("groupleaders", "uid", "uid='{$user['uid']}' AND gid='{$gid}'");
$isleader = $db->fetch_array($query1);


$user['username'] = htmlspecialchars_uni($user['username']);

		$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
$user['profilelink'] = build_profile_link($user['username'], $user['uid']);

		$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
$user['profilelink'] = build_profile_link($user['username'], $user['uid']);

		if($isleader['uid'])

		if(in_array($user['uid'], $leaders_array))

		{
$leader = $lang->leader;
}

		{
$leader = $lang->leader;
}

Zeile 387Zeile 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)