public
nobgit
read
NobMail
Based on mailcow: dockerized
Languages
Repository composition by tracked source files.
PHP
49%
JavaScript
35%
HTML
9%
CSS
4%
Shell
2%
Python
1%
Lua
0%
Perl
0%
Ruby
0%
SCSS
0%
Create file
Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git
Trace
data/web/autodiscover-json.php
Trace helps you understand code history line by line. See who changed each line, when it changed, and which commit introduced it.
Author
Date
Commit
Line
Code
1
<?php
2
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/vars.inc.php';
3
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/functions.inc.php';
4
$default_autodiscover_config = $autodiscover_config;
5
if(file_exists('inc/vars.local.inc.php')) {
6
include_once 'inc/vars.local.inc.php';
7
}
8
$autodiscover_config = array_merge($default_autodiscover_config, $autodiscover_config);
10
header('Content-type: application/json');
11
if (strtolower($_GET['Protocol']) == 'activesync' && getenv('SKIP_SOGO') != "y") {
12
echo '{"Protocol":"ActiveSync","Url":"' . $autodiscover_config['activesync']['url'] . '"}';
13
}
14
elseif (strtolower($_GET['Protocol']) == 'autodiscoverv1') {
15
echo '{"Protocol":"AutodiscoverV1","Url":"https://' . $_SERVER['HTTP_HOST'] . '/Autodiscover/Autodiscover.xml"}';
16
}
17
else {
18
http_response_code(400);
19
echo '{"ErrorCode":"InvalidProtocol","ErrorMessage":"The given protocol value \u0027' . preg_replace("/[^\da-z]/i", '', $_GET['Protocol']) . '\u0027 is invalid. Supported values are \u0027ActiveSync,AutodiscoverV1\u0027"}';
20
}
21
?>