Commit 9866a5a7 authored by Alan Garcia's avatar Alan Garcia
Browse files

Un minimun de gestion d'erreurs

parent 944d861a
......@@ -9,6 +9,8 @@ if ( $_SERVER['REQUEST_METHOD'] === 'POST' ){
$pattern = '/[A-Za-z0-9_-]+@[A-Za-z0-9_-]+.([A-Za-z0-9_-][A-Za-z0-9_]+)/';
preg_match($pattern, $string, $matches);
$emailDomain = explode('@', $matches[0]);
} else {
die(_('Missing POST of the mail address'));
}
header("Content-type: text/xml");
......
......@@ -2,11 +2,15 @@
require_once("../class/config_nochk.php");
header ("Content-Type:text/xml");
if (empty($_GET['emailaddress'])) die(_("Error: Missing GET of emailaddress"));
$emailDomain = explode('@', rawurldecode($_GET['emailaddress']));
if (empty($emailDomain)) die(_('Error: Empty $emailDomain'));
?>
<clientConfig version="1.1">
<emailProvider id="<?php echo $L_FQDN ?>">
<domain><?php echo $emailDomain;?></domain>
<domain><?php echo $emailDomain[1];?></domain>
<displayName><?php echo $L_FQDN ?></displayName>
<displayShortName><?php echo $L_FQDN ?></displayShortName>
<incomingServer type="imap">
......
Supports Markdown
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