本文整理匯總了PHP中Authenticate::mac_id方法的典型用法代碼示例。如果您正苦於以下問題:PHP Authenticate::mac_id方法的具體用法?PHP Authenticate::mac_id怎麽用?PHP Authenticate::mac_id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Authenticate
的用法示例。
在下文中一共展示了Authenticate::mac_id方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: validUserSession
public function validUserSession($app_id, $user_id, $access_token)
{
if ($app_id && $user_id && $access_token) {
$check = $this->_db->select("user_session us", "us.session_id,us.device_token,us.mac_id,us.platform,us.user_id,u.name,u.email", "join user u on u.user_id=us.user_id", "where us.app_id='{$app_id}' and us.user_id='{$user_id}' and access_token='{$access_token}' and login_status='1'");
if ($check) {
if ($this->_db->getNumRows() == 1) {
self::$session_id = $this->_db->getFirst()['session_id'];
self::$session_user_id = $this->_db->getFirst()['user_id'];
self::$device_token = $this->_db->getFirst()['device_token'];
self::$mac_id = $this->_db->getFirst()['mac_id'];
self::$platform = $this->_db->getFirst()['platform'];
self::$session_user_name = $this->_db->getFirst()['name'];
self::$session_user_email = $this->_db->getFirst()['email'];
self::$session_user_type = "user";
return true;
} else {
self::$VALIDATION["error"] = 1;
self::$VALIDATION['status'] = 401;
self::$VALIDATION['message'] = "Invalid access token.";
}
} else {
self::$VALIDATION["error"] = 1;
self::$VALIDATION['status'] = 401;
self::$VALIDATION['message'] = "Invalid access parameters.";
}
} else {
self::$VALIDATION["error"] = 1;
self::$VALIDATION['status'] = 400;
self::$VALIDATION['message'] = "Access parameters not given.";
}
return false;
}