diff --git a/plugins/admin/ogroups/class_mailogroup.inc b/plugins/admin/ogroups/class_mailogroup.inc
index aeed8a0c35a3b872e61f3bb0138a81c844a34aac..33878acda0264f352c4aaa9ee650fa5c73a63071 100644 (file)
var $attributes= array("mail");
var $objectclasses= array("kolabGroupOfNames");
var $members= array();
+ var $view_logged = FALSE;
-
- function mailogroup ($config, $dn= NULL)
+ function mailogroup (&$config, $dn= NULL, $parent= NULL)
{
- plugin::plugin($config, $dn);
+ plugin::plugin($config, $dn, $parent);
/* Include config object */
$this->config= $config;
/* Call parent execute */
plugin::execute();
+ if($this->is_account && !$this->view_logged){
+ $this->view_logged = TRUE;
+ new log("view","ogroups/".get_class($this),$this->dn);
+ }
+
+
/* Do we need to flip is_account state? */
if(isset($_POST['modify_state'])){
if($this->is_account && $this->acl_is_removeable()){
/* 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"));
+ $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.");
}
$this->cleanup();
$ldap->modify ($this->attrs);
+ if($this->initially_was_account){
+ new log("modify","ogroups/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ }else{
+ new log("create","ogroups/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+ }
+
show_ldap_error($ldap->get_error(), sprintf(_("Saving of object group/mail with dn '%s' failed."),$this->dn));
/* Optionally execute a command after we're done */
$this->cleanup();
$ldap->modify ($this->attrs);
+ new log("remove","ogroups/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+
show_ldap_error($ldap->get_error(), sprintf(_("Removing of object group/mail with dn '%s' failed."),$this->dn));
}
function getCopyDialog()
{
- $str = "";
- $str .= _("Phone number");
- $str .= " <input type='text' name='mail' value='".$this->mail."'>";
- return($str);
+ $str = "";
+ $smarty = get_smarty();
+ $smarty->assign("mail", $this->mail);
+ $str = $smarty->fetch(get_template_path("paste_mail.tpl",TRUE,dirname(__FILE__)));
+ $ret = array();
+ $ret['string'] = $str;
+ $ret['status'] = "";
+ return($ret);
}
"plDescription" => _("Mail group"),
"plSelfModify" => FALSE,
"plDepends" => array(),
- "plPriority" => 0,
+ "plPriority" => 4,
"plSection" => array("administration"),
"plCategory" => array("ogroups"),
"plProvidedAcls"=> array(