public function DeployServicesClient::logout in Deploy Services Client 7
Logs out of the deployment endpoint.
Return value
TRUE on successful logout, or FALSE if there was no active session and therefore no logout could be performed.
See also
DeployAuthenticatorSession::deploy()
1 call to DeployServicesClient::logout()
- DeployServicesClient::login in ./
deploy_services_client.client.inc - Logs in to the deployment endpoint via session authentication.
File
- ./
deploy_services_client.client.inc, line 149 - Defines a Services client class which communicates with Deployment endpoints.
Class
- DeployServicesClient
- Class which defines a Services client based on a Deployment endpoint.
Code
public function logout() {
if ($this->loginCookie) {
$logout_url = $this->endpoint->service_config['url'] . '/user/logout';
$options = array(
'method' => 'POST',
'headers' => array(
'Cookie' => $this->loginCookie,
'X-CSRF-Token' => $this->tokenResponse,
),
);
$response = drupal_http_request($logout_url, $options);
if ($this
->debugEnabled()) {
watchdog('deploy_services_client', 'Logout response: <pre>@response</pre>', array(
'@response' => print_r($response, TRUE),
), WATCHDOG_DEBUG);
}
$this->loginCookie = NULL;
return TRUE;
}
else {
return FALSE;
}
}