Zeile 3 | Zeile 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 2454 2006-11-28 17:30:16Z CraKteR $
| * $Id: adminfunctions.php 3156 2007-06-24 12:49:57Z CraKteR $
|
*/
$cssselectors = array(
| */
$cssselectors = array(
|
Zeile 84 | Zeile 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 638 | Zeile 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"; endtable(); }
| echo "</table>\n"; echo "</td>\n"; echo "</tr>\n"; endtable(); }
|
function makecssreputationedit($css) { global $lang;
| function makecssreputationedit($css) { global $lang;
|
Zeile 651 | Zeile 652 |
---|
tableheader($lang->reputation_system, "", 3); echo "<tr>\n<td class=\"subheader\" align=\"center\">".$lang->positive_reputation_count."</td><td class=\"subheader\" align=\"center\">".$lang->neutral_reputation_count."</td><td class=\"subheader\" align=\"center\">".$lang->negative_reputation_count."</td>\n</tr>\n"; echo "<tr>\n";
|
tableheader($lang->reputation_system, "", 3); echo "<tr>\n<td class=\"subheader\" align=\"center\">".$lang->positive_reputation_count."</td><td class=\"subheader\" align=\"center\">".$lang->neutral_reputation_count."</td><td class=\"subheader\" align=\"center\">".$lang->negative_reputation_count."</td>\n</tr>\n"; echo "<tr>\n";
|
echo "<td class=\"altbg1\" width=\"33%\" valign=\"top\">\n"; echo "<table width=\"100%\">\n";
| echo "<td class=\"altbg1\" width=\"33%\" valign=\"top\">\n"; echo "<table width=\"100%\">\n";
|
echo "<tr>\n<td>".$lang->font_color."</td>\n<td><input type=\"text\" name=\"css[reputation_positive][color]\" value=\"".htmlspecialchars_uni($css['reputation_positive']['color'])."\" size=\"25\" class=\"inputbox\"/></td>\n</tr>\n"; echo "</table>\n"; echo "</td>\n"; echo "<td class=\"altbg1\" width=\"33%\" valign=\"top\">\n"; echo "<table width=\"100%\">\n"; echo "<tr>\n<td>".$lang->font_color."</td>\n<td><input type=\"text\" name=\"css[reputation_neutral][color]\" value=\"".htmlspecialchars_uni($css['reputation_neutral']['color'])."\" size=\"25\" class=\"inputbox\"/></td>\n</tr>\n";
|
echo "<tr>\n<td>".$lang->font_color."</td>\n<td><input type=\"text\" name=\"css[reputation_positive][color]\" value=\"".htmlspecialchars_uni($css['reputation_positive']['color'])."\" size=\"25\" class=\"inputbox\"/></td>\n</tr>\n"; echo "</table>\n"; echo "</td>\n"; echo "<td class=\"altbg1\" width=\"33%\" valign=\"top\">\n"; echo "<table width=\"100%\">\n"; echo "<tr>\n<td>".$lang->font_color."</td>\n<td><input type=\"text\" name=\"css[reputation_neutral][color]\" value=\"".htmlspecialchars_uni($css['reputation_neutral']['color'])."\" size=\"25\" class=\"inputbox\"/></td>\n</tr>\n";
|
echo "</table>\n"; echo "</td>\n"; echo "<td class=\"altbg1\" width=\"33%\" valign=\"top\">\n";
| echo "</table>\n"; echo "</td>\n"; echo "<td class=\"altbg1\" width=\"33%\" valign=\"top\">\n";
|
echo "<table width=\"100%\">\n"; echo "<tr>\n<td>".$lang->font_color."</td>\n<td><input type=\"text\" name=\"css[reputation_negative][color]\" value=\"".htmlspecialchars_uni($css['reputation_negative']['color'])."\" size=\"25\" class=\"inputbox\"/></td>\n</tr>\n"; echo "</table>\n";
| echo "<table width=\"100%\">\n"; echo "<tr>\n<td>".$lang->font_color."</td>\n<td><input type=\"text\" name=\"css[reputation_negative][color]\" value=\"".htmlspecialchars_uni($css['reputation_negative']['color'])."\" size=\"25\" class=\"inputbox\"/></td>\n</tr>\n"; echo "</table>\n";
|
Zeile 731 | Zeile 732 |
---|
$inheritedfrom = $tcache[$inheritid]['name']; $highlight = "highlight3"; $name .= "(".$lang->inherited_from." ".$inheritedfrom.")";
|
$inheritedfrom = $tcache[$inheritid]['name']; $highlight = "highlight3"; $name .= "(".$lang->inherited_from." ".$inheritedfrom.")";
|
}
| }
|
elseif($css[$element]['inherited'] == 1) { }
| elseif($css[$element]['inherited'] == 1) { }
|
Zeile 766 | Zeile 767 |
---|
$submit = makebuttoncode($lang->save_changes, $lang->save_changes, "submit"); tablesubheader("<div style=\"float: right;\">$submit</div>", "", 2, "left"); endtable();
|
$submit = makebuttoncode($lang->save_changes, $lang->save_changes, "submit"); tablesubheader("<div style=\"float: right;\">$submit</div>", "", 2, "left"); endtable();
|
}
| }
|
function endtable() { echo "</table>\n";
| function endtable() { echo "</table>\n";
|
Zeile 776 | Zeile 777 |
---|
function endform($submit="", $reset="") { if($submit || $reset)
|
function endform($submit="", $reset="") { if($submit || $reset)
|
{
| {
|
echo "<div align=\"center\">\n<div class=\"formbuttons\">\n";
|
echo "<div align=\"center\">\n<div class=\"formbuttons\">\n";
|
}
| }
|
if($submit) {
|
if($submit) {
|
echo makebuttoncode($submit, $submit, "submit"); } if($reset) {
| echo makebuttoncode($submit, $submit, "submit"); } if($reset) {
|
echo makebuttoncode($reset, $reset, "reset"); } if($submit || $reset)
| echo makebuttoncode($reset, $reset, "reset"); } if($submit || $reset)
|
Zeile 891 | Zeile 892 |
---|
{ $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." © 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." © 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>"; }
|
Zeile 1063 | Zeile 1064 |
---|
foreach($cforumcache['pid'][$fid] as $forum) { forumselect($name, $selected, $forum[fid], $depth, $shownone, $extra, $extra2);
|
foreach($cforumcache['pid'][$fid] as $forum) { forumselect($name, $selected, $forum[fid], $depth, $shownone, $extra, $extra2);
|
} }
| } }
|
if(!$fid) { $forumselect .= "</select>";
| if(!$fid) { $forumselect .= "</select>";
|
Zeile 1099 | Zeile 1100 |
---|
}
if(!$fid)
|
}
if(!$fid)
|
{
| {
|
if($extra) { $selected1 = '';
| if($extra) { $selected1 = '';
|
Zeile 1119 | Zeile 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(in_array($startforum['fid'], $selected) || (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 1152 | Zeile 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 {
|