vbulletin php api登录后获取权限用户

时间:2018-12-06 08:49:01

标签: php api vbulletin

嗨,我正在使用vbulletin php api

当我进行登录时,它返回成功

 "sessionhash": "b9e47e2e85563110b6be0abe52efbb47",
    "userid": "512",
    "password": "13dc431417be2136431081fb68735c9b08a124f7f4af4e35c043d92a",
    "lastvisit": "1542800675",
    "lastactivity": "1542800675"

但是当我收到用户通知时,它会返回

  "not_logged_no_permission"

如何记录用户访问权限

我的代码登录名是

    $password = array(
    'password' => $_POST['password'],
    'md5password' => md5($_POST['password']),
    'md5password_utf' => '',
);
$extraAuthInfo = array();

$response = $api->callApi('user', 'login2', array($_POST['username'], $password ,$extraAuthInfo,''));
if (empty($response['errors'])){
    $responseData = array('success'=>'1', 'message'=>"success" , 'data'=> $response);
    echo json_encode($responseData);
    //$r = vB5_Auth::setLoginCookies($response, '', $responseData['data']['sessionhash']);
    $r = vB5_Auth::setLoginCookies($responseData['data']['sessionhash'], $responseData['data']['userid'] ,'30');
    echo json_encode($r ,true);
}else{
    $responseData = array('success'=>'0', 'message'=>"error" , 'data'=> $response);
    echo json_encode($responseData);
}

0 个答案:

没有答案