index 901133c6216a60096187c842c51a67dd1444ded6..bb40188ccb0474a347d4b38a69f6613904983776 100644 (file)
"cyrus_quotawarn");
var $objectclasses = array("top", "kolab");
+ /* Serverservice vars */
+ var $conflicts = array("goImapServer","goMailServer");
+ var $DisplayName = "Kolab mail service";
+ var $StatusFlag = "";
+
function servkolab($config, $dn = NULL)
{
/* Setting the hostname and tell this Plugin that we are the kolab extension*/
$this->handle_post_events("add");
}
}
+
+
+ function getListEntry()
+ {
+ $this->updateStatusState();
+ $flag = $this->StatusFlag;
+ if(empty($flag)){
+ $fields['Status'] = "";
+ }else{
+ $fields['Status'] = $this->$flag;
+ }
+ $fields['Message'] = _("Kolab mail service");
+ $fields['AllowStart'] = true;
+ $fields['AllowStop'] = true;
+ $fields['AllowRestart'] = true;
+ $fields['AllowRemove'] = true;
+ $fields['AllowEdit'] = true;
+ return($fields);
+ }
+
+ /* Directly save new status flag */
+ function setStatus($value)
+ {
+ return;
+
+ if($value == "none") return;
+ if(!$this->initially_was_account) return;
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->dn);
+ $ldap->cat($this->dn,array("objectClass"));
+ if($ldap->count()){
+
+ $tmp = $ldap->fetch();
+ for($i = 0; $i < $tmp['objectClass']['count']; $i ++){
+ $attrs['objectClass'][] = $tmp['objectClass'][$i];
+ }
+ $flag = $this->StatusFlag;
+ $attrs[$flag] = $value;
+ $this->$flag = $value;
+ $ldap->modify($attrs);
+ show_ldap_error($ldap->get_error());
+ $this->action_hook();
+ }
+ }
+
+
+ /* 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];
+ }
+ }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: