当前位置: 首页>>代码示例>>PHP>>正文


PHP UserDao::listAllUsers方法代码示例

本文整理汇总了PHP中UserDao::listAllUsers方法的典型用法代码示例。如果您正苦于以下问题:PHP UserDao::listAllUsers方法的具体用法?PHP UserDao::listAllUsers怎么用?PHP UserDao::listAllUsers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserDao的用法示例。


在下文中一共展示了UserDao::listAllUsers方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: exportUserList

 /**
  * Export user list in csv format
  *
  * @param String $user_name_search
  * @param String $current_sort_header
  * @param String $sort_order
  *
  */
 public function exportUserList($user_name_search, $current_sort_header, $sort_order, $status_values)
 {
     global $Language;
     header('Content-Type: text/csv');
     header('Content-Disposition:attachment; filename=users_list.csv');
     $eol = "\n";
     $documents_title = array('user_id' => $Language->getText('admin_userlist', 'id_user'), 'login_name' => $Language->getText('include_user_home', 'login_name'), 'real_name' => $Language->getText('include_user_home', 'real_name'), 'member_of' => $Language->getText('admin_userlist', 'member_of'), 'admin_of' => $Language->getText('admin_userlist', 'admin_of'), 'status' => $Language->getText('admin_userlist', 'status'));
     echo build_csv_header($this->col_list, $documents_title) . $eol;
     $dao = new UserDao(CodendiDataAccess::instance());
     $result = $dao->listAllUsers($user_name_search, 0, 0, $current_sort_header, $sort_order, $status_values);
     $users = $result['users'];
     echo $this->buildCsvBody($users);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:21,代码来源:Admin_UserListExporter.class.php

示例2: array

$status_values = array();
$anySelect = "selected";
if ($request->exist('status_values')) {
    $status_values = $request->get('status_values');
    if (!is_array($status_values)) {
        $status_values = explode(",", $status_values);
    }
    if (in_array('ANY', $status_values)) {
        $status_values = array();
    } else {
        $anySelect = "";
    }
}
if (!$group_id) {
    if (isset($user_name_search) && $user_name_search) {
        $result = $dao->listAllUsers($user_name_search, $offset, $limit, $sort_params['sort_header'], $sort_params['order'], $status_values);
        if ($result['numrows'] == 1) {
            $row = $result['users']->getRow();
            $GLOBALS['Response']->redirect('/admin/usergroup.php?user_id=' . $row['user_id']);
        }
    } else {
        $user_name_search = "";
        $result = $dao->listAllUsers(0, $offset, $limit, $sort_params['sort_header'], $sort_params['order'], $status_values);
    }
} else {
    $result = $dao->listAllUsersForGroup($group_id, $offset, $limit);
}
/*
 * Show list of users
 */
$HTML->header(array('title' => $Language->getText('admin_userlist', 'title')));
开发者ID:pombredanne,项目名称:tuleap,代码行数:31,代码来源:userlist.php

示例3:

if ($request->valid($vUserNameSearch)) {
    if ($request->exist('user_name_search')) {
        $user_name_search = $request->get('user_name_search');
    }
}
// Check if group_id is valid
$vGroupId = new Valid_GroupId();
$group_id = false;
if ($request->valid($vGroupId)) {
    if ($request->exist('group_id')) {
        $group_id = $request->get('group_id');
    }
}
if (!$group_id) {
    if (isset($user_name_search) && $user_name_search) {
        $result = $dao->listAllUsers($user_name_search, $offset, $limit);
        if ($result['numrows'] == 1) {
            $row = $result['users']->getRow();
            $GLOBALS['Response']->redirect('/admin/usergroup.php?user_id=' . $row['user_id']);
        }
    } else {
        $user_name_search = "";
        $result = $dao->listAllUsers(0, $offset, $limit);
    }
} else {
    $result = $dao->listAllUsersForGroup($group_id, $offset, $limit);
}
/*
 * Show list of users
 */
$HTML->header(array('title' => $Language->getText('admin_userlist', 'title')));
开发者ID:nterray,项目名称:tuleap,代码行数:31,代码来源:userlist.php


注:本文中的UserDao::listAllUsers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。