function peopleaggregator_getUserList($args)
{
    $page = $args['page'];
    $perpage = $args['resultsPerPage'];
    $imageSize = $args['profileImageSize'];
    $showProfileImages = TRUE;
    $imageWidth = $imageHeight = 0;
    if ($imageSize == 'none') {
        $showProfileImages = FALSE;
    } else {
        if ($imageSize == 'full') {
        } else {
            if (preg_match("/^(\\d+)x(\\d+)\$/", $imageSize, $m)) {
                $imageWidth = (int) $m[1];
                $imageHeight = (int) $m[2];
            }
        }
    }
    $total_users = User::count_users();
    $total_pages = api_n_pages($total_users, $perpage);
    $users = User::allUsers_with_paging(FALSE, $perpage, $page);
    $users_out = array();
    foreach ($users['users_data'] as $user) {
        $user_out = array("id" => "user:" . $user['user_id'], "login" => $user['login_name']);
        if ($showProfileImages) {
            $img_info = api_resize_user_image($user['picture'], $imageWidth, $imageHeight);
            if ($img_info) {
                $user_out['image'] = $img_info;
            }
        }
        $users_out[] = $user_out;
    }
    return array('success' => TRUE, 'page' => $page, 'resultsPerPage' => $perpage, 'totalUsers' => $total_users, 'totalPages' => $total_pages, 'users' => $users_out);
}
Example #2
0
 public static function home_dialog()
 {
     $template = new HTMLTemplate("base/user/admin/user/home_dialog.html");
     $paramquery = array();
     $paramquery['username'] = $_GET['username'];
     $paramquery['session_id'] = $_GET['session_id'];
     $paramquery['nav'] = $_GET['nav'];
     $paramquery['run'] = "organisation";
     $paramquery['dialog'] = "users";
     $paramquery['action'] = "add";
     $params = http_build_query($paramquery, '', '&');
     $template->set_var("user_add_params", $params);
     $template->set_var("user_amount", User::count_users());
     $template->set_var("user_administrators", User::count_administrators());
     return $template->get_string();
 }