本文整理汇总了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);
}
示例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')));
示例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')));