Vergleich admin/adminfunctions.php - 1.2.1 - 1.2.4

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.com
* License: http://www.mybboard.com/eula.html
*

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

 * $Id: adminfunctions.php 2263 2006-09-26 09:24:25Z chris $

 * $Id: adminfunctions.php 2693 2007-02-03 06:23:22Z Tikitiki $

 */

$cssselectors = array(

 */

$cssselectors = array(

Zeile 116Zeile 116
	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 369
	}
if(!is_array($options))
{

	}
if(!is_array($options))
{

		$options[] = $options;

		$options = array($options);

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

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

Zeile 971Zeile 971
{
if(!is_array($values))
{

{
if(!is_array($values))
{

		$values[] = $values;

		$values = array($values);

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

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

Zeile 980Zeile 980
	$buttononchange = "";
if($onchange)
{

	$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 1152Zeile 1152
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))
{
// Sorting out which permission is which
if($perm['uid'] > 0)
{
$perms_user = $perm;

		while($perm = $db->fetch_array($query))
{
// Sorting out which permission is which
if($perm['uid'] > 0)
{
$perms_user = $perm;

 
				return $perms_user;

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

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

				$perms_group = $perm;

				$perms_group[] = $perm;

			}
else

			}
else

			{

			{

				$perms_def = $perm;

				$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))
{
return $perms_group;
}

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




		else
{
return $perms_def;

		else
{
return $perms_def;

Zeile 1242Zeile 1285
		}
}
$now = time();

		}
}
$now = time();





	$insertquery = array(
"uid" => $mybbadmin['uid'],
"dateline" => $now,

	$insertquery = array(
"uid" => $mybbadmin['uid'],
"dateline" => $now,

Zeile 1617Zeile 1660
	$theme = $tcache[$tid];
$cssbits = $theme['cssbits'];
if(!$cssbits[$selector])

	$theme = $tcache[$tid];
$cssbits = $theme['cssbits'];
if(!$cssbits[$selector])

	{
if($theme['pid'] > 0)
{

	{
if($theme['pid'] > 0)
{

			$cssbit = build_css_selector_array($theme['pid'], $selector, $addinherited);

			$cssbit = build_css_selector_array($theme['pid'], $selector, $addinherited);

		}

		}

	}
else // Is customized in this theme
{

	}
else // Is customized in this theme
{

Zeile 1635Zeile 1678
}

function build_theme_array($tid, $addinherited=1)

}

function build_theme_array($tid, $addinherited=1)

{

{

	global $db, $tcache, $themebitlist;
if(!is_array($tcache))
{

	global $db, $tcache, $themebitlist;
if(!is_array($tcache))
{

Zeile 1698Zeile 1741
		if(!$css || $isnew)
{
$css = unserialize($parent['cssbits']);

		if(!$css || $isnew)
{
$css = unserialize($parent['cssbits']);

		}

		}


}
// Build the actual css


}
// Build the actual css

Zeile 1713Zeile 1756
			$parentbit = $parentbits[$themebit];
$childbit = $themebits[$themebit];
if(($parentbit == $childbit || $revert_themebits[$themebit]) && $themebit != "extracss")

			$parentbit = $parentbits[$themebit];
$childbit = $themebits[$themebit];
if(($parentbit == $childbit || $revert_themebits[$themebit]) && $themebit != "extracss")

			{

			{

				$themebits['inherited'][$themebit] = $parentbits['inherited'][$themebit];
$themebits[$themebit] = $parentbit;
}

				$themebits['inherited'][$themebit] = $parentbits['inherited'][$themebit];
$themebits[$themebit] = $parentbit;
}

Zeile 1744Zeile 1787
		unset($cssbits);
$themebits = build_theme_array($pid);
unset($themebits['extracss']);

		unset($cssbits);
$themebits = build_theme_array($pid);
unset($themebits['extracss']);

	}

	}

	$csscontents = build_css($css);
return array("css" => $csscontents, "cssbits" => $cssbits, "themebits" => $themebits);
}

	$csscontents = build_css($css);
return array("css" => $csscontents, "cssbits" => $cssbits, "themebits" => $themebits);
}

Zeile 1870Zeile 1913
			"order_by" => "title",
"order_dir" => "ASC"
);

			"order_by" => "title",
"order_dir" => "ASC"
);





		$query = $db->simple_select(TABLE_PREFIX."templatesets", "*", "", $options);

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

		$query = $db->simple_select(TABLE_PREFIX."templatesets", "*", "", $options);

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

Zeile 1902Zeile 1945
	{
echo "</td>";
if($custom == 1)

	{
echo "</td>";
if($custom == 1)

		{

		{

			echo "<td><small><input type=\"checkbox\" name=\"revert_themebits[$name]\" id=\"revert_themebit_$name\" value=\"1\" /><label for=\"revert_themebit_$name\">".$lang->revert_customizations."</label></small></td>\n</tr>";
echo "<tr>\n<td colspan=\"2\" align=\"center\"><span class=\"smalltext\">$customnote</span></td>\n";
}

			echo "<td><small><input type=\"checkbox\" name=\"revert_themebits[$name]\" id=\"revert_themebit_$name\" value=\"1\" /><label for=\"revert_themebit_$name\">".$lang->revert_customizations."</label></small></td>\n</tr>";
echo "<tr>\n<td colspan=\"2\" align=\"center\"><span class=\"smalltext\">$customnote</span></td>\n";
}

Zeile 1917Zeile 1960
function cache_themes()
{
global $db, $tcache;

function cache_themes()
{
global $db, $tcache;





	$options = array(
"order_by" => "pid, name"
);

	$options = array(
"order_by" => "pid, name"
);

Zeile 1949Zeile 1992
		while($userstyle = $db->fetch_array($query))
{
$tcache[$userstyle['style']]['users'] = $userstyle['users'];

		while($userstyle = $db->fetch_array($query))
{
$tcache[$userstyle['style']]['users'] = $userstyle['users'];

		}

		}

		foreach($tcache as $theme)
{
$tcache2[$theme['pid']][$theme['tid']] = $theme;

		foreach($tcache as $theme)
{
$tcache2[$theme['pid']][$theme['tid']] = $theme;

Zeile 1995Zeile 2038
				}
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 "<option value=\"\" style=\"font-weight: bold;\">$lang->other_options</option>\n";
echo "<option value=\"download\">- $lang->export_theme</option>\n";