Un minimun de gestion d'erreurs
This commit is contained in:
parent
944d861a16
commit
9866a5a74a
|
@ -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_]+)/';
|
$pattern = '/[A-Za-z0-9_-]+@[A-Za-z0-9_-]+.([A-Za-z0-9_-][A-Za-z0-9_]+)/';
|
||||||
preg_match($pattern, $string, $matches);
|
preg_match($pattern, $string, $matches);
|
||||||
$emailDomain = explode('@', $matches[0]);
|
$emailDomain = explode('@', $matches[0]);
|
||||||
|
} else {
|
||||||
|
die(_('Missing POST of the mail address'));
|
||||||
}
|
}
|
||||||
|
|
||||||
header("Content-type: text/xml");
|
header("Content-type: text/xml");
|
||||||
|
|
|
@ -2,11 +2,15 @@
|
||||||
require_once("../class/config_nochk.php");
|
require_once("../class/config_nochk.php");
|
||||||
|
|
||||||
header ("Content-Type:text/xml");
|
header ("Content-Type:text/xml");
|
||||||
|
|
||||||
|
if (empty($_GET['emailaddress'])) die(_("Error: Missing GET of emailaddress"));
|
||||||
|
|
||||||
$emailDomain = explode('@', rawurldecode($_GET['emailaddress']));
|
$emailDomain = explode('@', rawurldecode($_GET['emailaddress']));
|
||||||
|
if (empty($emailDomain)) die(_('Error: Empty $emailDomain'));
|
||||||
?>
|
?>
|
||||||
<clientConfig version="1.1">
|
<clientConfig version="1.1">
|
||||||
<emailProvider id="<?php echo $L_FQDN ?>">
|
<emailProvider id="<?php echo $L_FQDN ?>">
|
||||||
<domain><?php echo $emailDomain;?></domain>
|
<domain><?php echo $emailDomain[1];?></domain>
|
||||||
<displayName><?php echo $L_FQDN ?></displayName>
|
<displayName><?php echo $L_FQDN ?></displayName>
|
||||||
<displayShortName><?php echo $L_FQDN ?></displayShortName>
|
<displayShortName><?php echo $L_FQDN ?></displayShortName>
|
||||||
<incomingServer type="imap">
|
<incomingServer type="imap">
|
||||||
|
|
Loading…
Reference in New Issue