From: hickert Date: Tue, 27 Jul 2010 09:17:08 +0000 (+0000) Subject: Updated several service dialogs, fixed typos, string, html, post handling and more. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ce79746224eaa1228a42a9a569661957b4a4c04e;p=gosa.git Updated several service dialogs, fixed typos, string, html, post handling and more. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19142 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpClass.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpClass.inc index caa7533e4..be8bc29d9 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpClass.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpClass.inc @@ -1,118 +1,118 @@ assign("cn", $this->cn); - - /* Assign ACLs */ - $smarty->assign("acl",$this->parent->getacl("")); - - /* Show main page */ - $display= $smarty->fetch (get_template_path('dhcp_group.tpl', TRUE, - dirname(__FILE__))).$this->network->execute(); - $display.= $this->advanced->execute(); - - /* Add footer */ - $display.= "
"; - if(preg_match("/w/",$this->parent->getacl(""))){ - $display.= " "; + /* attribute list for save action */ + var $objectclasses= array('top', 'dhcpClass', 'dhcpOptions'); + + function dhcpClass($parent,&$attrs) + { + /* Load statements / options */ + dhcpPlugin::dhcpPlugin($parent,$attrs); } - $display.= ""; - $display.= "
"; - return ($display); - } + function execute() + { + $smarty= get_smarty(); + $smarty->assign("cn", set_post($this->cn)); + /* Assign ACLs */ + $smarty->assign("acl",$this->parent->getacl("")); - function remove_from_parent() - { - } + /* Show main page */ + $display= $smarty->fetch (get_template_path('dhcp_group.tpl', TRUE, + dirname(__FILE__))).$this->network->execute(); + $display.= $this->advanced->execute(); + /* Add footer */ + $display.= "
"; + if(preg_match("/w/",$this->parent->getacl(""))){ + $display.= " "; + } + $display.= ""; + $display.= "
"; - /* Save data to object */ - function save_object() - { - /* Save cn */ - if (preg_match("/w/",$this->parent->getacl("")) && isset($_POST['cn'])){ - $this->cn= validate(get_post('cn')); + return ($display); } - /* Handle global saving */ - dhcpPlugin::save_object(); - } + function remove_from_parent() + { + } - /* Check values */ - function check() - { - $message= array(); - $cache = $this->parent->dhcpObjectCache; + /* Save data to object */ + function save_object() + { + /* Save cn */ + if (preg_match("/w/",$this->parent->getacl("")) && isset($_POST['cn'])){ + $this->cn= get_post('cn'); + } - /* All required fields are set? */ - if ($this->cn == ""){ - $message[]= msgPool::required(_("Name")); - } - if (!preg_match('/^[a-z0-9_-]*$/i', $this->cn)){ - $message[]= msgPool::invalid(_("Name"),$this->cn,"/[a-z0-9_-]/i"); + /* Handle global saving */ + dhcpPlugin::save_object(); } - /* cn already used? */ - if ($this->orig_cn != $this->cn || $this->new){ - foreach($cache as $dn => $dummy){ - if (preg_match("/^cn=".$this->cn.",/", $dn) && count($dummy)){ - $message[]= msgPool::duplicated(_("Name")); - break; + /* Check values */ + function check() + { + $message= array(); + + $cache = $this->parent->dhcpObjectCache; + + /* All required fields are set? */ + if ($this->cn == ""){ + $message[]= msgPool::required(_("Name")); + } + if (!preg_match('/^[a-z0-9_-]*$/i', $this->cn)){ + $message[]= msgPool::invalid(_("Name"),$this->cn,"/[a-z0-9_-]/i"); } - } - } - /* Check external plugins */ - $net= $this->network->check(); - $adv= $this->advanced->check(); - $message= array_merge($message, $net, $adv); + /* cn already used? */ + if ($this->orig_cn != $this->cn || $this->new){ - return $message; - } + foreach($cache as $dn => $dummy){ + if (preg_match("/^cn=".$this->cn.",/", $dn) && count($dummy)){ + $message[]= msgPool::duplicated(_("Name")); + break; + } + } + } + /* Check external plugins */ + $net= $this->network->check(); + $adv= $this->advanced->check(); + $message= array_merge($message, $net, $adv); - /* Save to LDAP */ - function save() - { - dhcpPlugin::save(); - return ($this->attrs); - } + return $message; + } + + + /* Save to LDAP */ + function save() + { + dhcpPlugin::save(); + return ($this->attrs); + } }