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


PHP User::getAllUsers方法代码示例

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


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

示例1: testGetAllUsers

 /**
  * @covers User::getAllUsers
  */
 public function testGetAllUsers()
 {
     $users = $this->object->getAllUsers();
     $this->assertInternalType('array', $users, 'Return should be an array');
     $this->assertNotCount(0, $users, 'Array should contain at least 1 user');
     $this->assertInstanceOf('User', $users[0], 'Array should contain User class');
 }
开发者ID:nioc,项目名称:web-music-player,代码行数:10,代码来源:UserTest.php

示例2: getSearch

 public function getSearch()
 {
     $this_user = Session::get('user');
     $users = User::getAllUsers($this_user);
     // make a list of user_ids that have a filled relationship_status
     $withRelationships = array();
     foreach ($users as $user) {
         if ($user->relationship_status != NULL && !in_array($user->user_id, $withRelationships)) {
             $withRelationships[] = $user->user_id;
         }
     }
     for ($x = 0; $x < count($users); $x++) {
         if ($users[$x]->user_id == $this_user->user_id) {
             unset($users[$x]);
         }
     }
     $users1 = array_values($users);
     unset($users);
     for ($x = 0; $x < count($users1); $x++) {
         if ($users1[$x]->relationship_target == $this_user->user_id && $users1[$x]->relationship_status == 'active') {
             unset($users1[$x]);
         }
     }
     $users = array_values($users1);
     for ($x = 0; $x < count($users); $x++) {
         if ($users[$x]->relationship_status == NULL && in_array($users[$x]->user_id, $withRelationships)) {
             unset($users[$x]);
         }
     }
     $users1 = array_values($users);
     unset($users);
     return View::make('connection.search', array('users' => $users1, 'this_user' => $this_user));
 }
开发者ID:jacobross85,项目名称:community,代码行数:33,代码来源:ConnectionController.php

示例3: getByLogin

 static function getByLogin($login)
 {
     $returnedUser = new User();
     $users = User::getAllUsers();
     foreach ($users as $user) {
         if ($user->getLogin() == $login) {
             $returnedUser = $user;
         }
     }
     return $returnedUser;
 }
开发者ID:kofeve,项目名称:yana-server,代码行数:11,代码来源:User.class.php

示例4: getUsers

 public function getUsers()
 {
     $users = User::getAllUsers();
     $grpUsers = array();
     foreach ($users as $user) {
         if ($user->inGroup($this->name)) {
             $grpUsers[] = $user;
         }
     }
     return $grpUsers;
 }
开发者ID:DeltaWolf7,项目名称:Arc,代码行数:11,代码来源:UserGroup.class.php

示例5: testCorrectUserListOutput

 /**
  * @group 47156
  */
 public function testCorrectUserListOutput()
 {
     $this->user1 = $this->createUser(11, 'Active');
     $this->user2 = $this->createUser(12, 'Inactive');
     $allUsers = User::getAllUsers();
     $this->assertArrayHasKey($this->user1->id, $allUsers);
     $this->assertArrayHasKey($this->user2->id, $allUsers);
     $dbManager = $GLOBALS['db'];
     $dbManager->query('DELETE FROM users WHERE id IN (' . $dbManager->quoted($this->user1->id) . ', ' . $dbManager->quoted($this->user2->id) . ')');
     $dbManager->query('DELETE FROM user_preferences WHERE assigned_user_id IN (' . $dbManager->quoted($this->user1->id) . ', ' . $dbManager->quoted($this->user2->id) . ')');
     $dbManager->query('DELETE FROM teams WHERE associated_user_id IN (' . $dbManager->quoted($this->user1->id) . ', ' . $dbManager->quoted($this->user2->id) . ')');
     $dbManager->query('DELETE FROM team_memberships WHERE user_id IN (' . $dbManager->quoted($this->user1->id) . ', ' . $dbManager->quoted($this->user2->id) . ')');
 }
开发者ID:jgera,项目名称:sugarcrm_dev,代码行数:16,代码来源:Bug47156Test.php

示例6: getUsers

 public function getUsers()
 {
     $users = User::getAllUsers();
     $found = [];
     foreach ($users as $user) {
         $companies = $user->getCompanies();
         foreach ($companies as $company) {
             if ($company->id == $this->id) {
                 $found[] = $user;
             }
         }
     }
     return $found;
 }
