tests
This commit is contained in:
parent
da722c9781
commit
d6aec92545
1 changed files with 15 additions and 3 deletions
|
@ -20,6 +20,11 @@ class Responder {
|
||||||
// Send json encoded response
|
// Send json encoded response
|
||||||
echo json_encode($response, true);
|
echo json_encode($response, true);
|
||||||
break;
|
break;
|
||||||
|
case "ms-json":
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
// Send json encoded response
|
||||||
|
echo json_encode($response->content, true);
|
||||||
|
break;
|
||||||
case "xml":
|
case "xml":
|
||||||
header('Content-Type: application/xml');
|
header('Content-Type: application/xml');
|
||||||
include ($response->content);
|
include ($response->content);
|
||||||
|
@ -44,7 +49,8 @@ class Responder {
|
||||||
case "Autodiscover/Autodiscover.xml":
|
case "Autodiscover/Autodiscover.xml":
|
||||||
$resp = $this->ms_autodiscover();
|
$resp = $this->ms_autodiscover();
|
||||||
break;
|
break;
|
||||||
case "/autodiscover/autodiscover.json": //?Email=psw%40wilde.cloud&Protocol=Autodiscoverv1&RedirectCount=1"
|
case "autodiscover/autodiscover.json": //?Email=psw%40wilde.cloud&Protocol=Autodiscoverv1&RedirectCount=1"
|
||||||
|
case "Autodiscover/Autodiscover.json":
|
||||||
$resp = $this->ms_autodiscover_json();
|
$resp = $this->ms_autodiscover_json();
|
||||||
break;
|
break;
|
||||||
case "none":
|
case "none":
|
||||||
|
@ -85,8 +91,10 @@ class Responder {
|
||||||
}
|
}
|
||||||
private function ms_autodiscover_json(){
|
private function ms_autodiscover_json(){
|
||||||
$response = new Response();
|
$response = new Response();
|
||||||
$response->content_type = "xml";
|
$response->content_type = "ms-json";
|
||||||
$response->content = "public/autodiscover.php";
|
$response->content = new MSAutodiscoverJSONResponse();
|
||||||
|
$response->content->Protocol = "AutodiscoverV1";
|
||||||
|
$response->content->Protocol = "https://" . $_SERVER['HTTP_HOST'] . "/Autodiscover/Autodiscover.xml";
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
private function dummy_response(){
|
private function dummy_response(){
|
||||||
|
@ -121,3 +129,7 @@ class Response {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
class MSAutodiscoverJSONResponse {
|
||||||
|
public $Protocol;
|
||||||
|
public $Url;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue