summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
Diffstat (limited to 'application')
-rw-r--r--application/modules/fbgui/controllers/IndexController.php13
-rw-r--r--application/modules/fbgui/views/scripts/index/start.phtml10
-rw-r--r--application/modules/user/controllers/PersonController.php103
-rw-r--r--application/modules/user/controllers/RoleController.php55
-rw-r--r--application/modules/user/views/scripts/person/owndetails.phtml39
-rw-r--r--application/modules/user/views/scripts/person/show.phtml28
-rw-r--r--application/modules/user/views/scripts/role/show.phtml34
7 files changed, 221 insertions, 61 deletions
diff --git a/application/modules/fbgui/controllers/IndexController.php b/application/modules/fbgui/controllers/IndexController.php
index c874d97..450dd14 100644
--- a/application/modules/fbgui/controllers/IndexController.php
+++ b/application/modules/fbgui/controllers/IndexController.php
@@ -103,16 +103,9 @@ class Fbgui_IndexController extends Zend_Controller_Action
$session->setBootmenuentryID($bootmenuntryID);
$session->setBootosID($bootmenuentry->getBootosID());
$sessionMapper->save($session);
- echo "<h1>Downloading</h1>";
- echo "<script>\n";
- echo "fbgui.setCallbackOnFinished('foo();');\n";
- echo "fbgui.startDownload('http://132.230.4.27/resource/getkernel/alpha/".$_SESSION['alphasessionID']."/file/kernel');\n";
- echo "fbgui.startDownload('http://132.230.4.27/resource/getinitramfs/alpha/".$_SESSION['alphasessionID']."/file/initramfs');\n";
- echo "fbgui.startDownload('http://132.230.4.27/resource/getkcl/alpha/".$_SESSION['alphasessionID']."/file/kcl');\n";
- echo "function foo(){
- fbgui.quit();
- }";
- echo "</script>";
+
+ $this->view->host = '132.230.4.27';
+ $this->view->alphaid = $_SESSION['alphasessionID'];
}
diff --git a/application/modules/fbgui/views/scripts/index/start.phtml b/application/modules/fbgui/views/scripts/index/start.phtml
index a59dd3e..94e8d97 100644
--- a/application/modules/fbgui/views/scripts/index/start.phtml
+++ b/application/modules/fbgui/views/scripts/index/start.phtml
@@ -112,3 +112,13 @@ function updateProgress(p, s, u){
<a href='/fbgui'>back</a>
<div id="progressbar" style="height: 15px;"></div>
+<h1>Downloading</h1>
+<script>
+fbgui.setCallbackOnFinished('foo();');
+fbgui.startDownload('http://<?php echo $this->host; ?>/resource/getkernel/alpha/<?php echo $this->alphaid; ?>/file/kernel');
+fbgui.startDownload('http://<?php echo $this->host; ?>/resource/getinitramfs/alpha/<?php echo $this->alphaid; ?>/file/initramfs');
+fbgui.startDownload('http://<?php echo $this->host; ?>/resource/getkcl/alpha/<?php echo $this->alphaid; ?>/file/kcl');
+function foo(){
+ fbgui.quit();
+}
+</script>";
diff --git a/application/modules/user/controllers/PersonController.php b/application/modules/user/controllers/PersonController.php
index 7511233..bbdf232 100644
--- a/application/modules/user/controllers/PersonController.php
+++ b/application/modules/user/controllers/PersonController.php
@@ -2,13 +2,21 @@
class user_PersonController extends Zend_Controller_Action
{
+
protected $person = null;
+
protected $personmapper = null;
+
protected $membershipMapper = null;
+
protected $memberships = null;
+
protected $groupMapper = null;
+
protected $groups = null;
+
protected $groupRequestMapper = null;
+
protected $userIDsNamespace = null;
public function init()
@@ -31,10 +39,10 @@ class user_PersonController extends Zend_Controller_Action
foreach($this->memberships as $membership) {
$group = $this->groupMapper->find($membership['groupID']);
$this->groups[] = array (
- 'groupID' => $group->getID(),
- 'title' => $group->getTitle(),
- 'description' => $group->getDescription(),
- 'membershipID' => $membership['membershipID']
+ 'groupID' => $group->getID(),
+ 'title' => $group->getTitle(),
+ 'description' => $group->getDescription(),
+ 'membershipID' => $membership['membershipID']
);
}
}
@@ -88,6 +96,19 @@ class user_PersonController extends Zend_Controller_Action
# $this->_redirect('/user');
#}
$this->view->person = $this->person;
+ $groupRequests = $this->groupRequestMapper->findBy(array('personID' => $this->person->getID()),true);
+ if(isset($groupRequests)) {
+ foreach($groupRequests as $groupRequest) {
+ $group = $this->groupMapper->find($groupRequest['groupID']);
+ $groupRequestList[] = array(
+ 'grouprequestID' => $groupRequest['grouprequestID'],
+ 'group' => $group
+ );
+ }
+ if(is_array($groupRequestList)) {
+ $this->view->groupRequestList = $groupRequestList;
+ }
+ }
// Pagination
$pagination = new Pbs_Pagination();
$pagination->setPerPage(3);
@@ -217,13 +238,21 @@ class user_PersonController extends Zend_Controller_Action
$date = new DateTime();
$groupRequest->setTime($date->getTimestamp());
$groupRequest->setPersonID($this->person->getID());
- try {
- $groupRequestMapper->save($groupRequest);
- } catch(Zend_Exception $e)
- {
- echo "Caught exception: " . get_class($e) . "<br/>";
- echo "Message: " . $e->getMessage() . "<br/>";
- return;
+ foreach($groupRequests as $groupRequestDB) {
+ if($groupRequestDB['groupID'] == $groupRequest->getGroupID()) {
+ $requestFound = true;
+ break;
+ }
+ }
+ if(!$requestFound) {
+ try {
+ $groupRequestMapper->save($groupRequest);
+ } catch(Zend_Exception $e)
+ {
+ echo "Caught exception: " . get_class($e) . "<br/>";
+ echo "Message: " . $e->getMessage() . "<br/>";
+ return;
+ }
}
$this->_helper->redirector('owndetails', 'person');
return;
@@ -279,9 +308,9 @@ class user_PersonController extends Zend_Controller_Action
$group = $groupMapper->find($membership['groupID']);
$role = $roleMapper->find($membership['roleID']);
$membershipList[] = array(
- 'membershipID' => $membership['membershipID'],
- 'group' => $group->getTitle(),
- 'role' => $role->getTitle()
+ 'membershipID' => $membership['membershipID'],
+ 'group' => $group->getTitle(),
+ 'role' => $role->getTitle()
);
}
}
@@ -302,7 +331,8 @@ class user_PersonController extends Zend_Controller_Action
return;
}
- public function searchAction(){
+ public function searchAction()
+ {
if(!Pbs_Acl::checkRight('pso')) {
$this->_redirect('/user');
}
@@ -322,15 +352,27 @@ class user_PersonController extends Zend_Controller_Action
foreach($memberships as $membership) {
$group = $this->groupMapper->find($membership['groupID']);
$groups[] = array (
- 'groupID' => $group->getID(),
- 'title' => $group->getTitle(),
- 'description' => $group->getDescription(),
- 'membershipID' => $membership['membershipID']
+ 'groupID' => $group->getID(),
+ 'title' => $group->getTitle(),
+ 'description' => $group->getDescription(),
+ 'membershipID' => $membership['membershipID']
);
}
}
$this->view->person = $person;
-
+ $groupRequests = $this->groupRequestMapper->findBy(array('personID' => $person->getID()),true);
+ if(isset($groupRequests)) {
+ foreach($groupRequests as $groupRequest) {
+ $group = $this->groupMapper->find($groupRequest['groupID']);
+ $groupRequestList[] = array(
+ 'grouprequestID' => $groupRequest['grouprequestID'],
+ 'group' => $group
+ );
+ }
+ if(is_array($groupRequestList)) {
+ $this->view->groupRequestList = $groupRequestList;
+ }
+ }
// Pagination
$pagination = new Pbs_Pagination();
$pagination->setPerPage(2);
@@ -350,4 +392,23 @@ class user_PersonController extends Zend_Controller_Action
return;
}
}
-} \ No newline at end of file
+
+ public function deleterequestAction()
+ {
+ $grouprequestID = $this->_request->getParam('grouprequestID');
+ $grouprequest = $this->groupRequestMapper->find($grouprequestID);
+ try {
+ $this->groupRequestMapper->delete($grouprequest);
+ } catch(Zend_Exception $e)
+ {
+ echo "Caught exception: " . get_class($e) . "<br/>";
+ echo "Message: " . $e->getMessage() . "<br/>";
+ return;
+ }
+ $this->_helper->redirector('owndetails', 'person');
+ return;
+ }
+
+
+}
+
diff --git a/application/modules/user/controllers/RoleController.php b/application/modules/user/controllers/RoleController.php
index 91357f0..1b2e54f 100644
--- a/application/modules/user/controllers/RoleController.php
+++ b/application/modules/user/controllers/RoleController.php
@@ -322,7 +322,11 @@ class User_RoleController extends Zend_Controller_Action
}
}
} else {
- $rightlist = $rights;
+ $rightCategoryMapper = new Application_Model_RightCategoryMapper();
+ foreach($rights as $right) {
+ $rightCategory = $rightCategoryMapper->find($right->getRightcategoryID());
+ $rightlist[$rightCategory->getTitle()][$right->getID()] = $right->getTitle();
+ }
}
if(count($rightlist) > 0) {
if (!isset($_POST["link"])){
@@ -377,15 +381,10 @@ class User_RoleController extends Zend_Controller_Action
if(isset($rightRolesID)) {
$rightRolesID = explode('-',$rightRolesID);
$roleID = $rightRolesID[0];
- $rightID = $rightRolesID[1];
- if (isset($roleID) && isset($rightID)){
- $roleMapper = new Application_Model_RoleMapper();
- $role = $roleMapper->find($roleID);
- $roleGroupID = $role->getGroupID();
- if($this->userIDsNamespace['groupID'] == $roleGroupID) {
- $rightroles = new Application_Model_RightRoles();
- $rightroles->setRoleID($roleID);
- $rightroles->setRightID($rightID);
+ if($rightRolesID[1] == 'all') {
+ $rightRolesMapper = new Application_Model_RightRolesMapper();
+ $rightroleslist = $rightRolesMapper->findBy(array('roleID' => $roleID));
+ foreach($rightroleslist as $rightroles) {
try {
$this->rightRolesMapper->delete($rightroles);
} catch(Zend_Exception $e)
@@ -393,15 +392,37 @@ class User_RoleController extends Zend_Controller_Action
echo "Caught exception: " . get_class($e) . "<br/>";
echo "Message: " . $e->getMessage() . "<br/>";
return;
+ }
+ }
+ $this->_redirect('/user/role/show/roleID/' . $roleID);
+ return;
+ } else {
+ $rightID = $rightRolesID[1];
+ if (isset($roleID) && isset($rightID)){
+ $roleMapper = new Application_Model_RoleMapper();
+ $role = $roleMapper->find($roleID);
+ $roleGroupID = $role->getGroupID();
+ if($this->userIDsNamespace['groupID'] == $roleGroupID) {
+ $rightroles = new Application_Model_RightRoles();
+ $rightroles->setRoleID($roleID);
+ $rightroles->setRightID($rightID);
+ try {
+ $this->rightRolesMapper->delete($rightroles);
+ } catch(Zend_Exception $e)
+ {
+ echo "Caught exception: " . get_class($e) . "<br/>";
+ echo "Message: " . $e->getMessage() . "<br/>";
+ return;
+ }
+ $this->_redirect('/user/role/show/roleID/' . $roleID);
+ return;
+ } else {
+ $pbsNotifier = new Pbs_Notifier();
+ echo $pbsNotifier->notify('unlink','forbidden');
+ $this->_helper-> viewRenderer-> setNoRender();
+ return;
}
- $this->_redirect('/user/role/show/roleID/' . $roleID);
- return;
- } else {
- $pbsNotifier = new Pbs_Notifier();
- echo $pbsNotifier->notify('unlink','forbidden');
- $this->_helper-> viewRenderer-> setNoRender();
- return;
}
}
} else {
diff --git a/application/modules/user/views/scripts/person/owndetails.phtml b/application/modules/user/views/scripts/person/owndetails.phtml
index 8f91cfd..ac96d25 100644
--- a/application/modules/user/views/scripts/person/owndetails.phtml
+++ b/application/modules/user/views/scripts/person/owndetails.phtml
@@ -105,4 +105,43 @@ $class= 'highlight checked';
</div>
<?php endforeach ?></div>
<?php echo $this->pagination;
+ if(isset($this->groupRequestList)) {
+ ?>
+<br />
+<h2>Requests:</h2>
+<div class='listelement'><?php
+foreach($this->groupRequestList as $grouprequest) {
+ $grouprequestID = $grouprequest['grouprequestID'];
+ $group = $grouprequest['group'];
+ ?>
+<div class='element'>
+<div class='content'>
+<div class='actions'><a
+ href="<?php echo $this->url(
+ array(
+ 'module' => 'user',
+ 'controller' => 'person',
+ 'action' => 'deleterequest',
+ 'grouprequestID' => $grouprequestID
+ ),
+ 'default',
+ true) ?>"> <img src='/media/img/delete.png' alt='Delete Request' /></a>
+</div>
+<div class='title'><?php echo $group->getTitle(); ?></div>
+ <?php if($group->getDescription()) {
+ ?>
+<div class='subtitle'><?php echo $group->getDescription(); ?></div>
+ <?php
+ } else {
+ ?>
+<div class='subtitle'>&nbsp;</div>
+ <?php
+ }
+ ?></div>
+</div>
+ <?php
+}
+?></div>
+<?php
+ }
?> \ No newline at end of file
diff --git a/application/modules/user/views/scripts/person/show.phtml b/application/modules/user/views/scripts/person/show.phtml
index 5fb4bde..c43bde3 100644
--- a/application/modules/user/views/scripts/person/show.phtml
+++ b/application/modules/user/views/scripts/person/show.phtml
@@ -93,4 +93,32 @@ $class= 'highlight checked';
</div>
<?php endforeach ?></div>
<?php echo $this->pagination;
+if(isset($this->groupRequestList)) {
+ ?>
+<br />
+<h2>Requests:</h2>
+<div class='listelement'><?php
+foreach($this->groupRequestList as $grouprequest) {
+ $grouprequestID = $grouprequest['grouprequestID'];
+ $group = $grouprequest['group'];
+ ?>
+<div class='element'>
+<div class='content'>
+<div class='title'><?php echo $group->getTitle(); ?></div>
+ <?php if($group->getDescription()) {
+ ?>
+<div class='subtitle'><?php echo $group->getDescription(); ?></div>
+ <?php
+ } else {
+ ?>
+<div class='subtitle'>&nbsp;</div>
+ <?php
+ }
+ ?></div>
+</div>
+ <?php
+}
+?></div>
+<?php
+}
?> \ No newline at end of file
diff --git a/application/modules/user/views/scripts/role/show.phtml b/application/modules/user/views/scripts/role/show.phtml
index 8f4bb50..8c7503f 100644
--- a/application/modules/user/views/scripts/role/show.phtml
+++ b/application/modules/user/views/scripts/role/show.phtml
@@ -53,17 +53,22 @@ if($this->rightsAvailable === true) {
echo $this->formButton('linkright', 'Add Rights', array(
'onclick' => 'self.location="/user/role/linkright/roleID/' . $this->role->getID() .'"',
'class' => 'addbutton'))?>
-<br />
<?php
}
}
-if(count($this->rightsList)==0)
-echo "There are no Rights to display.";
-if(isset($this->rightcategorieslist)) {
- foreach($this->rightcategorieslist as $k => $v):
- $rights = $this->rightsList[$k];
- if(count($rights) > 0) {
- ?>
+if(count($this->rightsList)==0) {
+ echo "There are no Rights to display.";
+} else {
+ if($this->removeRightOfRoleRight) echo $this->formButton('deleteallrights', 'Delete All Rights', array(
+ 'onclick' => 'self.location="/user/role/unlinkright/rightrolesID/' . $this->roleID . '-all"',
+ 'class' => 'rightbutton'));?>
+<br />
+ <?php
+ if(isset($this->rightcategorieslist)) {
+ foreach($this->rightcategorieslist as $k => $v):
+ $rights = $this->rightsList[$k];
+ if(count($rights) > 0) {
+ ?>
<h3><?php echo $v; ?>:</h3>
<div class='listelement'><?php
foreach($rights as $right):
@@ -96,12 +101,15 @@ if($right->getDescription()) {
<div class='clear'></div>
</div>
<?php
-endforeach;
- }
- ?></div>
+endforeach
+?></div>
+<?php
+ }
+ ?>
<br />
- <?php
- endforeach;
+ <?php
+ endforeach;
+ }
}
}
?>