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: adminoptions.php 2164 2006-08-30 06:17:49Z chris $
| * $Id: adminoptions.php 3705 2008-03-10 07:16:52Z dennis $
|
*/
define("IN_MYBB", 1);
| */
define("IN_MYBB", 1);
|
Zeile 38 | Zeile 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 47 | Zeile 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 103 | Zeile 104 |
---|
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 130 | Zeile 132 |
---|
"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 138 | Zeile 140 |
---|
// 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 156 | Zeile 158 |
---|
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 228 | Zeile 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 246 | Zeile 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 253 | Zeile 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 262 | Zeile 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 341 | Zeile 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");
|