Vergleich admin/adminoptions.php - 1.2.2 - 1.2.14

  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 2385 2006-11-06 23:40:55Z Tikitiki $

 * $Id: adminoptions.php 3705 2008-03-10 07:16:52Z dennis $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 38Zeile 38
	$options = array(
"limit" => "1"
);

	$options = array(
"limit" => "1"
);

	$query = $db->simple_select(TABLE_PREFIX."adminoptions", "*", "uid='$user[uid]'", $options);

	$query = $db->simple_select(TABLE_PREFIX."adminoptions", "*", "uid='{$mybb->user['uid']}'", $options);

	$adminoptions = $db->fetch_array($query);
$sqlarray = array(
"notes" => $db->escape_string($mybb->input['notes']),

	$adminoptions = $db->fetch_array($query);
$sqlarray = array(
"notes" => $db->escape_string($mybb->input['notes']),

Zeile 47Zeile 47
	$plugins->run_hooks("admin_adminoptions_do_updateprefs");
if(isset($adminoptions['uid']))
{

	$plugins->run_hooks("admin_adminoptions_do_updateprefs");
if(isset($adminoptions['uid']))
{

		$db->update_query(TABLE_PREFIX."adminoptions", $sqlarray, "uid='".$user['uid']."'");

		$db->update_query(TABLE_PREFIX."adminoptions", $sqlarray, "uid='".$mybb->user['uid']."'");

	}
else
{

	}
else
{

 
		$sqlarray['uid'] = $mybb->user['uid'];

		$db->insert_query(TABLE_PREFIX."adminoptions", $sqlarray);
}
cpredirect("adminoptions.php?".SID, $lang->prefs_updated);

		$db->insert_query(TABLE_PREFIX."adminoptions", $sqlarray);
}
cpredirect("adminoptions.php?".SID, $lang->prefs_updated);

Zeile 229Zeile 230
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 247Zeile 250
	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 254Zeile 265
		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 263Zeile 273
		$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))
{

Zeile 342Zeile 354
if($mybb->input['action'] == "updateprefs" || $mybb->input['action'] == "")
{


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


	$query = $db->simple_select(TABLE_PREFIX."adminoptions", "*", "uid='$user[uid]'");

	$query = $db->simple_select(TABLE_PREFIX."adminoptions", "*", "uid='{$mybb->user['uid']}'");

	$adminoptions = $db->fetch_array($query);

$plugins->run_hooks("admin_adminoptions_updateprefs");

	$adminoptions = $db->fetch_array($query);

$plugins->run_hooks("admin_adminoptions_updateprefs");