diff options
author | Ramón M. Gómez <ramongomez@us.es> | 2019-10-24 13:56:56 +0200 |
---|---|---|
committer | Ramón M. Gómez <ramongomez@us.es> | 2019-10-24 13:56:56 +0200 |
commit | 31eaff25782d2a09cdb7c7cad29088b50c50e5f1 (patch) | |
tree | 2196316612fb159b22cd9ee0d77776e1f42ee3d7 /admin/WebConsole/rest | |
parent | 3dc405380a8cecaa4523ad4db75c9a0ba9e72a11 (diff) |
#839: Avoid error code 500 when redirecting a logout operation to the remote access server (UDS).
Diffstat (limited to 'admin/WebConsole/rest')
-rw-r--r-- | admin/WebConsole/rest/ogagent.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/admin/WebConsole/rest/ogagent.php b/admin/WebConsole/rest/ogagent.php index be62a8d0..ca6d783e 100644 --- a/admin/WebConsole/rest/ogagent.php +++ b/admin/WebConsole/rest/ogagent.php @@ -240,19 +240,18 @@ EOD; // Read query data. $rs->Primero(); $id = $rs->campos['idordenador']; - $redirto[0]['url'] = $rs->campos['urllogout']; + $url = $rs->campos['urllogout']; $reserved = $rs->campos['reserved']; $rs->Cerrar(); if (!is_null($id)) { // Log activity, respond to client and continue processing. writeLog("User logged out: ip=$ip, user=$user."); - $response = ""; - jsonResponseNow(200, $response); } else { throw new Exception("Client is not in the database: ip=$ip, user=$user"); } // Redirect notification to UDS server, if needed. - if ($reserved == 1 and !is_null($redirto[0]['url'])) { + if ($reserved == 1 and !is_null($url)) { + $redirto[0]['url'] = $url; $redirto[0]['get'] = $app->request()->getBody(); $result = multiRequest($redirto); // ... (check response) @@ -268,6 +267,8 @@ EOD; writeLog($app->request()->getResourceUri().": ERROR: ".$response["message"]); jsonResponse(400, $response); } + $response = ""; + jsonResponse(200, $response); } ); |