本文整理汇总了PHP中UserInfo::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP UserInfo::getId方法的具体用法?PHP UserInfo::getId怎么用?PHP UserInfo::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserInfo
的用法示例。
在下文中一共展示了UserInfo::getId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: urldecode
// http://www.lovemachineinc.com
require_once "class/frontend.class.php";
require_once "class/UserInfo.php";
$front = Frontend::getInstance();
if (!$front->isUserLoggedIn()) {
$front->getUser()->askUserToAuthenticate();
}
if (isset($_GET['user'])) {
$user = urldecode($_GET['user']);
$userInfo = new UserInfo();
if (strpos($user, '@')) {
$userInfo->loadUserByUsername($user, $front->getCompany()->getid());
} else {
$userInfo->loadUserByNickname($user, $front->getCompany()->getid());
}
if (!$userInfo->getId()) {
header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found");
die("Object Not Found. Error 404");
}
} else {
die('No user data provided');
}
/*********************************** HTML layout begins here *************************************/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>SendLove | User info</title>
<link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico" />
<link href="css/tofor.css" rel="stylesheet" type="text/css" />
示例2: UserInfo
/**
* Given a result record from a Execute call, it will fill in the
* fields of the object, so that we don't have to repeat the same
* code too many times
*/
function _fillUserInformation($query_result, $extraInfo = false)
{
$userInfo = new UserInfo($query_result["user"], $query_result["password"], $query_result["email"], $query_result["about"], $query_result["full_name"], $query_result["resource_picture_id"], unserialize($query_result["properties"]), $query_result["id"]);
if ($extraInfo) {
// load this data if explicitely required!
$userBlogs = $this->getUsersBlogs($userInfo->getId());
$userInfo->setBlogs($userBlogs);
}
// set some permissions
//$userInfo->setSiteAdmin($this->perms->isSiteAdmin( $userInfo->getId()));
$userInfo->setSiteAdmin($query_result["site_admin"]);
$userInfo->setStatus($query_result["status"]);
return $userInfo;
}
示例3: getNicknameByUsername
function getNicknameByUsername()
{
require_once 'class/UserInfo.php';
if (isset($_REQUEST['username'])) {
$user = urldecode($_REQUEST['username']);
$userInfo = new UserInfo();
$userInfo->loadUserByUsername($user, 1);
if ($userInfo->getId()) {
respond(array('success' => true, 'nickname' => $userInfo->getNickname()));
}
}
respond(array('success' => false, 'params' => ''));
}