Vergleich admin/adminoptions.php - 1.2.0 - 1.2.12

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 3Zeile 3
 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * Website: http://www.mybboard.com
* License: http://www.mybboard.com/eula.html

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/eula.html

 *

 *

 * $Id: adminoptions.php 2164 2006-08-30 06:17:49Z chris $

 * $Id: adminoptions.php 2932 2007-03-10 05:48:55Z chris $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 103Zeile 103
	if(!isset($adminoptions['permsset']))
{
$options_update = array(

	if(!isset($adminoptions['permsset']))
{
$options_update = array(

			"uid" => $uid


			"uid" => $uid,
"notes" => ""

		);
$db->insert_query(TABLE_PREFIX."adminoptions", $options_update);
}

		);
$db->insert_query(TABLE_PREFIX."adminoptions", $options_update);
}

Zeile 130Zeile 131
		"caneditlangs" => $db->escape_string($newperms['caneditlangs']),
"canrunmaint" => $db->escape_string($newperms['canrunmaint']),
"canrundbtools" => $db->escape_string($newperms['canrundbtools']),

		"caneditlangs" => $db->escape_string($newperms['caneditlangs']),
"canrunmaint" => $db->escape_string($newperms['canrunmaint']),
"canrundbtools" => $db->escape_string($newperms['canrundbtools']),

		);

	);

		
$plugins->run_hooks("admin_adminoptions_do_updateperms");


		
$plugins->run_hooks("admin_adminoptions_do_updateperms");


Zeile 138Zeile 139

// Redirect based on what the user did.
if($uid == 0)


// Redirect based on what the user did.
if($uid == 0)

	{

	{

		cpredirect("adminoptions.php?".SID."&action=adminpermissions", $lang->default_perms_updated);

		cpredirect("adminoptions.php?".SID."&action=adminpermissions", $lang->default_perms_updated);

	}

	}

	elseif($uid < 0)
{
cpredirect("adminoptions.php?".SID."&action=adminpermissions", $lang->group_perms_updated);

	elseif($uid < 0)
{
cpredirect("adminoptions.php?".SID."&action=adminpermissions", $lang->group_perms_updated);

	}

	}

	else

	else

	{

	{

		cpredirect("adminoptions.php?".SID."&action=adminpermissions", $lang->perms_updated);

		cpredirect("adminoptions.php?".SID."&action=adminpermissions", $lang->perms_updated);

	}

	}

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

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

Zeile 156Zeile 157
	if(is_super_admin($uid) && $mybb->user['uid'] != $uid)
{
cperror($lang->cannot_perform_action_super_admin);

	if(is_super_admin($uid) && $mybb->user['uid'] != $uid)
{
cperror($lang->cannot_perform_action_super_admin);

	}
checkadminpermissions("caneditaperms");


	}
checkadminpermissions("caneditaperms");


	$plugins->run_hooks("admin_adminoptions_updateperms");

if($uid > 0)

	$plugins->run_hooks("admin_adminoptions_updateperms");

if($uid > 0)

Zeile 228Zeile 229
if($mybb->input['action'] == "adminpermissions")
{
$plugins->run_hooks("admin_adminoptions_adminpermissions");

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

	
$usergroups = array();

 




 
	checkadminpermissions("caneditaperms");

// Get usergroups with ACP access
$usergroups = array();

	$query = $db->simple_select(TABLE_PREFIX."usergroups", "*", "cancp='yes'");
while($usergroup = $db->fetch_array($query))
{
$usergroups[$usergroup['gid']] = $usergroup;
}

	$query = $db->simple_select(TABLE_PREFIX."usergroups", "*", "cancp='yes'");
while($usergroup = $db->fetch_array($query))
{
$usergroups[$usergroup['gid']] = $usergroup;
}

	checkadminpermissions("caneditaperms");



	cpheader();
starttable();
tableheader($lang->admin_perms.makelinkcode($lang->edit_default, "adminoptions.php?".SID."&action=updateperms&uid=0", "", "header"), "", 4);

	cpheader();
starttable();
tableheader($lang->admin_perms.makelinkcode($lang->edit_default, "adminoptions.php?".SID."&action=updateperms&uid=0", "", "header"), "", 4);

Zeile 246Zeile 249
	echo "<td class=\"subheader\">$lang->perm_options</td>\n";
echo "<td class=\"subheader\">$lang->options</td>\n";
echo "</tr>\n";

	echo "<td class=\"subheader\">$lang->perm_options</td>\n";
echo "<td class=\"subheader\">$lang->options</td>\n";
echo "</tr>\n";

 
	// Get users whose primary or secondary usergroup has ACP access
$comma = $primary_group_list = $secondary_group_list = '';
foreach($usergroups as $gid => $group_info)
{
$primary_group_list .= $comma.$gid;
$secondary_group_list .= " OR CONCAT(',', u.additionalgroups,',') LIKE '%,{$gid},%'";
$comma = ',';
}

	$group_list = implode(',', array_keys($usergroups));
$secondary_groups = ','.$group_list.',';
$query = $db->query("

	$group_list = implode(',', array_keys($usergroups));
$secondary_groups = ','.$group_list.',';
$query = $db->query("

Zeile 253Zeile 264
		FROM ".TABLE_PREFIX."users u
LEFT JOIN ".TABLE_PREFIX."adminoptions a
ON (a.uid=u.uid)

		FROM ".TABLE_PREFIX."users u
LEFT JOIN ".TABLE_PREFIX."adminoptions a
ON (a.uid=u.uid)

		WHERE (u.usergroup IN ($group_list) OR CONCAT(',', u.additionalgroups,',')
LIKE '%{$secondary_groups}%')

		WHERE (u.usergroup IN ({$primary_group_list}) {$secondary_group_list})


		ORDER BY u.username ASC
");
while($admin = $db->fetch_array($query))

		ORDER BY u.username ASC
");
while($admin = $db->fetch_array($query))

Zeile 262Zeile 272
		$la = my_date($mybb->settings['dateformat'].",".$mybb->settings['timeformat'], $admin['lastactive']);
$bgcolor = getaltbg();
$usergroup_list = array();

		$la = my_date($mybb->settings['dateformat'].",".$mybb->settings['timeformat'], $admin['lastactive']);
$bgcolor = getaltbg();
$usergroup_list = array();

		// Build a list of group memberships that have access to the admin CP


		// Build a list of group memberships that have access to the Admin CP
// Primary usergroup?

		if($usergroups[$admin['usergroup']]['cancp'] == "yes")
{
$usergroup_list[] = $usergroups[$admin['usergroup']]['title'];
}

		if($usergroups[$admin['usergroup']]['cancp'] == "yes")
{
$usergroup_list[] = $usergroups[$admin['usergroup']]['title'];
}

 
		// Secondary usergroups?

		$additional_groups = explode(',', $admin['additionalgroups']);
if(is_array($additional_groups))
{

		$additional_groups = explode(',', $admin['additionalgroups']);
if(is_array($additional_groups))
{