AbleCloud PHP SDK
1.8.x
PHP SDK of AbleCloud API
|
Public 成员函数 | |
__construct ($name, $version, $context) | |
changePhone ($user, $phone, $verifyCode, $password) | |
changeNickName ($user, $nickName) | |
updateUserToken ($user) | |
resetPassword ($userId, $account, $password, $verifyCode) | |
resetPasswordByAccount ($account, $password, $verifyCode) | |
clearUsers () | |
用户帐号注册与登录。 | |
getVerifyCode ($account, $timeout) | |
sendVerifyCode ($account, $template, $timeout) | |
checkVerifyCode ($account, $verifyCode) | |
register ($name, $email, $phone, $password, $verifyCode, $enableTokenExpiration=FALSE) | |
login ($account, $password, $enableTokenExpiration=FALSE) | |
getUser ($account, $password, $enableTokenExpiration=FALSE) | |
getAccountInfo ($userId) | |
getIdByAccount ($account) | |
checkAccountExist ($login) | |
getAccountCount () | |
listAllAccounts ($offset, $limit) | |
getAccountsByIds ($userIds) | |
第三方平台用户 | |
registerByOpenId ($openId, $provider, $unionId='', $enableTokenExpiration=FALSE) | |
getUserByOpenId ($openId, $provider, $unionId='', $enableTokenExpiration=FALSE) | |
getAccountByOpenId ($openId, $provider, $enableTokenExpiration=FALSE) | |
getUserOpenId ($userId, $provider) | |
用户的扩展属性 | |
setUserProfile ($user, $profile) | |
getUserProfile ($user) | |
getUserWholeProfile ($uid=0, $account='') | |
getProfilesByUserList ($userIds) | |
![]() | |
__construct ($name, $version, $context) | |
getName () | |
getVersion () | |
getContext () | |
getLastError () | |
额外继承的成员函数 | |
![]() | |
resetLastError ($errCode=0, $errMessage='') | |
AbleCloud帐号服务。
ACAccountMgr::__construct | ( | $name, | |
$version, | |||
$context | |||
) |
构造函数。
$name | string AbleCloud帐号服务的名字。 |
$version | int AbleCloud帐号服务的主版本号。 |
$context | ACContext 表示访问该远程服务所依赖的环境信息。 |
ACAccountMgr::changeNickName | ( | $user, | |
$nickName | |||
) |
修改用户显示名称。
$user | ACUser 是要修改显示名的用户。 |
$nickName | string 用户的新名字。 |
ACAccountMgr::changePhone | ( | $user, | |
$phone, | |||
$verifyCode, | |||
$password | |||
) |
修改用户的手机号码。
$user | ACUser 是要修改手机号的用户。 |
$phone | string 字符串,是用户的新手机号码。 |
$verifyCode | string 是验证码。 |
$password | string 是用户的密码。 |
ACAccountMgr::checkAccountExist | ( | $login | ) |
检查帐号是否已经存在。
$login | string 表示用户的登录名,如邮箱或者手机号。 |
ACAccountMgr::checkVerifyCode | ( | $account, | |
$verifyCode | |||
) |
检查验证码是否有效。
$account | string 与验证码匹配的用户帐号:Email地址或者手机号码。 |
$verifyCode | string 待检查的验证码。 |
ACAccountMgr::clearUsers | ( | ) |
清除已注册的帐号信息。仅测试环境支持该方法。
ACAccountMgr::getAccountByOpenId | ( | $openId, | |
$provider, | |||
$enableTokenExpiration = FALSE |
|||
) |
ACAccountMgr::getAccountCount | ( | ) |
检查用户的总数。
ACAccountMgr::getAccountInfo | ( | $userId | ) |
根据用户的Id查找用户信息。
$userId | int 用户的ID。 |
ACAccountMgr::getAccountsByIds | ( | $userIds | ) |
依据用户的ID批量获取用户的帐号信息。
$userIds | array 拟查询的用户ID的列表。 |
ACAccountMgr::getIdByAccount | ( | $account | ) |
根据电话或Email查找用户ID。
$account | string 待查询的用户的帐号:Email或者电话号码。 |
ACAccountMgr::getProfilesByUserList | ( | $userIds | ) |
根据用户uid列表查找用户的信息(基本信息+扩展信息)。一次最多可查询1000个用户的信息。
$userIds | array 待查询的用户ID的数组。元素个数必须小于等于1000。 |
ACAccountMgr::getUser | ( | $account, | |
$password, | |||
$enableTokenExpiration = FALSE |
|||
) |
按登录名和密码取用户的信息。
$account | string 用户的登录名。 |
$password | string 用户登录密码。 |
$enableTokenExpiration | bool 是否使用用户TOKEN过期的机制。缺省为不使用。 |
ACAccountMgr::getUserByOpenId | ( | $openId, | |
$provider, | |||
$unionId = '' , |
|||
$enableTokenExpiration = FALSE |
|||
) |
按OpenID和帐号来源取用户的信息。
$openId | string 用户的OpenID。 |
$provider | string 用户的来源。如"weixin"等。 |
$unionId | string 对来自微信平台的用户,是其在微信平台对应的UnionID。 |
$enableTokenExpiration | bool 是否使用用户TOKEN过期的机制。缺省为不使用。 |
ACAccountMgr::getUserOpenId | ( | $userId, | |
$provider | |||
) |
获取用户在第三方平台上的OpenID。
$userId | int 是用户在AbleCloud平台上的ID。 |
$provider | string 标识第三方平台。如'weixin'表示微信平台。 |
ACAccountMgr::getUserProfile | ( | $user | ) |
获取用户的扩展属性。
$user | ACUser 表示要获取其扩展属性的用户。 |
ACAccountMgr::getUserWholeProfile | ( | $uid = 0 , |
|
$account = '' |
|||
) |
获取用户的全部属性:包括基础属性及扩展属性。
$uid | int 表示要获取其属性的用户的ID。参数$uid和$account至少需提供一个。 |
$account | string 表示要获取其属性的用户的帐号名:Email地址或者电话。参数$uid和$account至少需提供一个。 |
ACAccountMgr::getVerifyCode | ( | $account, | |
$timeout | |||
) |
获取用户注册的验证码。
$account | string 是用户的登录名:email地址或手机号。 |
$timeout | int 是验证码的有效时长。单位为秒。 |
ACAccountMgr::listAllAccounts | ( | $offset, | |
$limit | |||
) |
查询用户列表。
$offset | int 查询的记录偏移量。取值应该为非负整数。 |
$limit | int 限制本次调用查询的记录的最大数目。取值范围是闭区间[1, 100]。 |
ACAccountMgr::login | ( | $account, | |
$password, | |||
$enableTokenExpiration = FALSE |
|||
) |
按登录名和密码登录,取用户的信息。
$account | string 用户的登录名。 |
$password | string 用户登录密码。 |
$enableTokenExpiration | bool 是否使用用户TOKEN过期的机制。缺省为不使用。 |
ACAccountMgr::register | ( | $name, | |
$email, | |||
$phone, | |||
$password, | |||
$verifyCode, | |||
$enableTokenExpiration = FALSE |
|||
) |
注册用户帐号。
$name | string 用户的显示名。 |
string 新用户的邮箱。$email与$phone不能都为空字符串。 | |
$phone | string 新用户的手机号码。$email与$phone不能都为空字符串。 |
$password | string 新用户的登录密码。 |
$verifyCode | string 注册新用户时所使用的验证码。 |
$enableTokenExpiration | bool 是否使用用户TOKEN过期的机制。缺省为不使用。 |
ACAccountMgr::registerByOpenId | ( | $openId, | |
$provider, | |||
$unionId = '' , |
|||
$enableTokenExpiration = FALSE |
|||
) |
使用第三方帐号注册用户。
$openId | string 第三方帐号的OpenID。 |
$provider | string 第三方帐号的来源。如"weixin"。 |
$unionId | string 对来自微信平台的用户,是其在微信平台对应的UnionID。如果不提供该参数,则无法识别同一个用户关注开发者的多个微信公众号的情况。 |
$enableTokenExpiration | bool 是否使用用户TOKEN过期的机制。缺省为不使用。 |
ACAccountMgr::resetPassword | ( | $userId, | |
$account, | |||
$password, | |||
$verifyCode | |||
) |
重设用户的密码。
$userId | int 要更新其密码的用户的ID。 |
$account | string 要更新其密码的用户的登录名。 |
$password | string 用户的新密码。 |
$verifyCode | string 更新用户密码的验证码。 |
ACAccountMgr::resetPasswordByAccount | ( | $account, | |
$password, | |||
$verifyCode | |||
) |
重设用户的密码。
$account | string 要更新其密码的用户的登录名。 |
$password | string 用户的新密码。 |
$verifyCode | string 更新用户密码的验证码。 |
ACAccountMgr::sendVerifyCode | ( | $account, | |
$template, | |||
$timeout | |||
) |
向指定的手机号或电子邮箱发送验证码。
$account | string 接收验证码的手机号或电子邮箱地址。 |
$template | int 是短信模板的代码。 |
$timeout | int 是验证码的有效时长,单位是秒。 |
ACAccountMgr::setUserProfile | ( | $user, | |
$profile | |||
) |
设置用户的扩展属性。
$user | ACUser ACUser对象,表示要设置其扩展属性的用户。 |
$profile | array 是由键值对组成的关联数组,表示用户的扩展属性值。 |
ACAccountMgr::updateUserToken | ( | $user | ) |
更新用户的Token。
$user | ACUser 要更新其Token的用户。操作成功后直接更新该对象保存的信息。 |