diff --git a/plugins/admin/systems/class_goMailServer.inc b/plugins/admin/systems/class_goMailServer.inc
index c8007515121b5548def92c9778e57766ce466dea..d8e1985691c04af3e6390bb986f1d70200c6988a 100644 (file)
var $objectclasses = array("goMailServer");
/* This class can't be assigned twice so it conflicts with itsself */
- var $conflicts = array("goMailServer");
-
var $DisplayName = "";
var $dn = NULL;
var $StatusFlag = "goMailServerStatus";
- var $attributes = array("goMailServerStatus","description","postfixHeaderSizeLimit",
+ var $attributes = array("description","postfixHeaderSizeLimit",
"postfixMailboxSizeLimit","postfixMessageSizeLimit",
"postfixMyDestinations","postfixMyDomain","postfixMyhostname",
"postfixMyNetworks","postfixRelayhost","postfixTransportTable",
var $RestrictionFilters = array();
var $TransportProtocols = array();
var $Actions = array();
-
+ var $cn = "";
+ var $conflicts = array("goMailServer","kolab");
function goMailServer($config,$dn)
{
/* Return list entry */
function getListEntry()
{
+ $this->updateStatusState();
$flag = $this->StatusFlag;
$fields['Status'] = $this->$flag;
$fields['Message'] = _("Postfix")." ["._("configured for")." ".$this->postfixMyhostname."] ";
foreach ($add_attrs as $name => $value){
$command= preg_replace("/%$name/", $value, $command);
}
+
+ /* If there are still some %.. in our command, try to fill these with some other class vars */
+ if(preg_match("/%/",$command)){
+ $attrs = get_object_vars($this);
+ foreach($attrs as $name => $value){
+ if(!is_string($value)) continue;
+ $command= preg_replace("/%$name/", $value, $command);
+ }
+ }
+
if (check_command($command)){
@DEBUG (DEBUG_SHELL, __LINE__, __FUNCTION__, __FILE__,
$command, "Execute");
}
}
+
+ /* Get updates for status flag */
+ function updateStatusState()
+ {
+ if(empty($this->StatusFlag)) return;
+
+ $attrs = array();
+ $flag = $this->StatusFlag;
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->cn);
+ $ldap->cat($this->dn,array($flag));
+ if($ldap->count()){
+ $attrs = $ldap->fetch();
+ }
+ if(isset($attrs[$flag][0])){
+ $this->$flag = $attrs[$flag][0];
+ }
+ }
+
function save_object()
{
plugin::save_object();