Exemple #1
0
 function ui_user()
 {
     global $profileuser, $pp_current_user;
     $pp_profile_user = $profileuser->ID == $pp_current_user->ID ? $pp_current_user : new PP_User($profileuser->ID);
     $is_administrator = pp_is_user_administrator() && pp_bulk_roles_enabled() && current_user_can('list_users');
     if ($is_administrator || pp_get_option('display_user_profile_roles') || pp_get_option('display_user_profile_groups')) {
         require_once dirname(__FILE__) . '/profile_ui_pp.php';
         require_once dirname(__FILE__) . '/permissions-ui_pp.php';
     }
     if ($is_administrator || pp_get_option('display_user_profile_roles')) {
         PP_ProfileUI::display_ui_user_assigned_roles($pp_profile_user);
     }
     if ($is_administrator || pp_get_option('display_user_profile_groups')) {
         PP_ProfileUI::display_ui_user_groups();
     }
     if ($is_administrator || pp_get_option('display_user_profile_roles')) {
         PP_ProfileUI::display_ui_user_roles($pp_profile_user);
     }
 }
	<?php 
    if ($agent_id) {
        $roles = array();
        $user = pp_get_user($agent_id);
        $user->retrieve_extra_groups();
        $post_types = pp_get_enabled_post_types(array(), 'object');
        $taxonomies = pp_get_enabled_taxonomies(array(), 'object');
        foreach (array_keys($user->groups) as $agent_type) {
            foreach (array_keys($user->groups[$agent_type]) as $_agent_id) {
                $args = compact($post_types, $taxonomies);
                $args['query_agent_ids'] = array_keys($user->groups[$agent_type]);
                $roles = array_merge($roles, ppc_get_roles($agent_type, $_agent_id, $args));
            }
        }
        require_once dirname(__FILE__) . '/profile_ui_pp.php';
        PP_ProfileUI::display_ui_user_groups(false, array('initial_hide' => true, 'selected_only' => true, 'force_display' => true, 'edit_membership_link' => true, 'hide_checkboxes' => true, 'user_id' => $agent_id));
        $role_group_caption = sprintf(__('Supplemental Roles %1$s(from primary role or %2$sgroup membership%3$s)%4$s', 'pp'), '<small>', "<a class='pp-show-groups' href='#'>", '</a>', '</small>');
        PP_GroupsUI::_current_roles_ui($roles, array('read_only' => true, 'class' => 'pp-group-roles', 'caption' => $role_group_caption));
        $exceptions = array();
        $args = array('assign_for' => '', 'inherited_from' => 0, 'extra_cols' => array('i.assign_for', 'i.eitem_id'), 'post_types' => array_keys($post_types), 'taxonomies' => array_keys($taxonomies), 'return_raw_results' => true);
        foreach (array_keys($user->groups) as $agent_type) {
            $args['agent_type'] = $agent_type;
            $args['ug_clause'] = " AND e.agent_type = '{$agent_type}' AND e.agent_id IN ('" . implode("','", array_keys($user->groups[$agent_type])) . "')";
            $args['query_agent_ids'] = array_keys($user->groups[$agent_type]);
            $exceptions = array_merge($exceptions, ppc_get_exceptions($args));
        }
        $role_group_caption = sprintf(__('Exceptions %1$s(from primary role or %2$sgroup membership%3$s)%4$s', 'pp'), '<small>', "<a class='pp-show-groups' href='#'>", '</a>', '</small>');
        PP_GroupsUI::_current_exceptions_ui($exceptions, array('read_only' => true, 'class' => 'pp-group-roles', 'caption' => $role_group_caption));
    } else {
        ?>
		<h4>
Exemple #3
0
<?php

if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
if (!current_user_can('create_users') || !current_user_can('pp_manage_members')) {
    return;
}
switch ($_GET['pp_ajax_user_ui']) {
    case 'new_user_groups_ui':
        require_once dirname(__FILE__) . '/profile_ui_pp.php';
        PP_ProfileUI::display_ui_user_groups(false);
        break;
}