开发者ID:DeltaWolf7,项目名称:Arc,代码行数:14,代码来源:Company.class.php

示例7: ajax

 public function ajax()
 {
     /**@$Logger This for instantiate of new translog.*/
     /**@$SOP This for instantiate of  new sophisticated.*/
     /**@$USER This for instantiate of new user.*/
     /**@$type This for input type.*/
     $Logger = new TransLog();
     $UserModel = new User();
     $type = Input::get('type');
     if ($type) {
         switch ($type) {
             case 'users-list':
                 $pending = $UserModel->getAllUsers();
                 $dtResult = GlobalController::setDatatable($pending, array('id', 'user_fname', 'user_lname', 'user_email', 'user_username', 'user_status', 'user_type'), 'id');
                 foreach ($dtResult['objResult'] as $aRow) {
                     try {
                         $usertype = $UserModel->getUserType($aRow->id);
                         $pro = $usertype->user_type;
                     } catch (Exception $ex) {
                         $pro = 0;
                     }
                     switch ($pro) {
                         case 1:
                             $pro = 'Admin';
                             break;
                         case 2:
                             $pro = 'Default';
                             break;
                     }
                     $data = array($aRow->id, $aRow->user_fname, $aRow->user_lname, $aRow->user_email, $aRow->user_username, $aRow->user_status ? "Active" : "Inactive", $pro, 'Action');
                     $dtResult['aaData'][] = $data;
                 }
                 unset($dtResult['objResult']);
                 echo json_encode($dtResult);
                 break;
         }
     }
 }
开发者ID:bokbok123,项目名称:ORS,代码行数:38,代码来源:UserAdminController.php

示例8: getAllUsersDT

function getAllUsersDT()
{
    global $bdd, $_TABLES;
    if (!is_null($bdd) && !is_null($_TABLES)) {
        $content = '<thead>';
        $content .= '<tr>';
        $content .= '<th>Id</th>';
        $content .= '<th>Name</th>';
        $content .= '<th>Login</th>';
        $content .= '<th>Pass</th>';
        $content .= '<th>Valid</th>';
        $content .= '<th>Action</th>';
        $content .= '</tr>';
        $content .= '</thead>';
        $content .= '<tbody>';
        $objUser = new User($bdd, $_TABLES);
        $users = $objUser->getAllUsers();
        if ($users) {
            foreach ($users as $key => $user) {
                $content .= '<tr user_id=' . $user->id . '>';
                $content .= '<td>' . $user->id . '</td>';
                $content .= '<td><input type="text" class="input_dt input_dt_name" value="' . $user->name . '" /></td>';
                $content .= '<td><input type="text" class="input_dt input_dt_login" value="' . $user->login . '" /></td>';
                $content .= '<td><input type="text" class="input_dt input_dt_pass" value="" /></td>';
                $content .= '<td><input type="checkbox" class="input_dt input_dt_valid" value="' . $user->valid . '" /></td>';
                $content .= "<td><input type='button' class='edit edit_user_dt' value='Save' />\n\t\t\t\t    <input type='button' class='delete delete_user_dt' value='Supprimer' /></td>";
                $content .= '</tr>';
            }
        }
        $content .= '</tbody>';
        return $content;
    } else {
        error_log("BDD ERROR : " . json_encode($bdd));
        error_log("TABLES ERROR : " . json_encode($_TABLES));
    }
}
开发者ID:xXNoceboXx,项目名称:WUS,代码行数:36,代码来源:user.controller.php

示例9: process

 function process()
 {
     if ($this->login == 'anonymous') {
         return false;
     }
     if ($this->login) {
         $info = User::getInfo($this->login);
     }
     $req =& Request::getInstance();
     $tmpPassword = @$info['password'];
     $passwordMd5OrNot = !empty($tmpPassword) ? $tmpPassword : '';
     if ($req->getActionName() === 'modCur') {
         $formElements = array(array('hidden', 'form_login', $this->login), array('password', 'form_passwordold', "Old password:", 'value=""'), array('password', 'form_password', "New password:", 'value=""'), array('password', 'form_password2', $GLOBALS['lang']['admin_type_again'], 'value=""'), array('text', 'form_alias', "Alias", 'size=40 value="' . @$info['alias'] . '"'), array('text', 'form_email', "email", 'value="' . @$info['email'] . '"'), array('radio', 'form_send_mail', $GLOBALS['lang']['install_send_mail'], $GLOBALS['lang']['install_oui'], 'yes'), array('radio', 'form_send_mail', null, $GLOBALS['lang']['install_non'], 'no'));
         $formRules = array(array('form_email', $GLOBALS['lang']['admin_valid_email'], 'email', '', 'server'), array('form_email', sprintf($GLOBALS['lang']['admin_required'], $GLOBALS['lang']['admin_admin_mail']), 'required'), array('form_passwordold', sprintf($GLOBALS['lang']['admin_required'], $GLOBALS['lang']['admin_user_oldPwd']), 'required'), array('form_passwordold', $GLOBALS['lang']['admin_user_oldPwd_bad'], 'checkOldCurrentPassword'), array('form_password', $GLOBALS['lang']['admin_valid_pass'], 'complexPassword'), array('form_password', $GLOBALS['lang']['admin_match_pass'], 'compareField', 'form_password2'), array('form_password', $GLOBALS['lang']['admin_valid_pass'], 'changePassword'));
     } else {
         $formElements = array(array('password', 'form_password', "Password:", 'value="' . $passwordMd5OrNot . '"'), array('password', 'form_password2', $GLOBALS['lang']['admin_type_again'], 'value="' . $passwordMd5OrNot . '"'), array('text', 'form_alias', "Alias", 'size=40 value="' . @$info['alias'] . '"'), array('text', 'form_email', "email", 'value="' . @$info['email'] . '"'), array('radio', 'form_send_mail', $GLOBALS['lang']['install_send_mail'], $GLOBALS['lang']['install_oui'], 'yes'), array('radio', 'form_send_mail', null, $GLOBALS['lang']['install_non'], 'no'));
         $formRules = array(array('form_email', $GLOBALS['lang']['admin_valid_email'], 'email', '', 'server'), array('form_email', sprintf($GLOBALS['lang']['admin_required'], $GLOBALS['lang']['admin_admin_mail']), 'required'), array('form_password', sprintf($GLOBALS['lang']['admin_required'], $GLOBALS['lang']['install_mdpadmin']), 'required'), array('form_password', $GLOBALS['lang']['admin_valid_pass'], 'complexPassword'), array('form_password', $GLOBALS['lang']['admin_match_pass'], 'compareField', 'form_password2'));
     }
     // when adding a new element, add an input named login
     // else read the login in url
     if ($req->getActionName() === 'add') {
         $formElements = array_merge(array(array('text', 'form_login', "Login:", 'value=""')), $formElements);
         $formRules[] = array('form_login', sprintf($GLOBALS['lang']['admin_required'], "Login"), 'required');
         $formRules[] = array('form_login', "Alpha numeric only", 'alphanumeric');
         if ($login = $this->getSubmitValue('form_login')) {
             $all = array_keys(User::getAllUsers());
             if (in_array($login, $all)) {
                 $this->setElementError('form_login', 'Login already exist in database!');
             }
         }
     }
     $this->addElements($formElements, 'User Information');
     $this->setChecked('form_send_mail', @$info['send_mail'] == '1' ? 'yes' : 'no');
     $this->addRules($formRules);
     return parent::process('install_general_setup');
 }
开发者ID:ber5ien,项目名称:www.jade-palace.co.uk,代码行数:36,代码来源:FormUser.class.php

示例10: filter_input

 // sanitize the email
 $email = filter_input(INPUT_GET, "email", FILTER_SANITIZE_EMAIL);
 // grab the mySQL connection
 $pdo = connectToEncryptedMySql("/etc/apache2/ninja-mysql/appsbyninja.ini");
 // handle all RESTful calls to User today
 // get some or all Users
 if ($method === "GET") {
     // set an XSRF cookie on GET requests
     setXsrfCookie("/");
     if (empty($userId) === false) {
         $reply->data = User::getUserByUserId($pdo, $userId);
     } else {
         if (empty($email) === false) {
             $reply->data = User::getUserByEmail($pdo, $email);
         } else {
             $reply->data = User::getAllUsers($pdo);
         }
     }
     // post to a new User
 } else {
     if ($method === "POST") {
         // convert POSTed JSON to an object
         verifyXsrf();
         $requestContent = file_get_contents("php://input");
         $requestObject = json_decode($requestContent);
         if ($requestObject->password !== $requestObject->passwordConfirm) {
             throw new InvalidArgumentException("passwords do not match", 400);
         }
         $salt = bin2hex(openssl_random_pseudo_bytes(32));
         $hash = hash_pbkdf2("sha512", $requestObject->password, $salt, 262144, 128);
         // handle optional fields
开发者ID:sandidgec,项目名称:appsbyninja,代码行数:31,代码来源:index.php

示例11: User

<?php

/* Inclusion de la classe General pour la récupération des données de la base */
require_once "../php/model/User.php";
/* Inclusion du fichier de connexion à la BD */
include_once "../php/controller/connect-bd.php";
$users = new User($bdd);
$data = $users->getAllUsers();
开发者ID:Semrom,项目名称:Picstore,代码行数:8,代码来源:admin_users.php

示例12: dirname

require_once dirname(dirname(dirname(__FILE__))) . '/modules/User.class.php';
require_once dirname(dirname(dirname(__FILE__))) . '/modules/Dynamo.class.php';
if ($_SESSION['user_type'] == 1 && trim($_GET['del']) == 'true' && trim($_GET['id']) != '') {
    $users_obj = new Dynamo("users");
    $query = "DELETE FROM users WHERE id = " . $_GET['id'];
    $users_obj->customExecuteQuery($query);
}
$userObj = new User();
$listUsers = array();
$companyId = isset($_SESSION['company_id']) ? $_SESSION['company_id'] : 0;
if ($userObj) {
    $userRoleId = isset($_SESSION['user_type']) ? $_SESSION['user_type'] : 0;
    if ($userRoleId == 2) {
        $listUsers = $userObj->getAllUsersPerCompany($companyId, false);
    } else {
        $listUsers = $userObj->getAllUsers(false);
    }
}
?>

<div class="pull-left"><h4>Users</h4></div>
<div class="pull-right"><a href="add_user.html" class="btn btn-warning"><i class="icon-plus icon-white"></i> Add User</a></div>
<div class="clearfix"></div>

<div id="status-message"></div>
<table id="userTable" class="common-table">
<tr>
	<th>Username/Email</th>
	<th>Name</th>
	<th>Company</th>
	<th>User Type</th>
开发者ID:erickigotho,项目名称:Paxis,代码行数:31,代码来源:users.php

示例13: User

 } else {
     $per_page = 50;
 }
 if ($per_page > 500) {
     $per_page = 1;
 }
 if (isset($_GET['iDisplayStart'])) {
     $start = $_GET['iDisplayStart'];
 } else {
     $start = 0;
 }
 $user = new User();
 if (isset($_GET['sSearch']) && $_GET['sSearch']) {
     $users = $user->search($_GET['sSearch'], $start, $per_page, $sortby, $sortdir);
 } else {
     $users = $user->getAllUsers(null, $start, $per_page, $sortby, $sortdir);
 }
 $res = array();
 $res['sEcho'] = $echo;
 if (isset($_GET['sSearch']) && $_GET['sSearch']) {
     $res['iTotalDisplayRecords'] = $user->getUserCount($_GET['sSearch']);
 } else {
     $res['iTotalDisplayRecords'] = $user->getUserCount();
 }
 $res['iTotalRecords'] = count($users);
 $res['aaData'] = array();
 if (count($users)) {
     foreach ($users as $key => $val) {
         extract($val);
         if ($fb_id) {
             $facebook_link = "<a href='http://www.facebook.com/profile.php?id={$fb_id}' target='_blank'>{$fb_id}</a>";
开发者ID:kvox,项目名称:TVSS,代码行数:31,代码来源:users_paginate.php

示例14: authentificationRequire

<?php

authentificationRequire();
echo "<section id='listUser'>" . "<h2>Les utilisateurs connectés</h2>";
foreach (User::getAllUsers() as $user) {
    echo "<a href='/Salon/Canal/" . $user->getID() . "'>" . $user->getPseudo() . "</a><br/>";
}
echo "</section>";
?>

开发者ID:Chortan,项目名称:Chat,代码行数:9,代码来源:salon.php

示例15: getSendLink

 public function getSendLink($id)
 {
     $sendto = User::findOrFail($id);
     $users = User::getAllUsers();
     $this->layout->content = View::make('users.chat', array('sendto' => $sendto, 'users' => $users));
 }
开发者ID:nicholedwight,项目名称:LinkMe2,代码行数:6,代码来源:UsersController.php


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