PHP soap登录验证

时间:2016-07-19 17:29:44

标签: php soap

关注我的代码webservice soap:

   if (isset($_POST["action"]) && $_POST["action"] == "login") {
$soapClient = new SoapClient(WEST_SOAP_WSDL,
    array("trace" => WEST_SOAP_TRACE, "login" => WEST_SOAP_LOGIN, "password" => WEST_SOAP_PASS));

try {
    $clienteId = $soapClient->loginAuth($_POST["username"]);
} catch (Exception $e) {
     print_r($e);
}

if ($clienteId) {
    session_regenerate_id(TRUE);

    $_SESSION["auth"]["id"] = $clienteId;
    $_SESSION["auth"]["username"] = $_POST["username"]; 

    try {
        $_SESSION['cliente'] =   serialize($soapClient->getClientDataById($clienteId));
    } catch (Exception $e) {
     print_r($e);
    }

我如何在以下状态限制用户面板中对我的php的访问? :

        inactive
        canceled

0 个答案:

没有答案