本文整理汇总了PHP中BuckysUser::checkUserID方法的典型用法代码示例。如果您正苦于以下问题:PHP BuckysUser::checkUserID方法的具体用法?PHP BuckysUser::checkUserID怎么用?PHP BuckysUser::checkUserID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BuckysUser
的用法示例。
在下文中一共展示了BuckysUser::checkUserID方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addUser
/**
* Add Trade user
*
* @param integer $userID
* @param array $data
*/
public function addUser($userID, $data = array())
{
global $db;
$userIns = new BuckysUser();
if (!is_numeric($userID) || !$userIns->checkUserID($userID, false)) {
return;
}
if ($this->checkDuplication($userID)) {
return;
}
$data['userID'] = $userID;
$newID = $db->insertFromArray(TABLE_TRADE_USERS, $data);
return $newID;
}
示例2: addUser
/**
* Add Trade user
*
* @param integer $userID
* @param array $data
* @return int|null|string|void
*/
public function addUser($userID, $data = [])
{
global $db;
$userIns = new BuckysUser();
if (!is_numeric($userID) || !$userIns->checkUserID($userID, false)) {
return;
}
if ($this->checkDuplication($userID)) {
return;
}
$user_base_info = buckysuser::getUserBasicInfo($userID);
if (!$user_base_info) {
return;
}
$data['userID'] = $userID;
$data['shippingFullName'] = trim($user_base_info['firstName'] . ' ' . $user_base_info['lastName']);
//When adding address, put your full name to this record
$newID = $db->insertFromArray(TABLE_TRADE_USERS, $data);
return $newID;
}
示例3: buckys_get_token_param
$resultXML = ['status' => 'success', 'message' => MSG_FRIEND_REQUEST_REMOVED, 'html' => 'Send Friend Request', 'action' => 'delete-friend-request', 'link' => '/myfriends.php?action=request&friendID=' . $friendID . buckys_get_token_param()];
render_result_xml($resultXML);
} else {
buckys_redirect($return, MSG_FRIEND_REQUEST_REMOVED);
}
} else {
if ($isAjax) {
$resultXML = ['status' => 'error', 'message' => $db->getLastError()];
render_result_xml($resultXML);
} else {
buckys_redirect($return, $db->getLastError(), MSG_TYPE_ERROR);
}
}
} else {
if ($_REQUEST['action'] == 'request') {
if (!isset($friendID) || !BuckysUser::checkUserID($friendID)) {
if ($isAjax) {
$resultXML = ['status' => 'error', 'message' => MSG_INVALID_REQUEST];
render_result_xml($resultXML);
} else {
buckys_redirect($return, MSG_INVALID_REQUEST, MSG_TYPE_ERROR);
}
exit;
}
if (BuckysFriend::isFriend($userID, $friendID)) {
if ($isAjax) {
$resultXML = ['status' => 'error', 'message' => MSG_INVALID_REQUEST];
render_result_xml($resultXML);
} else {
buckys_redirect($return, MSG_INVALID_REQUEST, MSG_TYPE_ERROR);
}
示例4: dirname
<?php
require dirname(__FILE__) . '/includes/bootstrap.php';
//Getting Current User ID
$userID = buckys_is_logged_in();
//Getting User ID from Parameter
$profileID = get_secure_integer($_GET['user']);
$postID = buckys_escape_query_integer(isset($_GET['post']) ? $_GET['post'] : null);
//If the parameter is null, goto homepage
if (!$profileID) {
buckys_redirect('/index.php');
}
//Getting UserData from Id
$userData = BuckysUser::getUserData($profileID);
//Goto Homepage if the userID is not correct
if (!buckys_not_null($userData) || !BuckysUser::checkUserID($profileID, true)) {
buckys_redirect('/index.php');
}
$postType = isset($_GET['type']) ? $_GET['type'] : 'all';
if (!in_array($postType, ['all', 'user', 'friends'])) {
$postType = 'all';
}
//if logged user can see all resources of the current user
$canViewPrivate = $userID == $profileID || BuckysFriend::isFriend($userID, $profileID) || BuckysFriend::isSentFriendRequest($profileID, $userID);
$posts = BuckysPost::getPostsByUserID($profileID, $userID, BuckysPost::INDEPENDENT_POST_PAGE_ID, $canViewPrivate, $postID, null, $postType);
/*if( !buckys_not_null($posts) )
{
//Goto Index Page
buckys_redirect('/index.php', MSG_INVALID_REQUEST, MSG_TYPE_ERROR);
}*/
//Mark the notifications to read
示例5: buckys_redirect
} else {
buckys_redirect('/myfriends.php?type=requested', $db->getLastError(), MSG_TYPE_ERROR);
}
} else {
if ($_REQUEST['action'] == 'delete') {
if (BuckysFriend::delete($userID, $_REQUEST['friendID'])) {
buckys_redirect($return, MSG_FRIEND_REQUEST_REMOVED);
} else {
buckys_redirect($return, $db->getLastError(), MSG_TYPE_ERROR);
}
} else {
if ($_REQUEST['action'] == 'request') {
if (!isset($_REQUEST['friendID']) || !isset($_REQUEST['friendIDHash']) || !buckys_check_id_encrypted($_REQUEST['friendID'], $_REQUEST['friendIDHash'])) {
buckys_redirect($return, MSG_INVALID_REQUEST, MSG_TYPE_ERROR);
}
if (!BuckysUser::checkUserID($_REQUEST['friendID'])) {
buckys_redirect($return, MSG_INVALID_REQUEST, MSG_TYPE_ERROR);
}
if (BuckysFriend::isFriend($userID, $_REQUEST['friendID'])) {
buckys_redirect($return, MSG_INVALID_REQUEST, MSG_TYPE_ERROR);
}
if (BuckysFriend::isSentFriendRequest($userID, $_REQUEST['friendID'])) {
buckys_redirect($return, MSG_FRIEND_REQUEST_ALREADY_SENT, MSG_TYPE_ERROR);
}
if (BuckysFriend::isSentFriendRequest($_REQUEST['friendID'], $userID)) {
buckys_redirect($return, MSG_FRIEND_REQUEST_ALREADY_SENT, MSG_TYPE_ERROR);
}
if (BuckysFriend::sendFriendRequest($userID, $_REQUEST['friendID'])) {
buckys_redirect($return, MSG_FRIEND_REQUEST_SENT);
} else {
buckys_redirect($return, $db->getLastError(), MSG_TYPE_ERROR);
示例6: removeUserFromBuddylist
/**
* Remove the user from buddylist
*
* @param Int $userID = Blocker ID
* @param Int $blockedID
* @return String or Array
*/
public function removeUserFromBuddylist($userID, $buddyID)
{
global $db;
$query = $db->prepare("SELECT messengerBuddylistID FROM " . TABLE_MESSENGER_BUDDYLIST . " WHERE userID=%d AND buddyID=%d", $userID, $buddyID);
$mbID = $db->getVar($query);
if (!buckys_not_null($mbID)) {
return MSG_INVALID_REQUEST;
}
//Check buddyID
if (!BuckysUser::checkUserID($buddyID)) {
return MSG_INVALID_REQUEST;
}
//Remove User from the buddylist
if (!$db->query($db->prepare("DELETE FROM " . TABLE_MESSENGER_BUDDYLIST . " WHERE userID=%d AND buddyID=%d", $userID, $buddyID))) {
return $db->getLastError();
} else {
//Update Buddylist status
$db->query($db->prepare("UPDATE " . TABLE_MESSENGER_BUDDYLIST . " SET `status`=0 WHERE userID=%d AND buddyID=%d", $buddyID, $userID));
//Remove From the Conversation List
BuckysPrivateMessenger::closeConversationBox($buddyID);
return true;
}
}
示例7: declineFriendRequestAction
public function declineFriendRequestAction()
{
global $db;
$data = $_POST;
$token = isset($data['TOKEN']) ? trim($data['TOKEN']) : null;
$friendID = isset($data['friendID']) ? $data['friendID'] : null;
if (!$token) {
return ['STATUS_CODE' => STATUS_CODE_BAD_REQUEST, 'DATA' => buckys_api_get_error_result('Api token should not be blank')];
}
if (!($userID = BuckysUsersToken::checkTokenValidity($token, "api"))) {
return ['STATUS_CODE' => STATUS_CODE_UNAUTHORIZED, 'DATA' => buckys_api_get_error_result('Api token is not valid.')];
}
if (!isset($friendID) || !BuckysUser::checkUserID($friendID)) {
return ['STATUS_CODE' => STATUS_CODE_OK, 'DATA' => buckys_api_get_error_result(MSG_INVALID_REQUEST)];
}
if (BuckysFriend::decline($userID, $friendID)) {
return ['STATUS_CODE' => STATUS_CODE_OK, 'DATA' => ['STATUS' => "SUCCESS", "MESSAGE" => MSG_FRIEND_REQUEST_DECLINED]];
} else {
return ['STATUS_CODE' => STATUS_CODE_UNAUTHORIZED, 'DATA' => buckys_api_get_error_result($db->getLastError())];
}
}
示例8: dirname
require dirname(__FILE__) . '/includes/bootstrap.php';
//Getting Current User ID
if (!buckys_check_user_acl(USER_ACL_ADMINISTRATOR)) {
buckys_redirect('/index.php', MSG_PERMISSION_DENIED, MSG_TYPE_ERROR);
}
if (isset($_REQUEST['action'])) {
if ($_REQUEST['action'] == 'unban') {
BuckysBanUser::unbanUsers($_REQUEST['bannedID']);
buckys_redirect('/banned_users.php', MSG_UNBAN_USERS);
} else {
if ($_REQUEST['action'] == 'delete') {
BuckysBanUser::deleteUsers($_REQUEST['bannedID']);
buckys_redirect('/banned_users.php', MSG_DELETE_USERS);
} else {
if ($_REQUEST['action'] == 'deletebyid') {
if (!isset($_REQUEST['userID']) || !BuckysUser::checkUserID($_REQUEST['userID'], false)) {
buckys_redirect('/index.php', MSG_INVALID_REQUEST, MSG_TYPE_ERROR);
}
BuckysUser::deleteUserAccount($_REQUEST['userID']);
buckys_redirect('/index.php', MSG_DELETE_USERS);
}
}
}
exit;
}
$page = isset($_GET['page']) ? $_GET['page'] : 1;
$totalCount = BuckysBanUser::getBannedUsersCount();
//Init Pagination Class
$pagination = new Pagination($totalCount, BuckysBanUser::$COUNT_PER_PAGE, $page);
$page = $pagination->getCurrentPage();
$users = BuckysBanUser::getBannedUsers($page, BuckysBanUser::$COUNT_PER_PAGE);
示例9: buckys_redirect
}
//Ban User
BuckysBanUser::banUser($_GET['userID']);
buckys_redirect('/index.php', MSG_BAN_USER);
exit;
}
//Getting User ID from Parameter
$profileID = buckys_escape_query_integer(isset($_GET['user']) ? $_GET['user'] : null);
//If the parameter is null, goto homepage
if (!$profileID) {
buckys_redirect('/index.php');
}
//Getting UserData from Id
$userData = BuckysUser::getUserData($profileID);
//Goto Homepage if the userID is not correct
if (!buckys_not_null($userData) || !BuckysUser::checkUserID($profileID, true) && !buckys_check_user_acl(USER_ACL_ADMINISTRATOR)) {
buckys_redirect('/index.php');
}
$postType = isset($_GET['type']) ? $_GET['type'] : 'all';
if (!in_array($postType, ['all', 'user', 'friends'])) {
$postType = 'all';
}
//if logged user can see all resources of the current user
$canViewPrivate = $userID == $profileID || BuckysFriend::isFriend($userID, $profileID) || BuckysFriend::isSentFriendRequest($profileID, $userID);
$friends = BuckysFriend::getAllFriends($profileID, 1, 18, true);
$totalFriendsCount = BuckysFriend::getNumberOfFriends($profileID);
$posts = BuckysPost::getPostsByUserID($profileID, $userID, BuckysPost::INDEPENDENT_POST_PAGE_ID, $canViewPrivate, isset($_GET['post']) ? $_GET['post'] : null, null, $postType);
buckys_enqueue_stylesheet('account.css');
buckys_enqueue_stylesheet('profile.css');
buckys_enqueue_stylesheet('posting.css');
buckys_enqueue_stylesheet('publisher.css');