Commit c36ea848 authored by Côme Chilliet's avatar Côme Chilliet

🚑 fix(postfix) Small fixes on contributed code and schema

issue #5761
parent b8226e34
......@@ -2,7 +2,7 @@
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2003-2010 Cajus Pollmeier
Copyright (C) 2011-2016 FusionDirectory
Copyright (C) 2011-2018 FusionDirectory
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -21,20 +21,27 @@
class CatchallDomainAttribute extends StringAttribute
{
function fixPostValue ($value)
/*! \brief Return the ldap value in the correct intern format value
*
* \param $ldapValue The value as found in the LDAP
*/
function inputValue ($ldapValue)
{
/* prepend '@' for postfix catchall mapping */
if ($value) {
return '@'.parent::fixPostValue($value);
} else {
return $value;
}
/* remove initial '@' from value */
return preg_replace('/^@/', '', $ldapValue);
}
function displayValue ($value)
/*! \brief Computes LDAP value
*/
function computeLdapValue ()
{
/* remove initial '@' from display */
return '@' == substr($value, 0, 1) ? substr($value, 1) : $value;
return '@'.$this->getValue();
}
function setValue ($value)
{
/* remove initial '@' if needed */
return parent::setValue(preg_replace('/^@/', '', $value));
}
}
......@@ -120,8 +127,14 @@ class servicePostfix extends simpleService
_('Catchall table'), _('Catchall table'),
'fdPostfixCatchallTable', 'fdPostfixCatchallTable',
array(
new CatchallDomainAttribute ('Domain', '', 'fdCatchallTableDomain'),
new MailAttribute ('Recipient', '', 'fdCatchallTableRecipient')
new CatchallDomainAttribute (
_('Domain'), _('Domain concerned by this catchall rule'),
'fdCatchallTableDomain', TRUE
),
new MailAttribute (
_('Recipient'), _('Recipient mail address for this catchall rule'),
'fdCatchallTableRecipient', TRUE
)
)
)
)
......
......@@ -72,13 +72,13 @@ attributetype ( 1.3.6.1.4.1.38414.10.12.2 NAME 'fdTransportTableRule'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE)
attributetype ( 1.3.6.1.4.1.38414.10.11.12 NAME 'fdCatchallTableDomain'
attributetype ( 1.3.6.1.4.1.38414.10.13.1 NAME 'fdCatchallTableDomain'
DESC 'FusionDirectory - postfix catchall table domain'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE)
attributetype ( 1.3.6.1.4.1.38414.10.11.13 NAME 'fdCatchallTableRecipient'
attributetype ( 1.3.6.1.4.1.38414.10.13.2 NAME 'fdCatchallTableRecipient'
DESC 'FusionDirectory - postfix catchall table recipient'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
......@@ -99,7 +99,7 @@ objectclass (1.3.6.1.4.1.38414.10.2.4 NAME 'fdPostfixTransportTable'
MUST ( fdTransportTableMatch $ fdTransportTableRule )
MAY ( ) )
objectclass (1.3.6.1.4.1.38414.10.2.6 NAME 'fdPostfixCatchallTable'
objectclass (1.3.6.1.4.1.38414.10.2.5 NAME 'fdPostfixCatchallTable'
DESC 'FusionDirectory - Postfix catchall table line'
MUST ( fdCatchallTableDomain $ fdCatchallTableRecipient )
MAY ( ) )
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