summaryrefslogtreecommitdiffstats
path: root/application/modules/user
diff options
context:
space:
mode:
authormichael pereira2011-04-18 16:33:13 +0200
committermichael pereira2011-04-18 16:33:13 +0200
commitbe3bf392777efb6c953064e095b5fe510bff1ca8 (patch)
treed05ed80b1d25ce33b4bdf8d2c21a105e99b133b7 /application/modules/user
parentPublic Level -1 (nicht freigeschaltet) bei Bootiso und Bootos (diff)
downloadpbs2-be3bf392777efb6c953064e095b5fe510bff1ca8.tar.gz
pbs2-be3bf392777efb6c953064e095b5fe510bff1ca8.tar.xz
pbs2-be3bf392777efb6c953064e095b5fe510bff1ca8.zip
API-Key bei Membership & BootOS über API fertig
Diffstat (limited to 'application/modules/user')
-rw-r--r--application/modules/user/controllers/GroupController.php6
-rw-r--r--application/modules/user/controllers/PersonController.php16
-rw-r--r--application/modules/user/controllers/RoleController.php1
-rw-r--r--application/modules/user/forms/Bootos.php6
-rw-r--r--application/modules/user/views/scripts/bootos/index.phtml2
-rw-r--r--application/modules/user/views/scripts/person/owndetails.phtml10
6 files changed, 35 insertions, 6 deletions
diff --git a/application/modules/user/controllers/GroupController.php b/application/modules/user/controllers/GroupController.php
index 9eca3e3..9db2ccf 100644
--- a/application/modules/user/controllers/GroupController.php
+++ b/application/modules/user/controllers/GroupController.php
@@ -411,7 +411,11 @@ class User_GroupController extends Zend_Controller_Action
$membership->setGroupID($groupRequest->getGroupID());
$membership->setPersonID($groupRequest->getPersonID());
$membership->setRoleID($_POST['roleID']);
- $membership->setSuspended(0);
+ $membership->setSuspended(0);
+ $apikey = randomString(32);
+ $membership->setApikey($apikey);
+
+
try {
$id = $this->membershipMapper->save($membership);
diff --git a/application/modules/user/controllers/PersonController.php b/application/modules/user/controllers/PersonController.php
index 4f6b975..4ec8297 100644
--- a/application/modules/user/controllers/PersonController.php
+++ b/application/modules/user/controllers/PersonController.php
@@ -35,14 +35,28 @@ class user_PersonController extends Zend_Controller_Action
$this->groupRequestMapper = new Application_Model_GroupRequestMapper();
$this->membershipMapper = new Application_Model_MembershipMapper();
$this->memberships = $this->membershipMapper->findBy(array("personID" => $this->person->getID()),true);
+
+ $rightrolesMapper = new Application_Model_RightRolesMapper();
+ $rightroles = new Application_Model_RightRoles();
+ $role = new Application_Model_Role();
+ $roleMapper = new Application_Model_RoleMapper();
+
+ $this->view->apikeys = array();
+
if(isset($this->memberships)) {
foreach($this->memberships as $membership) {
$group = $this->groupMapper->find($membership['groupID']);
+ @list($rightroles) = $rightrolesMapper->findBy(array('rightID' => '55', 'roleID' => $membership['roleID']));
+ $role = $roleMapper->find($membership['roleID']);
+ if($rightroles != null)
+ $this->view->apikeys[$group->getID()] = $membership['apikey'];
+
$this->groups[] = array (
'groupID' => $group->getID(),
'title' => $group->getTitle(),
'description' => $group->getDescription(),
- 'membershipID' => $membership['membershipID']
+ 'membershipID' => $membership['membershipID'],
+ 'role' => $role->getTitle()
);
}
}
diff --git a/application/modules/user/controllers/RoleController.php b/application/modules/user/controllers/RoleController.php
index 2c22031..bee6ecf 100644
--- a/application/modules/user/controllers/RoleController.php
+++ b/application/modules/user/controllers/RoleController.php
@@ -339,6 +339,7 @@ class User_RoleController extends Zend_Controller_Action
$rightroles = new Application_Model_RightRoles();
$rightroles->setRightID($rightID);
$rightroles->setRoleID($roleID);
+
try {
$this->rightRolesMapper->save($rightroles);
} catch(Zend_Exception $e)
diff --git a/application/modules/user/forms/Bootos.php b/application/modules/user/forms/Bootos.php
index 964fbf3..2453f1b 100644
--- a/application/modules/user/forms/Bootos.php
+++ b/application/modules/user/forms/Bootos.php
@@ -58,7 +58,7 @@ class user_Form_Bootos extends Zend_Form
'validators' => array(
array('StringLength', false, array(0, 250)),
),
- 'required' => true,
+ 'required' => flase,
'size' => 50,
'readOnly' => $meta,
'label' => 'Init-Path:',
@@ -69,7 +69,7 @@ class user_Form_Bootos extends Zend_Form
'validators' => array(
array('StringLength', false, array(0, 250)),
),
- 'required' => true,
+ 'required' => false,
'size' => 50,
'readOnly' => $meta,
'label' => 'Kernel-Path:',
@@ -80,7 +80,7 @@ class user_Form_Bootos extends Zend_Form
'validators' => array(
array('StringLength', false, array(0, 250)),
),
- 'required' => true,
+ 'required' => false,
'size' => 50,
'readOnly' => $meta,
'label' => 'Config-Path:',
diff --git a/application/modules/user/views/scripts/bootos/index.phtml b/application/modules/user/views/scripts/bootos/index.phtml
index f76338b..94e35c0 100644
--- a/application/modules/user/views/scripts/bootos/index.phtml
+++ b/application/modules/user/views/scripts/bootos/index.phtml
@@ -19,7 +19,7 @@
<div class='code'>bootosID</div>
<div class='code'>public</div>
<div class='code'>path_kernel</div>
- <div class='code'>kcl</div>
+ <div class='code'>defaultkcl</div>
<div class='code'>path_init</div>
<div class='code'>path_config</div>
<div class='code'>distro</div>
diff --git a/application/modules/user/views/scripts/person/owndetails.phtml b/application/modules/user/views/scripts/person/owndetails.phtml
index 2aaef54..3f1cfb4 100644
--- a/application/modules/user/views/scripts/person/owndetails.phtml
+++ b/application/modules/user/views/scripts/person/owndetails.phtml
@@ -70,6 +70,16 @@ if(count($this->groups)==0)
</div>
<div class='title'><?php echo $group['title']; ?></div>
<div class='subtitle'><?php echo $group['description']; ?>&nbsp;</div>
+ <div class='details'>
+ <label>Role</label>
+ <div class='item'><?php echo $group['role']; ?>&nbsp;</div>
+ </div>
+ <?php if($this->apikeys[$group['groupID']] != null):?>
+ <div class='details'>
+ <label>API-Key</label>
+ <div class='item'><?php echo $this->apikeys[$group['groupID']]; ?>&nbsp;</div>
+ </div>
+ <?php endif;?>
</div>
<div class='clear'></div>
</div>