From fa527a06464973d1b401e36501e0be4c9ace4924 Mon Sep 17 00:00:00 2001 From: Björn Geiger Date: Thu, 13 Oct 2011 15:34:53 +0200 Subject: minor --- application/modules/user/forms/Client.php | 71 ++++++++++++++-------- .../modules/user/views/scripts/client/index.phtml | 6 +- .../modules/user/views/scripts/pool/index.phtml | 6 +- 3 files changed, 50 insertions(+), 33 deletions(-) (limited to 'application') diff --git a/application/modules/user/forms/Client.php b/application/modules/user/forms/Client.php index 33a6cf1..2a2191b 100755 --- a/application/modules/user/forms/Client.php +++ b/application/modules/user/forms/Client.php @@ -16,45 +16,62 @@ class user_Form_Client extends Zend_Form private $buttontext = 'Save'; private $groups; private $page; - + public function setButtontext($v){ $this->buttontext = $v; } public function setPage($page){ $this->page = $page; } - - public function init() - { - $this->setName("pool"); + + public function init() + { + $this->setName("pool"); $this->setMethod('post'); - + $mac = $this->createElement('text', 'macadress', array( 'filters' => array('StringTrim'), 'validators' => array( - array( + array( 'regex', - false, - array( + false, + array( '/^[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}$/i', 'messages' => array( - Zend_Validate_Regex::NOT_MATCH => "'%value%' is not a valid Mac-Adress", - Zend_Validate_Regex::INVALID => 'Mac-Adress contains invalid characters.' - ) - ) - ) - ), + Zend_Validate_Regex::NOT_MATCH => "'%value%' is not a valid Mac-Adress", + Zend_Validate_Regex::INVALID => 'Mac-Adress contains invalid characters.' + ) + ) + ) + ), 'required' => true, - 'label' => 'MacAdress:', + 'label' => 'MacAddress:', )); $this->addElement($mac); - - - $this->addElement('text', 'hardwarehash', array( + + $this->addElement('text', 'ip', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(32, 32)), + ), + 'required' => true, + 'label' => 'IpAddress:', + )); + + $this->addElement('text', 'ip6', array( 'filters' => array('StringTrim'), 'validators' => array( - array('StringLength', false, array(32, 32)), - ), + array('StringLength', false, array(32, 32)), + ), + 'required' => true, + 'label' => 'Ip6Address:', + )); + + $this->addElement('text', 'hardwarehash', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(32, 32)), + ), 'required' => true, 'label' => 'Hardwarehash:', )); @@ -63,12 +80,12 @@ class user_Form_Client extends Zend_Form 'required' => false, 'ignore' => true, 'label' => $this->buttontext, - )); - - $this->addElement('button', 'Cancel', array( + )); + + $this->addElement('button', 'Cancel', array( 'onclick' => 'self.location="/user/client/index/page/'.$this->page.'"' - )); - - } + )); + + } } diff --git a/application/modules/user/views/scripts/client/index.phtml b/application/modules/user/views/scripts/client/index.phtml index bf8d8e3..eae3cd2 100755 --- a/application/modules/user/views/scripts/client/index.phtml +++ b/application/modules/user/views/scripts/client/index.phtml @@ -52,11 +52,11 @@
- +
escape($client['macadress']) ?>
- +
escape($client['ip']); ?> 
- +
escape($client['ip6']); ?> 
escape($client['hardwarehash']) ?>
diff --git a/application/modules/user/views/scripts/pool/index.phtml b/application/modules/user/views/scripts/pool/index.phtml index 03e9be8..dcf62f4 100755 --- a/application/modules/user/views/scripts/pool/index.phtml +++ b/application/modules/user/views/scripts/pool/index.phtml @@ -107,11 +107,11 @@
- +
macAdress); ?>
- +
ip); ?> 
- +
ip6); ?> 
hardwarehash); ?>
-- cgit v1.2.3-55-g7522