From c8bbb9cae7b60ed988cbbf93f9e5cdbfae798ce2 Mon Sep 17 00:00:00 2001
From: Simon
Date: Tue, 8 Mar 2011 20:33:51 +0100
Subject: ansichten vereinheitlicht & Auth gefixxt & user test//test angelegt
---
application/controllers/AuthController.php | 17 +++++++++++-----
application/layouts/main.phtml | 16 ++++++++++++---
application/models/PersonMapper.php | 6 +++---
application/views/scripts/bootiso/index.phtml | 17 ++++++----------
application/views/scripts/bootmenu/index.phtml | 16 +++++----------
application/views/scripts/bootos/index.phtml | 15 +++++---------
application/views/scripts/client/index.phtml | 17 ++++++----------
application/views/scripts/config/index.phtml | 15 +++++---------
application/views/scripts/filter/index.phtml | 27 ++++++++++----------------
application/views/scripts/index/index.phtml | 2 +-
application/views/scripts/pool/index.phtml | 22 ++++++++++-----------
application/views/scripts/session/index.phtml | 14 ++++---------
12 files changed, 80 insertions(+), 104 deletions(-)
(limited to 'application')
diff --git a/application/controllers/AuthController.php b/application/controllers/AuthController.php
index c43e5a9..8ccb25c 100644
--- a/application/controllers/AuthController.php
+++ b/application/controllers/AuthController.php
@@ -2,10 +2,10 @@
class AuthController extends Zend_Controller_Action
{
-
+ private $db = null;
public function init()
{
- $db = Zend_Db_Table::getDefaultAdapter();
+ $this->db = Zend_Db_Table::getDefaultAdapter();
}
public function indexAction()
@@ -15,6 +15,9 @@ class AuthController extends Zend_Controller_Action
public function loginAction()
{
+ if (Zend_Auth::getInstance()->hasIdentity()) {
+ print_a('bereits angemeldet');
+ }
if (!isset($_POST["login"])){
$loginForm = new Application_Form_AuthLogin();
} else {
@@ -25,7 +28,7 @@ class AuthController extends Zend_Controller_Action
$auth = Zend_Auth::getInstance();
$adapter = new Zend_Auth_Adapter_DbTable(
- $db,
+ $this->db,
'pbs_person',
'email',
'password',
@@ -41,7 +44,7 @@ class AuthController extends Zend_Controller_Action
// TODO: erweiterte fehlerbeschreibung des Users
if ($result->isValid()) {
- $this->_redirect('/');
+ $this->_redirect('/auth/login');
return;
} else {
echo "Falsche Email oder Passwort";
@@ -54,6 +57,9 @@ class AuthController extends Zend_Controller_Action
public function registerAction()
{
+ if (Zend_Auth::getInstance()->hasIdentity()) {
+ print_a('bereits angemeldet');
+ }
if (!isset($_POST["register"])){
$registerForm = new Application_Form_AuthRegister();
} else {
@@ -68,7 +74,7 @@ class AuthController extends Zend_Controller_Action
$person->setRegisterdate($date->getTimestamp());
$person->setPasswordSalt(MD5($date->getTimestamp()));
$person->setPassword(MD5($person->getPassword() . $person->getPasswordSalt()));
-
+ print_a($person);
try {
$personmapper->save($person);
}catch(Zend_Exception $e)
@@ -80,6 +86,7 @@ class AuthController extends Zend_Controller_Action
}
echo "Erfolgreich registriert.
";
echo "Weiter zum Login: Login";
+ $this->_redirect('/auth/login');
return;
}
}
diff --git a/application/layouts/main.phtml b/application/layouts/main.phtml
index 80147b9..4a3ba7f 100644
--- a/application/layouts/main.phtml
+++ b/application/layouts/main.phtml
@@ -13,13 +13,22 @@ echo $this->headScript();
@@ -35,7 +44,8 @@ echo $this->headScript();
Filter
Pool
Session
- Auth
+ Login
+ Register
diff --git a/application/models/PersonMapper.php b/application/models/PersonMapper.php
index 79a84c7..74f7250 100644
--- a/application/models/PersonMapper.php
+++ b/application/models/PersonMapper.php
@@ -47,7 +47,7 @@ class Application_Model_PersonMapper
public function save(Application_Model_Person $person)
{
- $data = array('personID'=> $person->getID() ,'title'=> $person->getTitle() ,'name'=> $person->getName() ,'firstname'=> $person->getFirstname() ,'street'=> $person->getStreet() ,'housenumber'=> $person->getHousenumber() ,'city'=> $person->getCity() ,'postalcode'=> $person->getPostalcode() ,'logindate'=> $person->getLogindate() ,'registerdate'=> $person->getRegisterdate() ,'email'=> $person->getEmail() ,'login'=> $person->getLogin() ,'password'=> $person->getPassword() ,'password'=> $person->getPassword() );
+ $data = array('personID'=> $person->getID() ,'title'=> $person->getTitle() ,'name'=> $person->getName() ,'firstname'=> $person->getFirstname() ,'street'=> $person->getStreet() ,'housenumber'=> $person->getHousenumber() ,'city'=> $person->getCity() ,'postalcode'=> $person->getPostalcode() ,'logindate'=> $person->getLogindate() ,'registerdate'=> $person->getRegisterdate() ,'email'=> $person->getEmail() ,'login'=> $person->getLogin() ,'password'=> $person->getPassword() ,'password_salt'=> $person->getPasswordSalt() );
if (null === ($id = $person->getID()) ) {
unset($data['personID']);
@@ -75,7 +75,7 @@ class Application_Model_PersonMapper
$row = $result->current();
- $person->setID($row->personID)->setTitle($row->title)->setName($row->name)->setFirstname($row->firstname)->setStreet($row->street)->setHousenumber($row->housenumber)->setCity($row->city)->setPostalcode($row->postalcode)->setLogindate($row->logindate)->setRegisterdate($row->registerdate)->setEmail($row->email)->setLogin($row->login)->setPassword($row->password)->setPassword($row->password);
+ $person->setID($row->personID)->setTitle($row->title)->setName($row->name)->setFirstname($row->firstname)->setStreet($row->street)->setHousenumber($row->housenumber)->setCity($row->city)->setPostalcode($row->postalcode)->setLogindate($row->logindate)->setRegisterdate($row->registerdate)->setEmail($row->email)->setLogin($row->login)->setPassword($row->password)->setPasswordSalt($row->password_salt);
}
public function fetchAll()
@@ -85,7 +85,7 @@ class Application_Model_PersonMapper
foreach ($resultSet as $row) {
$entry = new Application_Model_Person();
- $entry->setID($row->personID)->setTitle($row->title)->setName($row->name)->setFirstname($row->firstname)->setStreet($row->street)->setHousenumber($row->housenumber)->setCity($row->city)->setPostalcode($row->postalcode)->setLogindate($row->logindate)->setRegisterdate($row->registerdate)->setEmail($row->email)->setLogin($row->login)->setPassword($row->password)->setPassword($row->password);
+ $entry->setID($row->personID)->setTitle($row->title)->setName($row->name)->setFirstname($row->firstname)->setStreet($row->street)->setHousenumber($row->housenumber)->setCity($row->city)->setPostalcode($row->postalcode)->setLogindate($row->logindate)->setRegisterdate($row->registerdate)->setEmail($row->email)->setLogin($row->login)->setPassword($row->password)->setPasswordSalt($row->password_salt);
$entries[] = $entry;
}
diff --git a/application/views/scripts/bootiso/index.phtml b/application/views/scripts/bootiso/index.phtml
index 171d85f..f529ff3 100644
--- a/application/views/scripts/bootiso/index.phtml
+++ b/application/views/scripts/bootiso/index.phtml
@@ -1,12 +1,8 @@
BootISO
-
-
-
-
+formButton('createbootiso', 'Create BootISO', array(
+ 'onclick' => 'self.location="/bootiso/createbootiso"',
+ 'class' => 'addbutton'))?>
+
| ID |
Title |
@@ -48,9 +44,8 @@ tr.entry{background-color:#E0ECF8;}
-
-formButton('createbootiso', 'Create BootISO', array(
- 'onclick' => 'self.location="/bootiso/createbootiso"'))?>
+
+
diff --git a/application/views/scripts/bootmenu/index.phtml b/application/views/scripts/bootmenu/index.phtml
index 25edc53..d213a6f 100644
--- a/application/views/scripts/bootmenu/index.phtml
+++ b/application/views/scripts/bootmenu/index.phtml
@@ -1,14 +1,10 @@
BootMenu
+formButton('createbootmenu', 'Create BootMenu', array(
+ 'onclick' => 'self.location="/bootmenu/createbootmenu"',
+ 'class' => 'addbutton'))?>
-
-
+
| ID |
Title |
@@ -90,9 +86,7 @@ tr.bootentry{background-color:#E0ECF8;}
-
-formButton('createbootmenu', 'Create BootMenu', array(
- 'onclick' => 'self.location="/bootmenu/createbootmenu"'))?>
+
diff --git a/application/views/scripts/bootos/index.phtml b/application/views/scripts/bootos/index.phtml
index 86bcdff..fefd219 100644
--- a/application/views/scripts/bootos/index.phtml
+++ b/application/views/scripts/bootos/index.phtml
@@ -1,12 +1,9 @@
BootOS
+formButton('createbootos', 'Create BootOS', array(
+ 'onclick' => 'self.location="/bootos/createbootos"',
+ 'class' => 'addbutton'))?>
-
-
-
+
| ID |
Title |
@@ -54,9 +51,7 @@ tr.entry{background-color:#E0ECF8;}
-
-formButton('createbootos', 'Create BootOS', array(
- 'onclick' => 'self.location="/bootos/createbootos"'))?>
+
diff --git a/application/views/scripts/client/index.phtml b/application/views/scripts/client/index.phtml
index 0eb28b8..e9de06b 100644
--- a/application/views/scripts/client/index.phtml
+++ b/application/views/scripts/client/index.phtml
@@ -1,15 +1,10 @@
Clients
+formButton('createbootos', 'Create Client', array(
+ 'onclick' => 'self.location="/client/addclient"',
+ 'class' => 'addbutton'))?>
clients): ?>
- add client
-
-
+
| clientID |
MAC |
@@ -18,8 +13,8 @@
clients as $client): ?>
| escape($client->getID()) ?> |
- escape($client->getMacadress()) ?> |
- escape($client->getHardwarehash()) ?> |
+ escape($client->getMacadress()) ?> |
+ escape($client->getHardwarehash()) ?> |
'addbutton'))?>
-
-
-
+
| ID |
Title |
@@ -42,9 +39,7 @@ tr.entry{background-color:#E0ECF8;}
-
-formButton('createconfig', 'Create Config', array(
- 'onclick' => 'self.location="/config/createconfig"'))?>
+
diff --git a/application/views/scripts/filter/index.phtml b/application/views/scripts/filter/index.phtml
index 5d70735..0de30a0 100644
--- a/application/views/scripts/filter/index.phtml
+++ b/application/views/scripts/filter/index.phtml
@@ -1,22 +1,10 @@
Filters
-
-
-add new filter
+formButton('createconfig', 'Add Filter', array(
+ 'onclick' => 'self.location="/filter/addfilter"',
+ 'class' => 'addbutton'))?>
filters): ?>
-
-
-
+
| filterID |
Title |
@@ -62,8 +50,13 @@ tr.filter{background-color:#DDD;}
$erg = $fe->findBy('filterID',$filter->getID());
?>
+
+ | Filtertype |
+ Value |
+ Value2 |
+
-
+
Zend-Framework Index
+Welcome
diff --git a/application/views/scripts/pool/index.phtml b/application/views/scripts/pool/index.phtml
index c3a6be9..2df3e52 100644
--- a/application/views/scripts/pool/index.phtml
+++ b/application/views/scripts/pool/index.phtml
@@ -1,17 +1,10 @@
Pools
-
-create pool
+formButton('createconfig', 'Create Pool', array(
+ 'onclick' => 'self.location="/pool/createpool"',
+ 'class' => 'addbutton'))?>
pools): ?>
-
-
-
+
| poolID |
Title |
@@ -52,7 +45,12 @@
|
|
- | clientID | mac | hardwarehash |
+
+
+ | clientID |
+ mac |
+ hardwarehash |
+
findBy('poolID',$pool->getID());
diff --git a/application/views/scripts/session/index.phtml b/application/views/scripts/session/index.phtml
index d26e818..1d2506b 100644
--- a/application/views/scripts/session/index.phtml
+++ b/application/views/scripts/session/index.phtml
@@ -1,14 +1,8 @@
Session
-
-create new session
-
-
+formButton('createconfig', 'Create Session', array(
+ 'onclick' => 'self.location="/session/createsession"',
+ 'class' => 'addbutton'))?>
+
| SessionID |
ClientID |
--
cgit v1.2.3-55-g7522
|
|---|
| | |