summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6ebdc40)
raw | patch | inline | side by side (parent: 6ebdc40)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 27 Jun 2005 09:37:22 +0000 (09:37 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 27 Jun 2005 09:37:22 +0000 (09:37 +0000) |
index 5cc31f1c8a029e85dec609cebc07fd364ffb5566..dba8e8455822fddbc57722e4e6956f8a53615e46 100644 (file)
--- a/TODO
+++ b/TODO
=========================
* Finish kolab integration
- - mail groups
- shared folders
index 3ce775deaa1dbf1b32db3d45d15be8310c29a690..5fd77844384e3cb96590c2066ecbf5a8a170cd59 100644 (file)
@@ -270,10 +270,8 @@ objectclass ( 1.3.6.1.4.1.10098.1.2.1.19.11 NAME 'gosaUserTemplate' SUP top AUXI
objectclass ( 1.3.6.1.4.1.10098.1.2.1.19.12 NAME 'gosaGroupOfNames'
DESC 'GOsa object grouping (v2.4)'
- SUP top AUXILIARY
- MUST ( member $ cn $ gosaGroupObjects )
- MAY ( businessCategory $ seeAlso $ owner $ ou $ o $ description ) )
-
+ SUP groupOfNames STRUCTURAL
+ MUST ( member $ cn $ gosaGroupObjects ))
objectclass ( 1.3.6.1.4.1.10098.1.2.1.19.13 NAME 'gosaWebdavAccount'
DESC 'GOsa webdav enabling account (v2.4)'
index 3c6a84bb8e2340888afba7b87e986be0ea84bfe0..3a73fba44b6400ad5456e225311caf5798ceade8 100644 (file)
@@ -269,9 +269,8 @@ objectclass ( 1.3.6.1.4.1.10098.1.2.1.19.11 NAME 'gosaUserTemplate' SUP top AUXI
objectclass ( 1.3.6.1.4.1.10098.1.2.1.19.12 NAME 'gosaGroupOfNames'
DESC 'GOsa object grouping (v2.4)'
- SUP top AUXILIARY
- MUST ( member $ cn $ gosaGroupObjects )
- MAY ( businessCategory $ seeAlso $ owner $ ou $ o $ description ) )
+ SUP groupOfNames STRUCTURAL
+ MUST ( member $ cn $ gosaGroupObjects ))
objectclass ( 1.3.6.1.4.1.10098.1.2.1.19.13 NAME 'gosaWebdavAccount'
DESC 'GOsa webdav enabling account (v2.4)'
diff --git a/plugins/admin/ogroups/class_mailogroup.inc b/plugins/admin/ogroups/class_mailogroup.inc
index 699934f3fd0633834c963a612ff5c62afb0d7995..d4180f603afc32321c4bd14514c4f830d45b3a72 100644 (file)
/* attribute list for save action */
var $attributes= array("mail");
var $objectclasses= array("kolabGroupOfNames");
-
var $members= array();
+
function mailogroup ($config, $dn= NULL)
{
plugin::plugin($config, $dn);
/* Include config object */
$this->config= $config;
+
+ /* Save initial account state */
+ $this->initially_was_account= $this->is_account;
}
+
function execute()
{
+ /* Do we need to flip is_account state? */
+ if (isset($_POST['modify_state'])){
+ $this->is_account= !$this->is_account;
+ }
+
+ /* Show tab dialog headers */
+ if ($this->parent != NULL){
+ if ($this->is_account){
+ $display= $this->show_header(_("Remove mail account"),
+ _("This group has mail features enabled. You can disable them by clicking below."));
+ } else {
+ $display= $this->show_header(_("Create mail account"), _("This group has mail features disabled. You can enable them by clicking below."));
+ return ($display);
+ }
+ }
+
/* Initialize templating engine */
$smarty= get_smarty();
$smarty->assign("mailACL", chkacl($this->acl, "mail"));
/* Show main page */
- return ($smarty->fetch (get_template_path('mail.tpl', TRUE)));
+ return ($display.$smarty->fetch (get_template_path('mail.tpl', TRUE)));
}
+
/* Check formular input */
function check()
+ {
+ $message= array();
+
+ if ($this->is_account){
+ $ldap= $this->config->get_ldap_link();
+
+ /* Check if mail address is valid */
+ if (!is_email($this->mail) || $this->mail == ""){
+ $message[]= _("Please enter a valid email address in 'Primary address' field.");
+ }
+
+ /* Check if mail address is already in use */
+ $ldap->cd($this->config->current['BASE']);
+ $ldap->search ("(&(!(objectClass=gosaUserTemplate))(|(mail=".$this->mail. ")(gosaMailAlternateAddress=".$this->mail."))(!(cn=".$this->cn.")))", array("uid"));
+ if ($ldap->count() != 0){
+ $message[]= _("The primary address you've entered is already in use.");
+ }
+ }
+
+ return ($message);
+ }
+
+
+ function save()
{
$ldap= $this->config->get_ldap_link();
- $message= array();
+ /* Call parents save to prepare $this->attrs */
+ plugin::save();
+
+ /* Save data to LDAP */
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ show_ldap_error($ldap->get_error());
- /* Check if mail address is valid */
- if (!is_email($this->mail)){
- $message[]= _("Please enter a valid email address in 'Primary address' field.");
+ /* Optionally execute a command after we're done */
+ if ($this->initially_was_account == $this->is_account){
+ if ($this->is_modified){
+ $this->handle_post_events("mofify");
+ }
+ } else {
+ $this->handle_post_events("add");
}
+ }
+
- /* Check if mail address is already in use */
- $ldap->cd($this->config->current['BASE']);
- $ldap->search ("(&(!(objectClass=gosaUserTemplate))(|(mail=".$this->mail. ")(gosaMailAlternateAddress=".$this->mail."))(!(cn=".$this->cn.")))", array("uid"));
- if ($ldap->count() != 0){
- $message[]= _("The primary address you've entered is already in use.");
+ /* remove object from parent */
+ function remove_from_parent()
+ {
+ /* Cancel if there's nothing to do here */
+ if (!$this->initially_was_account){
+ return;
}
-
- return ($message);
+ /* include global link_info */
+ $ldap= $this->config->get_ldap_link();
+
+ /* Remove and write to LDAP */
+ plugin::remove_from_parent();
+
+ @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
+ $this->attributes, "Save");
+ $ldap->cd($this->dn);
+ $ldap->modify($this->attrs);
+ show_ldap_error($ldap->get_error());
}
}
index 348e316d73ffa2fe07a580434faf4523d336818b..a3007bda90ccb241378a9016da197c2b4a6d179a 100644 (file)
case "U":
/* Add a user tab used for mail distribution lists */
- require_once("class_mailogroup.inc");
- $this->by_name['mailogroup']= _("Mail");
- $this->by_object['mailogroup']= new mailogroup($this->config, $this->dn);
- $this->by_object['mailogroup']->parent= &$this;
+ if (preg_match('/kolab/i', $this->config->current['MAILMETHOD'])){
+ require_once("class_mailogroup.inc");
+ $this->by_name['mailogroup']= _("Mail");
+ $this->by_object['mailogroup']= new mailogroup($this->config, $this->dn);
+ $this->by_object['mailogroup']->parent= &$this;
+ }
break;
}
}
}
+
function check()
{
return (tabs::check(TRUE));
$this->dn= 'cn='.$baseobject->cn.','.get_groups_ou().$baseobject->base;
}
- tabs::save(TRUE);
+ tabs::save();
}
}