當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserService::getUserByUsername方法代碼示例

本文整理匯總了PHP中UserService::getUserByUsername方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserService::getUserByUsername方法的具體用法?PHP UserService::getUserByUsername怎麽用?PHP UserService::getUserByUsername使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UserService的用法示例。


在下文中一共展示了UserService::getUserByUsername方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: it_returns_null_when_a_parse_exception_occurs_when_searching_by_username

 /**
  * @test
  */
 public function it_returns_null_when_a_parse_exception_occurs_when_searching_by_username()
 {
     $username = 'foo';
     $query = new \CultureFeed_SearchUsersQuery();
     $query->nick = $username;
     $this->cultureFeed->expects($this->once())->method('searchUsers')->with($query)->willThrowException(new \CultureFeed_ParseException('error'));
     $user = $this->service->getUserByUsername($username);
     $this->assertNull($user);
 }
開發者ID:cultuurnet,項目名稱:silex-uitid-provider,代碼行數:12,代碼來源:UserServiceTest.php

示例2: UserService

<?php

require_once "forAllPages.php";
require_once 'services/user.service.php';
require_once 'services/goods.service.php';
$userService = new UserService();
$goodsService = new GoodsService();
var_dump($userService->getUserByUsername('nimitae'));
開發者ID:Nimitae,項目名稱:Storenmore,代碼行數:8,代碼來源:testing.php

示例3: header

<?php

require_once "forAllPages.php";
require_once "services/user.service.php";
if (!isset($_SESSION['username'])) {
    header('Location: login.php');
}
$userService = new UserService();
$currentUser = $userService->getUserByUsername($_SESSION['username']);
//var_dump($currentUser);
include "partials/header.partial.php";
?>
<div style="height: 40px"></div>
<h1 style="margin-left: 30px"><img src="images/wrench77.png" style="display: inline-block"> Settings</h1>
<div style="height: 20px"></div>
<div class="container" style="background-color: white; width:50%; padding:15px; float: left; margin-left: 40px">
    <form class="form-horizontal contactRows">
        Leave any text box blank if you do not wish to display those details on your profile page.
        <div style="height: 30px"></div>
        <div class="form-group">
            <label for="Email" class="col-sm-3 control-label">Email</label>

            <div class="inline-block col-sm-6">
                <input name="email" class="form-control" type="text" id="Email" placeholder="Email" value="<?php 
sizeof($currentUser->contactContainer[1]) > 0 ? print $currentUser->contactContainer[1][0]->value : (print "");
?>
">
            </div>
        </div>

        <div class="form-group">
開發者ID:Nimitae,項目名稱:Storenmore,代碼行數:31,代碼來源:profile-edit.php

示例4: setcookie

     setcookie("pwd");
     header("Location: ./login.php");
     break;
 case 'pwd_change_get':
     require_once './user_view_pwd_change.php';
     break;
 case 'pwd_change_post':
     require_once 'class/user.class.php';
     require_once 'class/user_service.class.php';
     $username = trim($_POST['username']);
     $pwd = md5(trim($_POST['pwd']));
     $user = new User(null, null, null, null, $username, $pwd, null, null, null, null);
     $user_service = new UserService();
     $rs = $user_service->validateUser($user);
     if ($rs) {
         $user = $user_service->getUserByUsername($username);
         $user->pwd = md5($_POST["new_pwd"]);
         print_r($user);
         $user_service->updateUser($user);
         $_SESSION['operation'] = true;
         $_SESSION['operation_msg'] = "修改密碼:" . $username . "成功";
         $log_service->addLog("update", "用戶修改密碼", $id);
         header("Location: ./index.php?mod=home");
     } else {
         $_SESSION['operation'] = false;
         $_SESSION['operation_msg'] = "密碼錯誤,請重新輸入";
         header("Location: index.php?mod=user&action=pwd_change_get");
     }
     break;
 default:
     break;
開發者ID:udzhou,項目名稱:SupplierManagement,代碼行數:31,代碼來源:user_controller.php

示例5: UserService

<?php

require_once "forAllPages.php";
require_once "services/user.service.php";
require_once "services/goods.service.php";
$userService = new UserService();
$goodsService = new GoodsService();
$goodsContainer = $goodsService->getAllGoods();
$userFound = false;
if (isset($_GET['u'])) {
    $browsedUser = $userService->getUserByUsername($_GET['u']);
    if ($browsedUser) {
        $userFound = true;
    } else {
        $userFound = false;
    }
}
if ($userFound) {
    include "views/profile.view.php";
} else {
    include "views/profilesearch.view.php";
}
開發者ID:Nimitae,項目名稱:Storenmore,代碼行數:22,代碼來源:profile.php


注:本文中的UserService::getUserByUsername方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。