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