summaryrefslogtreecommitdiffstats
path: root/application/modules/user/forms/Client.php
diff options
context:
space:
mode:
authorSimon Franz2011-03-16 17:13:02 +0100
committerSimon Franz2011-03-16 17:13:02 +0100
commitaf06cbe6a477a52fa99a2d1b047a9c3e8b6b22f9 (patch)
tree480ab8929158dc973e375ce99798829e9398ff75 /application/modules/user/forms/Client.php
parentClientController geändert, Forms können in FBGui und User nicht benutzt werden (diff)
downloadpbs2-af06cbe6a477a52fa99a2d1b047a9c3e8b6b22f9.tar.gz
pbs2-af06cbe6a477a52fa99a2d1b047a9c3e8b6b22f9.tar.xz
pbs2-af06cbe6a477a52fa99a2d1b047a9c3e8b6b22f9.zip
Benutzung von Form in Modulen nutzbar, editclient funktioniert, Mac wird geparsed
Diffstat (limited to 'application/modules/user/forms/Client.php')
-rw-r--r--application/modules/user/forms/Client.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/application/modules/user/forms/Client.php b/application/modules/user/forms/Client.php
index a79ede1..9f3926c 100644
--- a/application/modules/user/forms/Client.php
+++ b/application/modules/user/forms/Client.php
@@ -8,18 +8,31 @@ class user_Form_Client extends Zend_Form
$this->setName("pool");
$this->setMethod('post');
- $this->addElement('text', 'macadress', array(
+ $mac = $this->createElement('text', 'macadress', array(
'filters' => array('StringTrim'),
'validators' => array(
- array('StringLength', false, array(0, 50)),
+ array(
+ 'regex',
+ 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.'
+ )
+ )
+ )
),
'required' => true,
'label' => 'MacAdress:',
));
+ $this->addElement($mac);
+
+
$this->addElement('text', 'hardwarehash', array(
'filters' => array('StringTrim'),
'validators' => array(
- array('StringLength', false, array(0, 50)),
+ array('StringLength', false, array(32, 32)),
),
'required' => true,
'label' => 'Hardwarehash:',