diff --git a/plugins/admin/ogroups/class_mailogroup.inc b/plugins/admin/ogroups/class_mailogroup.inc
index d4180f603afc32321c4bd14514c4f830d45b3a72..560e4653ca0dba81d43432618fb468505491b251 100644 (file)
var $members= array();
- 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;
function execute()
{
+ /* Call parent execute */
+ plugin::execute();
+
/* Do we need to flip is_account state? */
if (isset($_POST['modify_state'])){
$this->is_account= !$this->is_account;
/* Check formular input */
function check()
{
- $message= array();
+ /* Call common method to give check the hook */
+ $message= plugin::check();
if ($this->is_account){
$ldap= $this->config->get_ldap_link();
/* 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.");
}
/* Save data to LDAP */
$ldap->cd($this->dn);
- $ldap->modify($this->attrs);
- show_ldap_error($ldap->get_error());
+ $this->cleanup();
+ $ldap->modify ($this->attrs);
+
+ show_ldap_error($ldap->get_error(), _("Saving mail objectgroup settings failed"));
/* 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");
+ $this->handle_post_events("modify");
}
} else {
$this->handle_post_events("add");
@DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
$this->attributes, "Save");
$ldap->cd($this->dn);
- $ldap->modify($this->attrs);
- show_ldap_error($ldap->get_error());
+ $this->cleanup();
+ $ldap->modify ($this->attrs);
+
+ show_ldap_error($ldap->get_error(), _("Removing mail objectgroup settings failed"));
+ }
+
+
+ function getCopyDialog()
+ {
+ $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);
}
+ function saveCopyDialog()
+ {
+ if(isset($_POST['mail'])){
+ $this->mail = $_POST['mail'];
+ }
+ }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: