Commit 3f5f95a6 authored by jkaberg's avatar jkaberg

fix preg_match and move up xml line

parent f7d2dfd1
...@@ -11,15 +11,14 @@ ...@@ -11,15 +11,14 @@
// We might get two kinds of requests. // We might get two kinds of requests.
$post_body = file_get_contents('php://input'); $post_body = file_get_contents('php://input');
preg_match('/<AcceptableResponseSchema>(.*?)<\/AcceptableResponseSchema>/', $post_body, $match); $match = preg_match('/<AcceptableResponseSchema>(.*?)<\/AcceptableResponseSchema>/', $post_body, $match);
$AcceptableResponseSchema = $match[1]; $AcceptableResponseSchema = $match[1];
if ($AcceptableResponseSchema == "http://schemas.microsoft.com/exchange/autodiscover/mobilesync/responseschema/2006") { if ($AcceptableResponseSchema == "http://schemas.microsoft.com/exchange/autodiscover/mobilesync/responseschema/2006") {
// There is no way to convey the user's login name with this? // There is no way to convey the user's login name with this?
?> ?>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Autodiscover <Autodiscover xmlns:autodiscover="http://schemas.microsoft.com/exchange/autodiscover/mobilesync/responseschema/2006">
xmlns:autodiscover="http://schemas.microsoft.com/exchange/autodiscover/mobilesync/responseschema/2006">
<autodiscover:Response> <autodiscover:Response>
<autodiscover:Action> <autodiscover:Action>
<autodiscover:Settings> <autodiscover:Settings>
...@@ -40,7 +39,7 @@ xmlns:autodiscover="http://schemas.microsoft.com/exchange/autodiscover/mobilesyn ...@@ -40,7 +39,7 @@ xmlns:autodiscover="http://schemas.microsoft.com/exchange/autodiscover/mobilesyn
// Parse the email address out of the POST request, which // Parse the email address out of the POST request, which
// we pass back as the login name. // we pass back as the login name.
preg_match('/<EMailAddress>(.*?)<\/EMailAddress>/', $post_body, $match); $match = preg_match('/<EMailAddress>(.*?)<\/EMailAddress>/', $post_body, $match);
$LOGIN = $match[1]; $LOGIN = $match[1];
header("Content-type: text/xml"); header("Content-type: text/xml");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment