summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormichael pereira2011-03-16 17:28:52 +0100
committermichael pereira2011-03-16 17:28:52 +0100
commitc4037e25f2dfdbe8440c3aade2bfb76bbea7c65d (patch)
treef5b4b2c8c261a42fb92d549f872baa3af132ddd9
parentKCL jetzt auf 175 zeichen begrentzt (diff)
parentMerge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2 (diff)
downloadpbs2-c4037e25f2dfdbe8440c3aade2bfb76bbea7c65d.tar.gz
pbs2-c4037e25f2dfdbe8440c3aade2bfb76bbea7c65d.tar.xz
pbs2-c4037e25f2dfdbe8440c3aade2bfb76bbea7c65d.zip
Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2
-rw-r--r--application/models/MembershipMapper.php1
-rw-r--r--application/modules/fbgui/Bootstrap.php5
-rw-r--r--application/modules/user/Bootstrap.php5
-rw-r--r--application/modules/user/controllers/ClientController.php3
-rw-r--r--application/modules/user/forms/Client.php19
-rw-r--r--library/Pbs/PbsNotifier.php27
6 files changed, 28 insertions, 32 deletions
diff --git a/application/models/MembershipMapper.php b/application/models/MembershipMapper.php
index 313248c..4385f95 100644
--- a/application/models/MembershipMapper.php
+++ b/application/models/MembershipMapper.php
@@ -68,6 +68,7 @@ class Application_Model_MembershipMapper
public function find($id, Application_Model_Membership $membership = null)
{
+ $return = false;
if($membership == null){
$return = true;
}
diff --git a/application/modules/fbgui/Bootstrap.php b/application/modules/fbgui/Bootstrap.php
new file mode 100644
index 0000000..7ddaf6b
--- /dev/null
+++ b/application/modules/fbgui/Bootstrap.php
@@ -0,0 +1,5 @@
+<?php
+class fbgui_Bootstrap extends Zend_Application_Module_Bootstrap
+{
+
+}
diff --git a/application/modules/user/Bootstrap.php b/application/modules/user/Bootstrap.php
new file mode 100644
index 0000000..59383f9
--- /dev/null
+++ b/application/modules/user/Bootstrap.php
@@ -0,0 +1,5 @@
+<?php
+class user_Bootstrap extends Zend_Application_Module_Bootstrap
+{
+
+}
diff --git a/application/modules/user/controllers/ClientController.php b/application/modules/user/controllers/ClientController.php
index f5f1810..bae6494 100644
--- a/application/modules/user/controllers/ClientController.php
+++ b/application/modules/user/controllers/ClientController.php
@@ -63,8 +63,7 @@ class User_ClientController extends Zend_Controller_Action
$mapper = new Application_Model_ClientMapper();
$mapper->find($clientID,$client);
- if($client->getGroupID() == $this->membership->getGroupID()){
- # print_a($this);die();
+ if($client->getGroupID() == $this->membership->getGroupID()){
$editclient = new user_Form_Client(array('buttontext' => 'Edit Client'));
$editclient->populate($client->toArray());
$this->view->editclient = $editclient;
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:',
diff --git a/library/Pbs/PbsNotifier.php b/library/Pbs/PbsNotifier.php
deleted file mode 100644
index b079f2d..0000000
--- a/library/Pbs/PbsNotifier.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-class Pbs_PbsNotifier{
-
-
- public function notify($boxstyle, $action, $result){
- switch($boxstyle){
- default:
- case "info":
- $boxstyle = 'infobox';
- break;
- case "warning":
- $boxstyle = 'warning';
- break;
- case "ok":
- $boxstyle = 'okbox';
- break;
- case "error":
- $boxstyle = 'errorbox';
- break;
- }
-
-
- }
-}
-
-?>