diff --git a/plugins/admin/applications/class_applicationParameters.inc b/plugins/admin/applications/class_applicationParameters.inc
index de1d0495c967a052f4efeb48bfd8f568f53d1ede..0de0560404742f56211a64a9b378e3ba35a9c239 100644 (file)
var $option_value= array();
/* attribute list for save action */
- var $attributes= array();
+ var $attributes= array("gosaApplicationParameter");
var $objectclasses= array();
function applicationParameters ($config, $dn= NULL)
{
plugin::plugin ($config, $dn);
+ $this->gosaApplicationParameter = array();
+
if (isset($this->attrs['gosaApplicationParameter'])){
$this->is_account= TRUE;
for ($i= 0; $i<$this->attrs['gosaApplicationParameter']['count']; $i++){
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;
$display= "";
if ($this->parent != NULL){
if ($this->is_account){
- $display= $this->show_header(_("Remove options"),
+ $display= $this->show_disable_header(_("Remove options"),
_("This application has options. You can disable them by clicking below."));
} else {
- $display= $this->show_header(_("Create options"),
+ $display= $this->show_enable_header(_("Create options"),
_("This application has options disabled. You can enable them by clicking below."));
+ $this->parent->by_object['application']->generateTemplate();
return ($display);
}
}
$smarty= get_smarty();
$smarty->assign("table", $table);
$display.= $smarty->fetch(get_template_path('parameters.tpl', TRUE));
+ $this->parent->by_object['application']->generateTemplate();
return ($display);
}
$ldap->cd($this->dn);
@DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
$this->attributes, "Save");
- $ldap->modify($this->attrs);
- show_ldap_error($ldap->get_error());
+ $this->cleanup();
+ $ldap->modify ($this->attrs);
+
+ show_ldap_error($ldap->get_error(), sprintf(_("Removing of application parameters with dn '%s' failed."),$this->dn));
/* Optionally execute a command after we're done */
$this->handle_post_events('remove');
/* Check values */
function check()
{
- $message= array();
+ /* Call common method to give check the hook */
+ $message= plugin::check();
/* Check for valid option names */
for ($i= 0; $i<count($this->option_name); $i++){
- if (!preg_match ("/^[a-z0-9_]+$/", $this->option_name[$i])){
+ if (!preg_match ("/^[a-z0-9_]+$/i", $this->option_name[$i])){
$message[]= sprintf(_("Value '%s' specified as option name is not valid."),
$this->option_name[$i]);
}
$ldap->cd($this->dn);
@DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
$this->attributes, "Save");
- $ldap->modify($this->attrs);
- show_ldap_error($ldap->get_error());
+ $this->cleanup();
+ $ldap->modify ($this->attrs);
+
+ show_ldap_error($ldap->get_error(), sprintf(_("Saving of application parameters with dn '%s' failed."),$this->dn));
/* Optionally execute a command after we're done */
$this->handle_post_events('modify');