Vergleich admin/adminfunctions.php - 1.2.0 - 1.2.9

  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: adminfunctions.php 2164 2006-08-30 06:17:49Z chris $

 * $Id: adminfunctions.php 3156 2007-06-24 12:49:57Z CraKteR $

 */

$cssselectors = array(

 */

$cssselectors = array(

Zeile 84Zeile 84
	{
$htmltag = str_replace("<html", "<html lang=\"".$lang->settings['htmllang']."\"", $htmltag);
}

	{
$htmltag = str_replace("<html", "<html lang=\"".$lang->settings['htmllang']."\"", $htmltag);
}

 


	echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
echo $htmltag;
echo "<head>\n";

	echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
echo $htmltag;
echo "<head>\n";

Zeile 116Zeile 117
	echo "<tr><td class=\"hoptobuttons\">";
if(!is_array($links))
{

	echo "<tr><td class=\"hoptobuttons\">";
if(!is_array($links))
{

		$links[] = $links;

		$links = array($links);

	}
foreach($links as $key => $val)
{

	}
foreach($links as $key => $val)
{

Zeile 369Zeile 370
	}
if(!is_array($options))
{

	}
if(!is_array($options))
{

		$options[] = $options;

		$options = array($options);

	}
foreach($options as $value => $label)
{

	}
foreach($options as $value => $label)
{

Zeile 638Zeile 639
	echo "<table width=\"100%\">\n";
echo "<tr>\n<td>".$lang->background."</td>\n<td><input type=\"text\" name=\"css[popup_item_hovered][background]\" value=\"".htmlspecialchars_uni($css['popup_item_hovered']['background'])."\" size=\"25\" class=\"inputbox\"/></td>\n</tr>\n";
echo "<tr>\n<td>".$lang->font_color."</td>\n<td><input type=\"text\" name=\"css[popup_item_hovered][color]\" value=\"".htmlspecialchars_uni($css['popup_item_hovered']['color'])."\" size=\"25\" class=\"inputbox\"/></td>\n</tr>\n";

	echo "<table width=\"100%\">\n";
echo "<tr>\n<td>".$lang->background."</td>\n<td><input type=\"text\" name=\"css[popup_item_hovered][background]\" value=\"".htmlspecialchars_uni($css['popup_item_hovered']['background'])."\" size=\"25\" class=\"inputbox\"/></td>\n</tr>\n";
echo "<tr>\n<td>".$lang->font_color."</td>\n<td><input type=\"text\" name=\"css[popup_item_hovered][color]\" value=\"".htmlspecialchars_uni($css['popup_item_hovered']['color'])."\" size=\"25\" class=\"inputbox\"/></td>\n</tr>\n";

	echo "</table>\n";
echo "</td>\n";
echo "</tr>\n";

	echo "</table>\n";
echo "</td>\n";
echo "</tr>\n";

	endtable();
}


	endtable();
}


Zeile 879Zeile 880
function cpfooter($showversion=1)
{
global $mybb, $db, $maintimer, $lang;

function cpfooter($showversion=1)
{
global $mybb, $db, $maintimer, $lang;

 


	echo "<div align=\"center\">\n<br />\n<br />\n";
$totaltime = $maintimer->stop();
$lang->footer_stats = sprintf($lang->footer_stats, $totaltime, $db->query_count);
if(!$showversion)
{
$mybbversion = "";

	echo "<div align=\"center\">\n<br />\n<br />\n";
$totaltime = $maintimer->stop();
$lang->footer_stats = sprintf($lang->footer_stats, $totaltime, $db->query_count);
if(!$showversion)
{
$mybbversion = "";

	}
else
{

	}
else
{

		$mybbversion = $mybb->version;
}

		$mybbversion = $mybb->version;
}

	echo "<font size=\"1\" face=\"Verdana,Arial,Helvetica\">\n".$lang->footer_powered_by."\n<b>\n<a href=\"http://www.mybboard.com\" target=\"_blank\">MyBB</a> $mybbversion\n</b>\n<br />\n".$lang->footer_copyright." &copy; 2002-".my_date("Y")." <a href=\"http://www.mybboard.com\">MyBB Group</a>\n<br />\n".$lang->footer_stats."\n</font>\n</div>\n";

	echo "<font size=\"1\" face=\"Verdana,Arial,Helvetica\">\n".$lang->footer_powered_by."\n<b>\n<a href=\"http://www.mybboard.net\" target=\"_blank\">MyBB</a> $mybbversion\n</b>\n<br />\n".$lang->footer_copyright." &copy; 2002-".my_date("Y")." <a href=\"http://www.mybboard.net\">MyBB Group</a>\n<br />\n".$lang->footer_stats."\n</font>\n</div>\n";

	echo "</body>\n";
echo "</html>";

	echo "</body>\n";
echo "</html>";

}

}


function getaltbg()
{


function getaltbg()
{

Zeile 907Zeile 909
		$bgcolor = "altbg1";
}
return $bgcolor;

		$bgcolor = "altbg1";
}
return $bgcolor;

}

}

