本文整理汇总了PHP中getUserProfile函数的典型用法代码示例。如果您正苦于以下问题:PHP getUserProfile函数的具体用法?PHP getUserProfile怎么用?PHP getUserProfile使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getUserProfile函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionTest
public function actionTest()
{
/* $user_id = Yii::app()->user->id;
var_dump(Yii::app()->user->isAdmin);
//print_r(User::model()->findByPk($user_id));
echo 'Places='.Place::model()->countUserPlaces($user_id);
echo 'Blocks='.Place::model()->countOwnedBlocks($user_id);
echo 'Estabs='.Place::model()->countOwnedEstablishments($user_id);
yexit();*/
$po = new Pushover();
$po->setToken(Yii::app()->params['pushover']['key']);
$po->setUser(getUserProfile(Yii::app()->user->id)->getAttribute('pushover_token'));
$po->setDevice(getUserProfile(Yii::app()->user->id)->getAttribute('pushover_device'));
$po->setTitle('Hey ' . getFirstName());
$po->setMessage('Hello world! ' . time());
$po->setUrl('http://jeffreifman.com/blog/');
$po->setUrlTitle('cool blog');
$po->setPriority(1);
$po->setTimestamp(time());
$po->setDebug(true);
$go = $po->send();
echo '<pre>';
print_r($go);
echo '</pre>';
}
示例2: startSession
<?php
require 'core/sessions.php';
require 'core/functions.php';
include 'includes/head.php';
startSession();
getGetVar();
include 'includes/header.php';
checkGetID($id);
getUserToken($id);
$yourID = $_COOKIE['online'];
checkProfileOwner($id, $yourID);
if ($ownerID == $id) {
getUserProfile($userID);
echo $firstName;
echo '<br>Your Profile';
} else {
getMemberProfile($id);
echo $fname;
if ($signed_in === 1) {
echo '- Online -';
}
}
示例3: getUserProfile
<?php
include "MonarchPressDb.php";
//test user insert
function getUserProfile($email, $rowID, $url, $user, $pwd, $db)
{
$test = new MonarchPressDb($url, $user, $pwd, $db);
if ($result = $test->search_user_by_email($email)) {
/* fetch object array */
while ($row = $result->fetch_assoc()) {
return $row[$rowID];
}
/* free result set */
$result->close();
}
}
?>
<html>
<body>
<?php
echo "Email: " . getUserProfile('test@test.com', 'email', '128.82.11.37', 'root', 'w@t3rg@t3', 'wordpress') . "<br>";
echo "Username: " . getUserProfile('test@test.com', 'username', '128.82.11.37', 'root', 'w@t3rg@t3', 'wordpress') . "<br>";
echo "Password: " . getUserProfile('test@test.com', 'password', '128.82.11.37', 'root', 'w@t3rg@t3', 'wordpress') . "<br>";
echo "Secret Quetion: " . getUserProfile('test@test.com', 'secret_question', '128.82.11.37', 'root', 'w@t3rg@t3', 'wordpress') . "<br>";
echo "Secret Answer: " . getUserProfile('test@test.com', 'secret_answer', '128.82.11.37', 'root', 'w@t3rg@t3', 'wordpress') . "<br>";
echo "Twitter Username: " . getUserProfile('test@test.com', 'twitter_handle', '128.82.11.37', 'root', 'w@t3rg@t3', 'wordpress') . "<br>";
?>
</body>
</html>
示例4: getShopNameById
<div class="row" style="margin-bottom: 1em;">
<div class="col-xs-4">Магазин:</div>
<div class="col-xs-8"><?php
echo getShopNameById($v->shop_id);
?>
</div>
</div>
<div class="row" style="margin-bottom: 1em;">
<div class="col-xs-4">Сотрудник:</div>
<div class="col-xs-8">
<?php
echo getLinkToUserProfile($v->drop_id);
?>
<?php
if ($user['rankname'] == 'admin' || $user['rankname'] == 'labler' || $user['rankname'] == 'support' || $user['rankname'] == 'shipper') {
$dropAddr = getUserProfile($v->drop_id);
if ($dropAddr !== false) {
echo ' | <small>' . $dropAddr->address . ', ' . $dropAddr->state . ' ' . $dropAddr->country . ' ' . $dropAddr->city . ' ' . $dropAddr->zip . '</small>';
}
}
?>
</div>
</div>
<div class="row" style="margin-bottom: 1em;">
<div class="col-xs-4">Отправитель:</div>
<div class="col-xs-8"><?php
echo getLinkToUserProfile($v->shipper_id);
?>
</div>
</div>
示例5: function
$app->post('/api/user', function ($request, $response, $args) {
$params = $request->getParsedBody();
$token = $params["token"];
$name = $params["name"];
$major = $params["major"];
$interests = $params["interests"];
$this->logger->info("POST /api/user");
$this->logger->info("token: " . $token);
$this->logger->info("name: " . $name);
$email = get_email_from_key($this, $token);
$this->logger->info("email: " . $email);
$query = "UPDATE accounts INNER JOIN users ON accounts.id=users.account_id SET name=?, major=?, interests=? WHERE email=?";
$SQLparams = array($name, $major, $interests, $email);
$link = mysqli_connect(HOST, USER, PASSWORD, DATABASE);
$result = mysqli_prepared_query($this, $link, $query, "ssss", $SQLparams);
mysqli_close($link);
$data['name'] = $name;
$data['major'] = $major;
$data['interests'] = $interests;
$data['token'] = $token;
return $response->withHeader('Content-Type', 'application/json')->write(json_encode($data));
});
$app->get('/api/user', function ($request, $response, $args) {
$params = $request->getQueryParams();
$token = $params['token'];
$email = get_email_from_key($this, $token);
$this->logger->info("GET /api/user");
$this->logger->info("email: " . $email);
$data = getUserProfile($this, $email);
return $response->withJson($data);
});
示例6: file_get_contents
<?php
include_once "../database.php";
$json = file_get_contents('php://input');
$request = json_decode($json, true);
$userid = isset($request["userid"]) ? $request["userid"] : "";
echo json_encode(getUserProfile($userid));
示例7: getUserProfile
<?php
include_once "header.php";
include_once "sidebar.php";
$userid = $_GET['uid'];
$data = getUserProfile($userid)[0];
$pos = getUserLatLng($userid)[0];
?>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
Map
</h1>
<ol class="breadcrumb">
<li><a href="dashboard.php"><i class="fa fa-dashboard"></i>Home</a></li>
<li class="active">Here</li>
</ol>
</section>
<script src="https://maps.googleapis.com/maps/api/js"></script>
<script>
var map;
function initMap() {
var latlng = {lat: <?php
echo $pos['lat'];
?>
, lng: <?php
echo $pos['lng'];
示例8: function
$app->post('/login', function ($request, $response, $args) {
$params = $request->getParsedBody();
$email = $params["email"];
$password = $params["password"];
$result = login($this, $email, $password);
$isActive = $result["isActive"];
$pwdCorrect = $result["pwdCorrect"];
$name = $result["name"];
if ($isActive && $pwdCorrect) {
$role = get_account_type_from_email($this, $email);
$_SESSION["email"] = $email;
$_SESSION["name"] = $name;
$_SESSION["role"] = $role;
$_SESSION['token'] = get_session_key_from_email($this, $email);
if ($role == "user") {
$profile = getUserProfile($this, $email);
$_SESSION["major"] = $profile["major"];
return $response->withStatus(303)->withHeader('Location', '/recommendation');
} elseif ($role == "admin") {
return $response->withStatus(303)->withHeader('Location', '/admin');
}
}
if (!$isActive && $pwdCorrect) {
$error = "Account is disabled";
} else {
$error = "Username or Password Incorrect";
}
$url = buildInterstitialURL("Back to Login", "/", $error);
return $response->withStatus(303)->withHeader('Location', $url);
});
$app->post('/register', function ($request, $response, $args) {
示例9: getUserRankList
}
?>
</tr>
<?php
$usersRanks = getUserRankList(-1, $currentMatchTypeId, -1, -1, 1, 0);
// ARRAY_A | ARRAY_N | OBJECT | OBJECT_K
sort($usersRanks);
foreach ($usersRanks as $user) {
?>
<tr id="poll-5" class="highlight">
<td height="24" align="center"><?php
echo ++$i;
?>
</td>
<td height="24" align="center"><?php
$userprofile = getUserProfile($user->uid);
echo $userprofile[0]->realname;
?>
</td>
<?php
foreach ($rankTypeList as $rankType) {
$userRanks = getUserRankList($user->uid, $currentMatchTypeId, $rankType->id);
echo '<td height="24" align="center">' . $userRanks[0]->value . '</td>';
}
?>
</tr>
<?php
}
?>
</table>
示例10: getUserFullName
function getUserFullName($id = 0)
{
$fullname = getUserProfile($id)->getAttribute('first_name') . ' ' . substr(getUserProfile($id)->getAttribute('last_name'), 0, 1) . '.';
$fullname = ucwords($fullname);
return $fullname;
}
示例11: unset
unset($dataDecoded['limit']);
}
//if the userHash property is set: query the DB to return the user_id and add that as a property to the dataDecoded array.
if (isset($dataDecoded['userHash'])) {
$userHash = $dataDecoded['userHash'];
$userID = (array) $db->action('SELECT `user_id`', 'users_session', array('hash', '=', $userHash))->first();
$dataDecoded['userID'] = $userID['user_id'];
unset($dataDecoded['userHash']);
}
//This switch statement controls the request's program flow, depending on the defined action property.
switch ($action) {
case 'get':
get($db, $table, $where);
break;
case 'getUserProfile':
getUserProfile($db, $table, $where);
break;
case 'getVisualisationData':
getUserData($db, $dataDecoded);
break;
case 'getLast':
getLast($db, $table, $where);
break;
case 'getMostFrequent':
getMostFrequent($db, $table, $where, $colForCount, $groupBy, $orderBy, $ascOrDesc, $limit);
break;
case 'save':
save($db, $table, $dataDecoded);
break;
case 'confirmIDPassword':
confirmIDPassword($db, $dataDecoded);
示例12: getProfile
function getProfile()
{
session_start();
$email = $_SESSION['email'];
$result = getUserProfile($email);
echo json_encode($result);
}
示例13: elseif
} elseif ($id_type == "mobile") {
$sql = "SELECT id FROM `bluenet_v3`.`users` WHERE mobile = '" . $id_number . "'";
$userrow = mysqli_query($db_handle, $sql);
$userrowid = mysqli_fetch_array($userrow);
$userId = $userrowid['id'];
} else {
$searchPram = "";
if ($id_type == "pc") {
$searchPram = " `pan_card_uid` = '" . $id_number . "'";
} else {
if ($id_type == "pv") {
$searchPram = " `pv_uid` = '" . $id_number . "'";
} else {
if ($id_type == "ac") {
$searchPram = " `adhar_card_uid` = '" . $id_number . "'";
} else {
if ($id_type == "vc") {
$searchPram = " `voter_id_uid` = '" . $id_number . "'";
} else {
$searchPram = " `driving_license_uid` = '" . $id_number . "'";
}
}
}
}
$sql = "SELECT user_id as id FROM `bluenet_v3`.`user_documents_uid` WHERE" . $searchPram;
$userrow = mysqli_query($db_handle, $sql);
$userrowid = mysqli_fetch_array($userrow);
$userId = $userrowid['id'];
}
$profile = getUserProfile($db_handle, $userId);
echo "{\"root\":{\"worker\":" . json_encode($profile) . "}}";
示例14: getCombinedUserActionPermissions
/** To retreive the vtiger_tab acion permissions of the specifed user from the various vtiger_profiles associated with the user
* @param $userid -- The User Id:: Type Integer
* @returns user global permission array in the following format:
* $actionPerrArray=(tabid1=>permission,
* tabid2=>permission);
*/
function getCombinedUserActionPermissions($userId)
{
$log = vglobal('log');
$log->debug("Entering getCombinedUserActionPermissions(" . $userId . ") method ...");
$adb = PearDatabase::getInstance();
$profArr = getUserProfile($userId);
$no_of_profiles = sizeof($profArr);
$actionPerrArr = array();
$actionPerrArr = getProfileAllActionPermission($profArr[0]);
if ($no_of_profiles != 1) {
for ($i = 1; $i < $no_of_profiles; $i++) {
$tempActionPerrArr = getProfileAllActionPermission($profArr[$i]);
foreach ($actionPerrArr as $tabId => $perArr) {
foreach ($perArr as $actionid => $per) {
if ($per == 1) {
$now_permission = $tempActionPerrArr[$tabId][$actionid];
if ($now_permission == 0 && $now_permission != "") {
$actionPerrArr[$tabId][$actionid] = $now_permission;
}
}
}
}
}
}
$log->debug("Exiting getCombinedUserActionPermissions method ...");
return $actionPerrArr;
}
示例15: CheckPermissions
public function CheckPermissions($actionKey)
{
$current_user = Users_Record_Model::getCurrentUserModel();
$profileid = getUserProfile($current_user->id);
$result = false;
if (isset($this->profilesActions[$actionKey])) {
//$actionid = getActionid($this->profilesActions[$actionKey]);
if (isPermitted('PDFMaker', $this->profilesActions[$actionKey]) == "yes") {
$result = true;
}
}
return $result;
}