This commit is contained in:
Paul Wilde 2021-08-11 11:21:40 +01:00
parent 8a2fb1f269
commit 4ed1a3ec37
3 changed files with 12 additions and 1 deletions

View file

@ -44,6 +44,9 @@ class Responder {
case "Autodiscover/Autodiscover.xml":
$resp = $this->ms_autodiscover();
break;
case "/autodiscover/autodiscover.json": //?Email=psw%40wilde.cloud&Protocol=Autodiscoverv1&RedirectCount=1"
$resp = $this->ms_autodiscover_json();
break;
case "none":
case "test":
case "home":
@ -80,6 +83,12 @@ class Responder {
$response->content = "public/autodiscover.php";
return $response;
}
private function ms_autodiscover_json(){
$response = new Response();
$response->content_type = "xml";
$response->content = "public/autodiscover.php";
return $response;
}
private function dummy_response(){
// Generate a dummy response for testing
$response = new Response();

View file

@ -4,7 +4,8 @@ $conf = Core::$Config["Services"];
$data = file_get_contents("php://input");
file_put_contents(Core::root_dir()."/xmltest", $data);
preg_match("/\<EMailAddress\>(.*?)\<\/EMailAddress\>/", $data, $matches);
echo '<?xml version="1.0" encoding="utf-8" ?>'; ?>
//print_r($matches);
//echo '<?xml version="1.0" encoding="utf-8" ?>'; ?>
<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006">
<Response xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a">
<Account>

1
src/xmltest Executable file
View file

@ -0,0 +1 @@
<EMailAddress>psw@wilde.cloud</EMailAddress>