function startnav()
{
echo "<table cellpadding=\"1\" cellspacing=\"0\" border=\"0\" align=\"center\" width=\"100%\" class=\"lnavbordercolor\">\n";

function startnav()
{
echo "<table cellpadding=\"1\" cellspacing=\"0\" border=\"0\" align=\"center\" width=\"100%\" class=\"lnavbordercolor\">\n";

Zeile 917Zeile 919
function makenavoption($name, $url)
{
global $navoptions;

function makenavoption($name, $url)
{
global $navoptions;

	$navoptions .= "<li>\n\t<a href=\"$url\">$name</a>\n</li>\n";
}

	$navoptions .= "<li>\n\t<a href=\"$url\">$name</a>\n</li>\n";
}

function makenavselect($name)
{
global $navoptions, $navselects;

function makenavselect($name)
{
global $navoptions, $navselects;

Zeile 933Zeile 935
	echo "<ul>\n";
echo $navoptions;
echo "</ul>\n</td>\n";

	echo "<ul>\n";
echo $navoptions;
echo "</ul>\n</td>\n";

	echo "</table>\n";

	echo "</table>\n";

	echo "</td>\n</tr>\n</table>\n";
echo "<br />\n";


	echo "</td>\n</tr>\n</table>\n";
echo "<br />\n";


Zeile 967Zeile 969
}

function makehopper($name, $values, $onchange="")

}

function makehopper($name, $values, $onchange="")

{

{

	if(!is_array($values))

	if(!is_array($values))

	{
$values[] = $values;
}
foreach($values as $action => $title)

	{
$values = array($values);
}
foreach($values as $action => $title)

	{
$options .= "<option value=\"$action\">$title</option>\n";
}
$buttononchange = "";
if($onchange)
{

	{
$options .= "<option value=\"$action\">$title</option>\n";
}
$buttononchange = "";
if($onchange)
{

	  $buttononchange = " onclick=\"{$onchange} this.form.submit(); return false;\"";
$onchange .= " ";
}

	  	$buttononchange = " onclick=\"{$onchange} this.form.submit(); return false;\"";
$onchange .= " ";
}

	return "<select name=\"$name\" onchange=\"{$onchange}this.form.submit();\">\n$options</select>\n&nbsp;\n<input type=\"submit\" value=\"Go\"$buttononchange />\n";
}


	return "<select name=\"$name\" onchange=\"{$onchange}this.form.submit();\">\n$options</select>\n&nbsp;\n<input type=\"submit\" value=\"Go\"$buttononchange />\n";
}


Zeile 1021Zeile 1023
		{
$selected1 = '';
if($selected == -1)

		{
$selected1 = '';
if($selected == -1)

			{

			{

				$selected1 = ' selected="selected"';

				$selected1 = ' selected="selected"';

			}

			}

			$forumselect .= "<option value=\"-1\"$selected1>$extra</option>";

			$forumselect .= "<option value=\"-1\"$selected1>$extra</option>";

		}

		}

		if($extra2)

		if($extra2)

		{

		{

			$selected2 = '';
if($selected == -2)
{

			$selected2 = '';
if($selected == -2)
{

Zeile 1038Zeile 1040
		if($extra || $extra2)
{
$forumselect .= "<option value=\"0\">-----------</option>";

		if($extra || $extra2)
{
$forumselect .= "<option value=\"0\">-----------</option>";

		}

		}

		if($shownone)

		if($shownone)

		{

		{

			$forumselect .= "<option value=\"0\">$lang->parentforum_none</option><option value=\"0\">-----------</option>";

			$forumselect .= "<option value=\"0\">$lang->parentforum_none</option><option value=\"0\">-----------</option>";

		}

		}

		$fid = 0;

		$fid = 0;

	}

	}

	else

	else

	{

	{

		$startforum = $cforumcache['fid'][$fid];
$forumselect .= "<option value=\"$startforum[fid]\"";
if($selected == $startforum[fid])

		$startforum = $cforumcache['fid'][$fid];
$forumselect .= "<option value=\"$startforum[fid]\"";
if($selected == $startforum[fid])

		{

		{

			$forumselect .= " selected";
}
$forumselect .= ">$depth$startforum[name]</option>";
$depth .= "--";

			$forumselect .= " selected";
}
$forumselect .= ">$depth$startforum[name]</option>";
$depth .= "--";

	}

if(is_array($cforumcache['pid'][$fid]))
{
foreach($cforumcache['pid'][$fid] as $forum)
{

	}

if(is_array($cforumcache['pid'][$fid]))
{
foreach($cforumcache['pid'][$fid] as $forum)
{

			forumselect($name, $selected, $forum[fid], $depth, $shownone, $extra, $extra2);
}
}

			forumselect($name, $selected, $forum[fid], $depth, $shownone, $extra, $extra2);
}
}

Zeile 1094Zeile 1096
		{
$cforumcache['pid'][$forum['pid']][$forum['fid']] = $forum;
$cforumcache['fid'][$forum['fid']] = $forum;

		{
$cforumcache['pid'][$forum['pid']][$forum['fid']] = $forum;
$cforumcache['fid'][$forum['fid']] = $forum;

		}
}

		}
}


if(!$fid)
{
if($extra)
{
$selected1 = '';


if(!$fid)
{
if($extra)
{
$selected1 = '';

			if($selected == -1)





			if(!is_array($selected)) 
{
$selected = array($selected);
}
if(in_array(-1, $selected))

			{
$selected1 = ' checked="checked"';
}

			{
$selected1 = ' checked="checked"';
}

Zeile 1114Zeile 1120
	{
$startforum = $cforumcache['fid'][$fid];
$forumchecklist .= "$depth<input type=\"checkbox\" name=\"{$name}[]\" value=\"$startforum[fid]\"";

	{
$startforum = $cforumcache['fid'][$fid];
$forumchecklist .= "$depth<input type=\"checkbox\" name=\"{$name}[]\" value=\"$startforum[fid]\"";

		if($selected == $startforum['fid'] || (is_array($selected) && in_array($forum['fid'], $selected)))

		if(is_array($selected) && (in_array($startforum['fid'], $selected) || in_array($forum['fid'], $selected)))

		{
$forumchecklist .= ' checked="checked"';
}

		{
$forumchecklist .= ' checked="checked"';
}

Zeile 1147Zeile 1153
function getadminpermissions($get_uid="", $get_gid="")
{
global $db, $mybb;

function getadminpermissions($get_uid="", $get_gid="")
{
global $db, $mybb;

 
	

	// Set UID and GID if none
$uid = $get_uid;
$gid = $get_gid;

	// Set UID and GID if none
$uid = $get_uid;
$gid = $get_gid;

 
	
$gid_array = array();


	if($uid === "")
{
$uid = $mybb->user['uid'];
}

	if($uid === "")
{
$uid = $mybb->user['uid'];
}

 
	

	if(!$gid)
{

	if(!$gid)
{

		$gid = $mybb->usergroup['gid'];














		// Prepare user's groups since the group isn't specified
$gid_array[] = (-1) * intval($mybb->user['usergroup']);
$additional_groups = explode(',', $mybb->user['additionalgroups']);
// Make sure gids are negative
foreach($additional_groups as $g)
{
$gid_array[] = (-1) * abs($g);
}
}
else
{
// Group is specified
// Make sure gid is negative
$gid = (-1) * abs($gid);

	}

	}


// Make sure gid is negative
$gid = (-1) * abs($gid);

 

// What are we trying to find?
if($get_gid && !$get_uid)
{


// What are we trying to find?
if($get_gid && !$get_uid)
{

 
		// A group only


		$options = array(
"order_by" => "uid",
"order_dir" => "ASC",
"limit" => "1"
);


		$options = array(
"order_by" => "uid",
"order_dir" => "ASC",
"limit" => "1"
);


		// A group only

 
		$query = $db->simple_select(TABLE_PREFIX."adminoptions", "*", "(uid='$gid' OR uid='0') AND permsset != ''", $options);
$perms = $db->fetch_array($query);
return $perms;
}
else
{

		$query = $db->simple_select(TABLE_PREFIX."adminoptions", "*", "(uid='$gid' OR uid='0') AND permsset != ''", $options);
$perms = $db->fetch_array($query);
return $perms;
}
else
{

 
		// A user and/or group


		$options = array(
"order_by" => "uid",
"order_dir" => "DESC"
);

		$options = array(
"order_by" => "uid",
"order_dir" => "DESC"
);

		// A user and/or group
$query = $db->simple_select(TABLE_PREFIX."adminoptions", "*", "(uid='$uid' OR uid='0' OR uid='$gid') AND permsset != ''", $options);









		
// Prepare user's groups into SQL format
$group_sql = '';
foreach($gid_array as $gid)
{
$group_sql .= " OR uid='{$gid}'";
}

$perms_group = array();
$query = $db->simple_select(TABLE_PREFIX."adminoptions", "*", "(uid='{$uid}'{$group_sql}) AND permsset != ''", $options);

		while($perm = $db->fetch_array($query))

		while($perm = $db->fetch_array($query))

		{

		{

			// Sorting out which permission is which
if($perm['uid'] > 0)

			// Sorting out which permission is which
if($perm['uid'] > 0)

			{

			{

				$perms_user = $perm;

				$perms_user = $perm;

			}


				return $perms_user;
}

			elseif($perm['uid'] < 0)

			elseif($perm['uid'] < 0)

			{
$perms_group = $perm;

			{
$perms_group[] = $perm;

			}
else
{
$perms_def = $perm;

			}
else
{
$perms_def = $perm;

 
			}
}

// Figure out group permissions...ugh.
foreach($perms_group as $gperms)
{
if(!isset($final_group_perms))
{
// Use this group as the base for admin group permissions
$final_group_perms = $gperms;
continue;
}

// Loop through each specific permission to find the highest permission
foreach($gperms as $perm_name => $perm_value)
{
if($final_group_perms[$perm_name] != 'yes' && $perm_value == 'yes')
{
$final_group_perms[$perm_name] = 'yes';
}

			}
}

// Send specific user, or group permissions before default.

			}
}

// Send specific user, or group permissions before default.

		if(isset($perms_user))
{
return $perms_user;
}
elseif(isset($perms_group))

		// If user's permission are explicitly set, they've already been returned above.
if(isset($final_group_perms))




		{

		{

			return $perms_group;

			return $final_group_perms;

		}
else
{

		}
else
{

Zeile 1988Zeile 2037
				{
echo "<option value=\"default\">- $lang->set_as_default</option>";
}

				{
echo "<option value=\"default\">- $lang->set_as_default</option>";
}

 
				echo "<option value=\"\" style=\"font-weight: bold;\">$lang->theme_style</option>";
echo "<option value=\"edit\" selected>- $lang->edit_theme_style</option>\n";

			}

			}

			echo "<option value=\"\" style=\"font-weight: bold;\">$lang->theme_style</option>";
echo "<option value=\"edit\" selected>- $lang->edit_theme_style</option>\n";

 
			echo "<option value=\"\" style=\"font-weight: bold;\">$lang->other_options</option>\n";
echo "<option value=\"download\">- $lang->export_theme</option>\n";
echo "</select>&nbsp;<input type=\"button\" onclick=\"theme_hop($theme[tid]);\" value=\"$lang->go\" /></td>\n";

			echo "<option value=\"\" style=\"font-weight: bold;\">$lang->other_options</option>\n";
echo "<option value=\"download\">- $lang->export_theme</option>\n";
echo "</select>&nbsp;<input type=\"button\" onclick=\"theme_hop($theme[tid]);\" value=\"$lang->go\" /></td>\n";

Zeile 2362Zeile 2411
function is_super_admin($uid)
{
global $config;

function is_super_admin($uid)
{
global $config;

 
	$config['super_admins'] = str_replace(" ", "", $config['super_admins']);

	if(strpos(",{$config['super_admins']},", ",{$uid},") === false)
{
return false;

	if(strpos(",{$config['super_admins']},", ",{$uid},") === false)
{
return false;