Zeile 49 | Zeile 49 |
---|
admin_redirect("index.php?module=user-admin_permissions"); }
|
admin_redirect("index.php?module=user-admin_permissions"); }
|
if($mybb->input['no'])
| if($mybb->get_input('no'))
|
{ admin_redirect("index.php?module=user-admin_permissions"); }
| { admin_redirect("index.php?module=user-admin_permissions"); }
|
Zeile 122 | Zeile 122 |
---|
{ foreach($mybb->input['permissions'] as $module => $actions) {
|
{ foreach($mybb->input['permissions'] as $module => $actions) {
|
$no_access = 0; foreach($actions as $action => $access)
| if(is_array($actions))
|
{
|
{
|
if($access == 0)
| $no_access = 0; foreach($actions as $action => $access)
|
{
|
{
|
++$no_access;
| if($access == 0) { ++$no_access; } } // User can't access any actions in this module - just disallow it completely if($no_access == count($actions)) { unset($mybb->input['permissions'][$module]);
|
} }
|
} }
|
// User can't access any actions in this module - just disallow it completely if($no_access == count($actions)) { unset($mybb->input['permissions'][$module]); } }
| }
|
// Does an options row exist for this admin already? $query = $db->simple_select("adminoptions", "COUNT(uid) AS existing_options", "uid='".$mybb->get_input('uid', MyBB::INPUT_INT)."'"); $existing_options = $db->fetch_field($query, "existing_options"); if($existing_options > 0)
|
// Does an options row exist for this admin already? $query = $db->simple_select("adminoptions", "COUNT(uid) AS existing_options", "uid='".$mybb->get_input('uid', MyBB::INPUT_INT)."'"); $existing_options = $db->fetch_field($query, "existing_options"); if($existing_options > 0)
|
{
| {
|
$db->update_query("adminoptions", array('permissions' => $db->escape_string(my_serialize($mybb->input['permissions']))), "uid = '".$mybb->get_input('uid', MyBB::INPUT_INT)."'"); } else
| $db->update_query("adminoptions", array('permissions' => $db->escape_string(my_serialize($mybb->input['permissions']))), "uid = '".$mybb->get_input('uid', MyBB::INPUT_INT)."'"); } else
|
Zeile 171 | Zeile 174 |
---|
$query = $db->simple_select("usergroups", "title", "gid='{$gid}'"); $group = $db->fetch_array($query); log_admin_action($uid, $group['title']);
|
$query = $db->simple_select("usergroups", "title", "gid='{$gid}'"); $group = $db->fetch_array($query); log_admin_action($uid, $group['title']);
|
}
| }
|
else { // Default
| else { // Default
|
Zeile 210 | Zeile 213 |
---|
$admin = $db->fetch_array($query); $permission_data = get_admin_permissions($uid, $admin['gid']);
|
$admin = $db->fetch_array($query); $permission_data = get_admin_permissions($uid, $admin['gid']);
|
$title = $admin['username'];
| $title = htmlspecialchars_uni($admin['username']);
|
$page->add_breadcrumb_item($lang->user_permissions, "index.php?module=user-admin_permissions"); } elseif($uid < 0)
| $page->add_breadcrumb_item($lang->user_permissions, "index.php?module=user-admin_permissions"); } elseif($uid < 0)
|
Zeile 294 | Zeile 297 |
---|
$form_container = new FormContainer("{$module['name']}"); foreach($module['permissions'] as $action => $title) {
|
$form_container = new FormContainer("{$module['name']}"); foreach($module['permissions'] as $action => $title) {
|
| if(!isset($permission_data[$key][$action])) { $permission_data[$key][$action] = 0; }
|
$form_container->output_row($title, "", $form->generate_yes_no_radio('permissions['.$key.']['.$action.']', (int)$permission_data[$key][$action], array('yes' => 1, 'no' => 0)), 'permissions['.$key.']['.$action.']');
|
$form_container->output_row($title, "", $form->generate_yes_no_radio('permissions['.$key.']['.$action.']', (int)$permission_data[$key][$action], array('yes' => 1, 'no' => 0)), 'permissions['.$key.']['.$action.']');
|
}
| }
|
$form_container->end(); echo "</div>\n"; }
|
$form_container->end(); echo "</div>\n"; }
|
|
|
$buttons[] = $form->generate_submit_button($lang->update_permissions); $form->output_submit_wrapper($buttons); $form->end();
| $buttons[] = $form->generate_submit_button($lang->update_permissions); $form->output_submit_wrapper($buttons); $form->end();
|
Zeile 313 | Zeile 321 |
---|
$page->add_breadcrumb_item($lang->group_permissions); $page->output_header($lang->group_permissions);
|
$page->add_breadcrumb_item($lang->group_permissions); $page->output_header($lang->group_permissions);
|
|
|
$page->output_nav_tabs($sub_tabs, 'group_permissions');
$table = new Table;
| $page->output_nav_tabs($sub_tabs, 'group_permissions');
$table = new Table;
|
Zeile 334 | Zeile 342 |
---|
{ $perm_type = "group"; }
|
{ $perm_type = "group"; }
|
else { $perm_type = "default"; }
| else { $perm_type = "default"; }
|
$uid = -$group['gid'];
|
$uid = -$group['gid'];
|
| $group['title'] = htmlspecialchars_uni($group['title']);
|
$table->construct_cell("<div class=\"float_right\"><img src=\"styles/{$page->style}/images/icons/{$perm_type}.png\" title=\"{$lang->permissions_type_group}\" alt=\"{$perm_type}\" /></div><div><strong><a href=\"index.php?module=user-admin_permissions&action=edit&uid={$uid}\" title=\"{$lang->edit_group}\">{$group['title']}</a></strong><br /></div>");
if($group['permissions'] != "")
| $table->construct_cell("<div class=\"float_right\"><img src=\"styles/{$page->style}/images/icons/{$perm_type}.png\" title=\"{$lang->permissions_type_group}\" alt=\"{$perm_type}\" /></div><div><strong><a href=\"index.php?module=user-admin_permissions&action=edit&uid={$uid}\" title=\"{$lang->edit_group}\">{$group['title']}</a></strong><br /></div>");
if($group['permissions'] != "")
|
Zeile 347 | Zeile 358 |
---|
$popup->add_item($lang->edit_permissions, "index.php?module=user-admin_permissions&action=edit&uid={$uid}");
// Check permissions for Revoke
|
$popup->add_item($lang->edit_permissions, "index.php?module=user-admin_permissions&action=edit&uid={$uid}");
// Check permissions for Revoke
|
$popup->add_item($lang->revoke_permissions, "index.php?module=user-admin_permissions&action=delete&uid={$uid}&my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, 'Are you sure you wish to revoke this group\'s permissions?')");
| $popup->add_item($lang->revoke_permissions, "index.php?module=user-admin_permissions&action=delete&uid={$uid}&my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '$lang->confirm_perms_deletion3')");
|
$table->construct_cell($popup->fetch(), array("class" => "align_center")); } else
| $table->construct_cell($popup->fetch(), array("class" => "align_center")); } else
|
Zeile 443 | Zeile 454 |
---|
"); while($admin = $db->fetch_array($query)) {
|
"); while($admin = $db->fetch_array($query)) {
|
| $perm_type = "default";
|
if($admin['permissions'] != "") { $perm_type = "user";
| if($admin['permissions'] != "") { $perm_type = "user";
|
Zeile 451 | Zeile 464 |
---|
{ $groups = explode(",", $admin['additionalgroups'].",".$admin['usergroup']); foreach($groups as $group)
|
{ $groups = explode(",", $admin['additionalgroups'].",".$admin['usergroup']); foreach($groups as $group)
|
{
| {
|
if($group == "") continue; if($group_permissions[$group] != "") { $perm_type = "group"; break; }
|
if($group == "") continue; if($group_permissions[$group] != "") { $perm_type = "group"; break; }
|
}
if(!$group_permissions) { $perm_type = "default";
| |
} }
| } }
|
Zeile 470 | Zeile 478 |
---|
// Build a list of group memberships that have access to the Admin CP // Primary usergroup?
|
// Build a list of group memberships that have access to the Admin CP // Primary usergroup?
|
if($usergroups[$admin['usergroup']]['cancp'] == 1)
| if(!empty($usergroups[$admin['usergroup']]) && $usergroups[$admin['usergroup']]['cancp'] == 1)
|
{
|
{
|
$usergroup_list[] = "<i>".$usergroups[$admin['usergroup']]['title']."</i>";
| $usergroup_list[] = "<i>".htmlspecialchars_uni($usergroups[$admin['usergroup']]['title'])."</i>";
|
}
// Secondary usergroups?
| }
// Secondary usergroups?
|
Zeile 481 | Zeile 489 |
---|
{ foreach($additional_groups as $gid) {
|
{ foreach($additional_groups as $gid) {
|
if($usergroups[$gid]['cancp'] == 1)
| if(!empty($usergroups[$gid]) && $usergroups[$gid]['cancp'] == 1)
|
{
|
{
|
$usergroup_list[] = $usergroups[$gid]['title'];
| $usergroup_list[] = htmlspecialchars_uni($usergroups[$gid]['title']);
|
} } } $usergroup_list = implode($lang->comma, $usergroup_list);
|
} } } $usergroup_list = implode($lang->comma, $usergroup_list);
|
$table->construct_cell("<div class=\"float_right\"><img src=\"styles/{$page->style}/images/icons/{$perm_type}.png\" title=\"{$lang->perms_type_user}\" alt=\"{$perm_type}\" /></div><div><strong><a href=\"index.php?module=user-admin_permissions&action=edit&uid={$admin['uid']}\" title=\"{$lang->edit_user}\">{$admin['username']}</a></strong><br /><small>{$usergroup_list}</small></div>");
| $username = htmlspecialchars_uni($admin['username']); $table->construct_cell("<div class=\"float_right\"><img src=\"styles/{$page->style}/images/icons/{$perm_type}.png\" title=\"{$lang->permissions_type_user}\" alt=\"{$perm_type}\" /></div><div><strong><a href=\"index.php?module=user-admin_permissions&action=edit&uid={$admin['uid']}\" title=\"{$lang->edit_user}\">{$username}</a></strong><br /><small>{$usergroup_list}</small></div>");
|
$table->construct_cell(my_date('relative', $admin['lastactive']), array("class" => "align_center"));
| $table->construct_cell(my_date('relative', $admin['lastactive']), array("class" => "align_center"));
|