本文整理汇总了PHP中Users::getUsers方法的典型用法代码示例。如果您正苦于以下问题:PHP Users::getUsers方法的具体用法?PHP Users::getUsers怎么用?PHP Users::getUsers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Users
的用法示例。
在下文中一共展示了Users::getUsers方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showUsers
function showUsers($message)
{
$returnStr = $this->showSysAdminHeader(Language::messageSMSTitle());
$returnStr .= '<div id="wrap">';
$returnStr .= $this->showNavBar();
$returnStr .= '<div class="container"><p>';
$returnStr .= '<ol class="breadcrumb">';
$returnStr .= '<li>' . Language::headerUsers() . '</li>';
$returnStr .= '</ol>';
$returnStr .= $message;
$returnStr .= '<div id=usersdiv>';
$returnStr .= '</div>';
$usertype = loadvar('usertype', USER_INTERVIEWER);
$users = new Users();
if ($usertype == "-1") {
$returnStr .= $this->showUsersList($users->getUsers());
} else {
$returnStr .= $this->showUsersList($users->getUsersByType($usertype));
}
$returnStr .= '<a href="' . setSessionParams(array('page' => 'sysadmin.users.adduser')) . '">' . Language::labelUserAddUser() . '</a>';
$returnStr .= '</p></div> </div>';
//container and wrap
$returnStr .= $this->showBottomBar();
$returnStr .= $this->showFooter(false);
return $returnStr;
}
示例2: actionDisplay
public function actionDisplay()
{
global $mainframe, $user;
if (!$user->isSuperAdmin()) {
YiiMessage::raseNotice("Your account not have permission to visit page");
$this->redirect(Router::buildLink("cpanel"));
}
$this->addBarTitle("Grant user <small>[list]</small>", "user");
global $user;
$model = new Users();
$groupID = $user->groupID;
$groupID = Request::getVar('filter_group', 0);
if ($groupID == 0) {
$list_user = $model->getUsers(null, null, true);
} else {
$list_user = $model->getUsers($groupID);
}
$lists = $model->getList();
$arr_group = $model->getGroups();
$this->render('list', array("list_user" => $list_user, 'arr_group' => $arr_group, "lists" => $lists));
}
示例3: displayGridAllUsers
function displayGridAllUsers()
{
?>
<!-- div contenant la liste des utilisateurs-->
<div id="utilisateurs" class="panel panel-default" hidden>
<!-- Table -->
<table class="table">
<thead>
<tr>
<th>Nom</th>
<th>Prénom</th>
<th>Login</th>
<th>Actions</th>
</tr>
</thead>
<?php
foreach (Users::getUsers() as $u) {
?>
<tr>
<td>
<?php
echo escape($u->lastname);
?>
</td>
<td>
<?php
echo escape($u->firstname);
?>
</td>
<td>
<?php
echo escape($u->login);
?>
</td>
<td>
<a class="btn btn-info btn-xs" href=".?page=edit&login=<?php
echo $u->login;
?>
" title="Editer" role="button"><span class="glyphicon glyphicon-edit"></span></a>
<a class="btn btn-danger btn-xs" href=".?page=delete&login=<?php
echo $u->login;
?>
" title="Supprimer" role="button"><span class="glyphicon glyphicon-remove"></span></a>
</td>
</tr>
<?php
}
?>
</table>
</div>
<?php
}
示例4: actionShowUsers
public function actionShowUsers()
{
$auth = Auth::checkAuth();
$view = new View();
$view->auth = $auth;
if ($auth) {
$user = Auth::getUser();
if ($user->user_group == 1) {
$view->user_login = $user->user_login;
$view->user_group = $user->user_group;
$view->users = Users::getUsers();
$view->display('header.php');
$view->display('users/user_list.php');
}
$view->display('footer.php');
} else {
header("Location: /learns/");
}
}
示例5: editAction
/**
* Edit a users
*/
public function editAction()
{
$usersModel = new Users();
$form = $this->_getForm(false);
$user = $usersModel->getUser($this->_getParam('userId'));
$form->setDefaults($user);
if ($this->getRequest()->isPost() && $form->isValid($_POST)) {
$data = $form->getValues();
if ($usersModel->isUserNameInUse($data['user_name'], $user['user_id'])) {
$form->getElement('user_name')->addValidator('customMessages', false, array('Username is already in use'));
}
if ($usersModel->isEmailInUse($data['user_email'], $user['user_id'])) {
$form->getElement('user_email')->addValidator('customMessages', false, array('E-Mail is already in use'));
}
if ($form->isValid($_POST)) {
$password = !empty($data['user_password']) ? $data['user_password'] : null;
$usersModel->updateUser($user['user_id'], $data['user_name'], $data['user_email'], $data['user_role'], $password);
$this->_helper->getHelper('Redirector')->gotoRouteAndExit(array(), 'users-index');
}
}
$this->view->form = $form;
$this->view->users = $usersModel->getUsers();
}
示例6: _registerSession
private function _registerSession($user_id)
{
$user = Users::getUsers($user_id);
$this->session->set('user', array('first_name' => $user['first_name'], 'last_name' => $user['last_name']));
$this->session->set('auth', array('id' => $user_id, 'station_id' => $user['station_id']));
}
示例7: function
});
$app->delete('/api/contacts/:id', function ($id) {
$cn = new Contacts();
$cn->deleteContact($id);
});
$app->get('/api/contacts/:id/venues', function ($id) {
$cn = new Venues();
$cn->getVenuesByContactId($id);
});
$app->get('/api/locations/', function () {
$cn = new Locations();
$cn->getLocations();
});
$app->get('/api/users/', function () {
$cn = new Users();
$cn->getUsers();
});
$app->post('/api/users/', function () use($app) {
$req = $app->request();
$bdy = $req->getBody();
$user = json_decode($bdy);
$cn = new Users();
$cn->insertUsers($user[0]);
});
$app->get('/api/users/:id', function ($id) {
$cn = new Users();
$cn->getUsersById($id);
});
$app->put('/api/users/:id', function ($id) use($app) {
$req = $app->request();
$bdy = $req->getBody();
示例8: actionRemove
function actionRemove()
{
global $user;
$model = new Group();
$mode_user = new Users();
if (!$user->isSuperAdmin()) {
YiiMessage::raseNotice("Your account not have permission to add/edit group");
$this->redirect(Router::buildLink("users", array('view' => 'group')));
}
$cids = Request::getVar("cid", 0);
if (count($cids) > 0) {
$obj_table = YiiUser::getInstance();
for ($i = 0; $i < count($cids); $i++) {
$cid = $cids[$i];
$list_user = $mode_user->getUsers($cid, null, true);
$list_group = $model->getItems($cid);
if (empty($list_user) and empty($list_group)) {
$obj_table->removeGroup($cid);
} else {
YiiMessage::raseNotice("Group user have something account/sub group");
$this->redirect(Router::buildLink("users", array('view' => 'group')));
return false;
}
}
}
YiiMessage::raseSuccess("Successfully delete GroupUser(s)");
$this->redirect(Router::buildLink("users", array("view" => "group")));
}
示例9: header
if ($_POST['newpw'] == $_POST['newpw2']) {
$change = $auth->changePassword($_SESSION['auth']['user'], $_POST['oldpw'], $_POST['newpw']);
if ($change == false) {
$smarty->assign('error', 'Unable to change password. Please try again');
} else {
$smarty->assign('error', 'Your password has been changed');
}
} else {
$smarty->assign('error', 'New passwords do not match');
}
}
if (!empty($_POST['user']) && !empty($_POST['pass'])) {
$add = $users->createUser($_POST['user'], $_POST['pass']);
if ($add != false) {
header('Location: users.php');
}
$smarty->assign('error', 'Unable to create user. Please try again');
}
}
if (!empty($_GET['delete'])) {
$delete = $users->deleteUser($_GET['delete']);
if ($delete != false) {
header('Location: users.php');
}
$smarty->assign('error', 'Unable to delete the user. Please try again');
}
$allusers = $users->getUsers();
$smarty->assign('users', $allusers);
$smarty->display('_header.tpl');
$smarty->display('users.tpl');
$smarty->display('_footer.tpl');
示例10: initBrowseProposalsLayout
function initBrowseProposalsLayout()
{
$org_id = 0;
$apply_projects = vals_soc_access_check('dashboard/projects/apply') ? 1 : 0;
$rate_projects = Users::isSuperVisor();
$browse_proposals = vals_soc_access_check('dashboard/proposals/browse') ? 1 : 0;
$proposal_tabs = array();
if (isset($_GET['organisation'])) {
$org_id = $_GET['organisation'];
}
if ($apply_projects && !$browse_proposals) {
//A student may only browse their own proposals
$student_id = $GLOBALS['user']->uid;
$student = Users::getStudentDetails($student_id);
$inst_id = $student->inst_id;
$student_section_class = 'invisible';
} else {
$student_section_class = '';
$student_id = 0;
if (isset($_GET[_STUDENT_TYPE])) {
$student_id = $_GET[_STUDENT_TYPE];
}
$inst_id = 0;
if (isset($_GET['institute'])) {
$inst_id = $_GET['institute'];
}
}
?>
<div class="filtering" style="width: 800px;">
<span id="infotext" style="margin-left: 34px"></span>
<form id="proposal_filter">
<?php
echo t('Select the proposals');
?>
:
<?php
// echo t('Organisations');
?>
<select id="organisation" name="organisation">
<option <?php
echo !$org_id ? 'selected="selected"' : '';
?>
value="0"><?php
echo t('All Organisations');
?>
</option><?php
$result = Organisations::getInstance()->getOrganisationsLite();
foreach ($result as $record) {
$selected = $record->org_id == $org_id ? 'selected="selected" ' : '';
echo '<option ' . $selected . 'value="' . $record->org_id . '">' . $record->name . '</option>';
}
?>
</select> <span id='student_section'
class='<?php
echo $student_section_class;
?>
'> <select id="institute"
name="institute">
<option <?php
echo !$inst_id ? 'selected="selected"' : '';
?>
value="0"><?php
echo t('All Institutes');
?>
</option><?php
$result = Groups::getGroups(_INSTITUTE_GROUP, 'all');
foreach ($result as $record) {
$selected = $record->inst_id == $inst_id ? 'selected="selected" ' : '';
echo '<option ' . $selected . 'value="' . $record->inst_id . '">' . $record->name . '</option>';
}
?>
</select> <select id="student" name="student">
<option <?php
echo !$student_id ? 'selected="selected"' : '';
?>
value="0"><?php
echo t('All Students');
?>
</option><?php
$result = Users::getUsers(_STUDENT_TYPE, $inst_id ? _INSTITUTE_GROUP : 'all', $inst_id);
foreach ($result as $record) {
$selected = $record->uid == $student_id ? 'selected="selected" ' : '';
echo '<option ' . $selected . 'value="' . $record->uid . '">' . $record->name . ':' . $record->mail . '</option>';
}
?>
</select>
</span>
</form>
</div>
<div id="TableContainer" style="width: 800px;"></div>
<script type="text/javascript">
jQuery(document).ready(function($){
//We make the ajax script path absolute as the language module might add a language code
//to the path
window.view_settings = {};
window.view_settings.apply_projects = <?php
echo $apply_projects ? 1 : 0;
?>
//.........这里部分代码省略.........
示例11: Users
<?php
include_once 'users.php';
$map = new Users();
$map->getUsers();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script type="text/javascript" src="//maps.google.com/maps/api/js?sensor=true"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<script type="text/javascript" src="js/script.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/gmaps.js"></script>
<link href="css/style.css" rel="stylesheet">
<script type="text/javascript">
$(document).ready(function(){
var map = new GMaps({
div: '#map',
lat: -12.043333,
lng: -77.028333
});
$('#geocoding_form').submit(function(e){
e.preventDefault();
GMaps.geocode({
address: $('#address').val().trim(),
callback: function(results, status){
if(status=='OK'){
示例12: deleteUser
public static function deleteUser($id)
{
$user = new Users();
$links = Users::getUsers($id);
if (count($links) > 0) {
if ($links['from_users_message'] > 0 || $links['from_message'] > 0 || $links['from_package_transport_history'] > 0 || $links['from_package_vcs'] > 0) {
return array('class' => 'alert-warning', 'text' => "<p>Запись <b> " . $links['first_name'] . " " . $links['last_name'] . " не</b> может быть <b>удалена</b>, так как связана с одной или несколькими записями. Необходимо <b>переопределить</b> или <b>удалить</b> эти связи, после чего повторите попытку.</p>");
} else {
$query = "DELETE FROM users WHERE id = {$id}";
$res = new Phalcon\Mvc\Model\Resultset\Simple(null, $user, $user->getReadConnection()->query($query));
return array('class' => 'alert-success', 'text' => "<p>Удаление записи <b>" . $links['first_name'] . " " . $links['last_name'] . "</b> произошло успешно.</p>");
}
}
return array('class' => 'alert-danger', 'text' => "<p>Запись не найдена.</p>");
}
示例13:
<meta charset="UTF-8">
<title>Manage</title>
</head>
<body>
<form method="post" action="">
<span><a href="index.php">Back</a> </span>
<span><a href="action_view.php">Add new user</a> </span>
<table border="2" width="40%">
<thead>
<th>Id</th>
<th>Name</th>
<th>Address</th>
<th colspan="2">Action</th>
</thead>
<?php
foreach ($tabl->getUsers() as $value) {
?>
<tbody>
<tr>
<td><?php
echo $value['0'];
?>
</td>
<td><?php
echo $value['1'];
?>
</td>
<td><?php
echo $value['2'];
?>
</td>
示例14: getACData
public function getACData($attributeName, $query)
{
$users = Users::getUsers();
$selection = array();
$query = preg_match("/%/", $query) ? preg_replace("/%/", $query, "") : $query;
while ($user = $users->getNextEntry()) {
if (preg_match("/.*" . $query . ".*/", $user->A("UserEmail")) || preg_match("/.*" . $query . ".*/", $user->A("name")) || preg_match("/.*" . $query . ".*/", $user->A("username"))) {
$subSelection = array("label" => $user->A("name"), "value" => $user->A("UserEmail"), "email" => $user->A("UserEmail"), "description" => "");
$selection[] = $subSelection;
}
}
if (Session::isPluginLoaded("mWAdresse")) {
$adresses = new Adressen();
$adresses->setSearchStringV3($query);
$adresses->setSearchFieldsV3(array("firma", "nachname", "email"));
$adresses->setFieldsV3(array("firma AS label", "AdresseID AS value", "vorname", "nachname", "CONCAT(strasse, ' ', nr, ', ', plz, ' ', ort) AS description", "email", "firma"));
$adresses->setLimitV3("10");
$adresses->setParser("label", "AdressenGUI::parserACLabel");
if ($attributeName == "SendMailTo") {
$adresses->addAssocV3("email", "!=", "");
}
while ($adress = $adresses->getNextEntry()) {
$subSelection = array();
foreach ($adress->getA() as $key => $value) {
$subSelection[$key] = $value;
}
$selection[] = $subSelection;
}
}
echo json_encode($selection);
}
示例15: Access
require_once "header.php";
$failedGoTo = "home.php";
$successGoTo = "users.php";
$logoutGoTo = "home.php";
$access = new Access();
$logonUser = $access->isInitAccess();
if ($logonUser) {
$typeUser = $access->isAdminUser();
}
$access->processLogout($logoutGoTo);
$access->processLogonRestriction($failedGoTo);
$access->processSendAccess($successGoTo, $failedGoTo);
unset($access);
$usersArray = array();
$users = new Users();
$usersArray = $users->getUsers();
$users->processAddUser($successGoTo, $failedGoTo);
$users->processModifyUser($successGoTo, $failedGoTo);
$users->processRemoveUser($successGoTo, $failedGoTo);
unset($users);
if ($typeUser != 1) {
header("Location: " . "home.php");
exit;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><!-- InstanceBegin template="/Templates/Main.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- InstanceBeginEditable name="doctitle" -->
<title>CIP (Collector and Injection Panel)</title>