PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_EMULATE_PREPARES => false,
];
$pdo = new PDO($dsn, $database_user, $database_pass, $opt);
$login_user = strtolower(trim($_SERVER['PHP_AUTH_USER']));
$login_role = check_login($login_user, $_SERVER['PHP_AUTH_PW']);
if (!isset($_SERVER['PHP_AUTH_USER']) OR $login_role !== "user") {
header('WWW-Authenticate: Basic realm=""');
header('HTTP/1.0 401 Unauthorized');
exit(0);
}
else {
if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) {
if ($login_role === "user") {
header("Content-Type: application/xml");
echo '' . PHP_EOL;
?>
600
Invalid Request
Request->EMailAddress;
} catch (Exception $e) {
$email = $_SERVER['PHP_AUTH_USER'];
}
$username = trim($email);
try {
$stmt = $pdo->prepare("SELECT `name` FROM `mailbox` WHERE `username`= :username");
$stmt->execute(array(':username' => $username));
$MailboxData = $stmt->fetch(PDO::FETCH_ASSOC);
}
catch(PDOException $e) {
die("Failed to determine name from SQL");
}
if (!empty($MailboxData['name'])) {
$displayname = utf8_encode($MailboxData['name']);
}
else {
$displayname = $email;
}
if ($configuration['autodiscoverType'] == 'imap') {
?>
=$displayname;?>
email
settings
IMAP
=$configuration['imap']['server'];?>
=$configuration['imap']['port'];?>
off
=$email;?>
off
on
on
SMTP
=$configuration['smtp']['server'];?>
=$configuration['smtp']['port'];?>
off
=$email;?>
off
on
on
on
off
CalDAV
https://=$configuration['caldav']['server'];?>/SOGo/dav/=$email;?>/Calendar
off
=$email;?>
CardDAV
https://=$configuration['carddav']['server'];?>/SOGo/dav/=$email;?>/Contacts
off
=$email;?>
en:en
=$displayname;?>
=$email;?>
MobileSync
=$configuration['activesync']['url'];?>
=$configuration['activesync']['url'];?>