summaryrefslogtreecommitdiffstats
path: root/application/modules
diff options
context:
space:
mode:
Diffstat (limited to 'application/modules')
-rw-r--r--application/modules/user/controllers/AuthController.php12
-rw-r--r--application/modules/user/controllers/BootisoController.php4
-rw-r--r--application/modules/user/controllers/BootmenuController.php2
-rw-r--r--application/modules/user/controllers/BootosController.php4
-rw-r--r--application/modules/user/controllers/ConfigController.php4
-rw-r--r--application/modules/user/controllers/FilterController.php4
-rw-r--r--application/modules/user/controllers/GroupController.php112
-rw-r--r--application/modules/user/controllers/PersonController.php55
-rw-r--r--application/modules/user/controllers/PoolController.php4
-rw-r--r--application/modules/user/controllers/PrebootController.php4
-rw-r--r--application/modules/user/controllers/RoleController.php4
-rw-r--r--application/modules/user/controllers/SessionController.php2
-rw-r--r--application/modules/user/forms/PersonEdit.php2
-rw-r--r--application/modules/user/forms/Register.php2
-rw-r--r--application/modules/user/views/scripts/group/index.phtml79
-rw-r--r--application/modules/user/views/scripts/group/show.phtml60
-rw-r--r--application/modules/user/views/scripts/person/index.phtml39
-rw-r--r--application/modules/user/views/scripts/person/owndetails.phtml48
-rw-r--r--application/modules/user/views/scripts/person/show.phtml29
19 files changed, 320 insertions, 150 deletions
diff --git a/application/modules/user/controllers/AuthController.php b/application/modules/user/controllers/AuthController.php
index d1596ae..a90c8db 100644
--- a/application/modules/user/controllers/AuthController.php
+++ b/application/modules/user/controllers/AuthController.php
@@ -52,9 +52,14 @@ class User_AuthController extends Zend_Controller_Action
$person->setID($result[0]['personID']);
$date = new DateTime();
$person->setLogindate($date->getTimestamp());
- $this->personmapper->save($person);
- $this->_helper->redirector('selectmembership', 'person');
- return;
+ if($person->getSuspended()) {
+ $pbsNotifier = new Pbs_Notifier();
+ $this->view->notification = $pbsNotifier->notify('Your Account is suspended', 'error');
+ } else {
+ $this->personmapper->save($person);
+ $this->_helper->redirector('selectmembership', 'person');
+ return;
+ }
} else {
$pbsNotifier = new Pbs_Notifier();
$this->view->notification = $pbsNotifier->notify('Wrong Email or Password', 'error');
@@ -95,6 +100,7 @@ class User_AuthController extends Zend_Controller_Action
$person = new Application_Model_Person($_POST);
$this->personmapper = new Application_Model_PersonMapper();
$date = new DateTime();
+ $person->setSuspended(0);
$person->setRegisterdate($date->getTimestamp());
$person->setPasswordSalt(MD5($date->getTimestamp()));
$person->setPassword(MD5($person->getPassword() . $person->getPasswordSalt()));
diff --git a/application/modules/user/controllers/BootisoController.php b/application/modules/user/controllers/BootisoController.php
index b928a19..f0770e1 100644
--- a/application/modules/user/controllers/BootisoController.php
+++ b/application/modules/user/controllers/BootisoController.php
@@ -101,13 +101,13 @@ class user_BootisoController extends Zend_Controller_Action
// Pagination
$pagination = new Pbs_Pagination();
- $pagination->setPerPage(2);
+ $pagination->setPerPage(10);
$pagination->setElement($this->view->bootisolist);
$pagination->setRequestPage($this->_request->getParam('page'));
$pagination->setPageUrl('/user/bootiso/index'.((isset($this->view->search))?'/search/'.$this->view->search:''));
$this->view->bootisolist = $pagination->getElements();
- $this->view->pagination = $pagination->pagination($pageurl);
+ $this->view->pagination = $pagination->pagination();
$this->view->page = $pagination->getRequestPage();
}
diff --git a/application/modules/user/controllers/BootmenuController.php b/application/modules/user/controllers/BootmenuController.php
index 5082aaf..b03888e 100644
--- a/application/modules/user/controllers/BootmenuController.php
+++ b/application/modules/user/controllers/BootmenuController.php
@@ -123,7 +123,7 @@ class user_BootmenuController extends Zend_Controller_Action
// Pagination
$pagination = new Pbs_Pagination();
- $pagination->setPerPage(3);
+ $pagination->setPerPage(10);
$pagination->setElement($bootmenu);
$pagination->setRequestPage($this->_request->getParam('page'));
$pagination->setPageUrl('/user/bootmenu/index/type/'.$this->type.((isset($this->view->search))?'/search/'.$this->view->search:''));
diff --git a/application/modules/user/controllers/BootosController.php b/application/modules/user/controllers/BootosController.php
index df2d7fd..2fe8f41 100644
--- a/application/modules/user/controllers/BootosController.php
+++ b/application/modules/user/controllers/BootosController.php
@@ -106,13 +106,13 @@ class user_BootosController extends Zend_Controller_Action
// Pagination
$pagination = new Pbs_Pagination();
- $pagination->setPerPage(5);
+ $pagination->setPerPage(10);
$pagination->setElement($this->view->bootoslist);
$pagination->setRequestPage($this->_request->getParam('page'));
$pagination->setPageUrl('/user/bootos/index'.((isset($this->view->search))?'/search/'.$this->view->search:''));
$this->view->bootoslist = $pagination->getElements();
- $this->view->pagination = $pagination->pagination($pageurl);
+ $this->view->pagination = $pagination->pagination();
$this->view->page = $pagination->getRequestPage();
diff --git a/application/modules/user/controllers/ConfigController.php b/application/modules/user/controllers/ConfigController.php
index ae7dee1..851ec9a 100644
--- a/application/modules/user/controllers/ConfigController.php
+++ b/application/modules/user/controllers/ConfigController.php
@@ -85,13 +85,13 @@ class user_ConfigController extends Zend_Controller_Action
// Pagination
$pagination = new Pbs_Pagination();
- $pagination->setPerPage(4);
+ $pagination->setPerPage(10);
$pagination->setElement($this->view->configlist);
$pagination->setRequestPage($this->_request->getParam('page'));
$pagination->setPageUrl('/user/config/index/type/'.$this->type.((isset($this->view->search))?'/search/'.$this->view->search:''));
$this->view->configlist = $pagination->getElements();
- $this->view->pagination = $pagination->pagination($pageurl);
+ $this->view->pagination = $pagination->pagination();
$this->view->page = $pagination->getRequestPage();
}
diff --git a/application/modules/user/controllers/FilterController.php b/application/modules/user/controllers/FilterController.php
index a65aba5..0d9ea05 100644
--- a/application/modules/user/controllers/FilterController.php
+++ b/application/modules/user/controllers/FilterController.php
@@ -72,13 +72,13 @@ class User_FilterController extends Zend_Controller_Action
// Pagination
$pagination = new Pbs_Pagination();
- $pagination->setPerPage(5);
+ $pagination->setPerPage(10);
$pagination->setElement($allFilter);
$pagination->setRequestPage($this->_request->getParam('page'));
$pagination->setPageUrl('/user/filter/index'.((isset($this->view->search))?'/search/'.$this->view->search:''));
$allFilter = $pagination->getElements();
- $this->view->pagination = $pagination->pagination($pageurl);
+ $this->view->pagination = $pagination->pagination();
$this->view->page = $pagination->getRequestPage();
$this->view->filters = $allFilter;
diff --git a/application/modules/user/controllers/GroupController.php b/application/modules/user/controllers/GroupController.php
index 37cdee8..9a5380a 100644
--- a/application/modules/user/controllers/GroupController.php
+++ b/application/modules/user/controllers/GroupController.php
@@ -10,6 +10,7 @@ class User_GroupController extends Zend_Controller_Action
protected $rolemapper = null;
protected $groupList = null;
protected $userIDsNamespace = null;
+ protected $membership;
public function init()
{
@@ -22,6 +23,11 @@ class User_GroupController extends Zend_Controller_Action
$this->personmapper = new Application_Model_PersonMapper();
$this->rolemapper = new Application_Model_RoleMapper();
$this->groupList = $this->groupMapper->fetchAll();
+
+ $userIDsNamespace = Zend_Session::namespaceGet('userIDs');
+ $this->membership = new Application_Model_Membership();
+ $this->membershipMapper->find($userIDsNamespace['membershipID'],$this->membership);
+
} else {
$this->_helper->redirector('login', 'auth');
return;
@@ -30,6 +36,10 @@ class User_GroupController extends Zend_Controller_Action
public function indexAction()
{
+ // ACL show overview
+ if(!Pbs_Acl::checkRight('gso'))
+ $this->_redirect('/user');
+
$this->view->groupList = $this->groupList;
// Search
@@ -45,13 +55,13 @@ class User_GroupController extends Zend_Controller_Action
// Pagination
$pagination = new Pbs_Pagination();
- $pagination->setPerPage(5);
+ $pagination->setPerPage(10);
$pagination->setElement($this->view->groupList);
$pagination->setRequestPage($this->_request->getParam('page'));
$pagination->setPageUrl('/user/group/index'.((isset($this->view->search))?'/search/'.$this->view->search:''));
$this->view->groupList = $pagination->getElements();
- $this->view->pagination = $pagination->pagination($pageurl);
+ $this->view->pagination = $pagination->pagination();
$this->view->page = $pagination->getRequestPage();
$this->view->userIDsNamespace = $this->userIDsNamespace;
}
@@ -62,6 +72,10 @@ class User_GroupController extends Zend_Controller_Action
public function addAction()
{
+ // ACL create new group
+ if(!Pbs_Acl::checkRight('gc'))
+ $this->_redirect('/user');
+
if (!isset($_POST["add"])){
$addForm = new user_Form_GroupAdd(array('grouplist' => $this->groupList));
} else {
@@ -139,6 +153,11 @@ class User_GroupController extends Zend_Controller_Action
public function editAction()
{
+ // ACL edit a group
+ // TODO: THERE IS NO RIGHT TO EDIT A GROUP
+ #if(!Pbs_Acl::checkRight(''))
+ # $this->_redirect('/user');
+
$groupID = $this->_request->getParam('groupID');
if(!isset($groupID)) {
if(count($this->userIDsNamespace) > 0) {
@@ -176,27 +195,42 @@ class User_GroupController extends Zend_Controller_Action
public function showAction()
{
+ // ACL create new group
+ if(!Pbs_Acl::checkRight('gsdo') && !Pbs_Acl::checkRight('gsdog'))
+ $this->_redirect('/user');
+
$groupID = $this->_request->getParam('groupID');
- if(!isset($groupID)) {
+ if($groupID == '' || !Pbs_Acl::checkRight('gsdog')) {
if(count($this->userIDsNamespace) > 0) {
$groupID = $this->userIDsNamespace['groupID'];
}
}
- if($groupID) {
+ if($groupID == $this->membership->getGroupID() && !Pbs_Acl::checkRight('gsdo'))
+ $this->_redirect('/user');
+
+ $this->view->usergroup = $this->membership->getGroupID();
+ $this->view->requestgroup = $groupID;
+ // ACL is he allowed to see the requests of a group ?
+ // TODO: THERE IS NO RIGHT TO EDIT A GROUP
+ # if(Pbs_Acl::checkRight('')){
$groupRequests = $this->groupRequestMapper->findBy(array('groupID' => $groupID),true);
if(isset($groupRequests)) {
foreach($groupRequests as $groupRequest) {
$person = $this->personmapper->find($groupRequest['personID']);
$groupRequestList[] = array(
- 'grouprequestID' => $groupRequest['grouprequestID'],
- 'person' => $person
+ 'grouprequestID' => $groupRequest['grouprequestID'],
+ 'person' => $person
);
}
if(is_array($groupRequestList)) {
$this->view->groupRequestList = $groupRequestList;
}
+ // TODO: expand with al inherit roles
$this->view->roleList = $this->rolemapper->findBy(array('groupID' => $groupID),true);
}
+ # }
+
+ if(Pbs_Acl::checkRight('gsmg')){
$members = $this->membershipMapper->findBy(array('groupID' => $groupID),true);
if(isset($members)) {
foreach($members as $member) {
@@ -212,7 +246,7 @@ class User_GroupController extends Zend_Controller_Action
if(is_array($membersList)) {
// Member Pagination
$memberPagination = new Pbs_Pagination();
- $memberPagination->setPerPage(5);
+ $memberPagination->setPerPage(10);
$memberPagination->setElement($membersList);
$memberPagination->setRequestPage($this->_request->getParam('page'));
if($this->_request->getParam('groupID')) {
@@ -225,19 +259,16 @@ class User_GroupController extends Zend_Controller_Action
$this->view->page = $memberPagination->getRequestPage();
}
}
- $groupgroups = $this->groupGroupsMapper->findBy(array('groupID' => $groupID),true);
- if(is_object($groupgroups)) {
- $parentGroup = $this->groupMapper->find($groupgroups->getParentID());
- $this->view->$parentGroup = $parentGroup;
- }
- $group = $this->groupMapper->find($groupID);
- $this->view->userIDsNamespace = $this->userIDsNamespace;
- $this->view->group = $group;
- $this->view->groupID = $groupID;
- } else {
- $this->_redirect('/user/');
- return;
}
+ $groupgroups = $this->groupGroupsMapper->findBy(array('groupID' => $groupID),true);
+ if(is_object($groupgroups)) {
+ $parentGroup = $this->groupMapper->find($groupgroups->getParentID());
+ $this->view->$parentGroup = $parentGroup;
+ }
+ $group = $this->groupMapper->find($groupID);
+ $this->view->userIDsNamespace = $this->userIDsNamespace;
+ $this->view->group = $group;
+ $this->view->groupID = $groupID;
}
public function linkAction()
@@ -269,6 +300,10 @@ class User_GroupController extends Zend_Controller_Action
public function deleteAction()
{
+ // ACL delete a group
+ if(!Pbs_Acl::checkRight('gd'))
+ $this->_redirect('/user');
+
$this->_helper->viewRenderer->setNoRender();
$groupID = $this->_request->getParam('groupID');
if(!isset($groupID)) {
@@ -304,6 +339,10 @@ class User_GroupController extends Zend_Controller_Action
public function grantpersonAction()
{
+ // ACL grant a membership to request
+ if(!Pbs_Acl::checkRight('gam'))
+ $this->_redirect('/user');
+
$this->_helper->viewRenderer->setNoRender();
if(isset($_POST['grouprequestID']) && isset($_POST['roleID'])) {
$groupRequest = $this->groupRequestMapper->find($_POST['grouprequestID']);
@@ -338,21 +377,26 @@ class User_GroupController extends Zend_Controller_Action
public function revokepersonAction()
{
+
$this->_helper->viewRenderer->setNoRender();
$membershipID = $this->_request->getParam('membershipID');
- if(isset($membershipID)) {
- $membership = $this->membershipMapper->find($membershipID);
- if(isset($membership)) {
- try {
- $this->membershipMapper->delete($membership);
- } catch(Zend_Exception $e)
- {
- echo "Caught exception: " . get_class($e) . "<br/>";
- echo "Message: " . $e->getMessage() . "<br/>";
- return;
+ $rr = $this->membershipMapper->find($membershipID);
+
+ if(($rr->getGroupID() == $this->membership->getGroupID && Pbs_Acl::checkRight('gdmo') ) || ( $rr->getGroupID() != $this->membership->getGroupID && Pbs_Acl::checkRight('gdmog'))){
+ if(isset($membershipID)) {
+ $membership = $this->membershipMapper->find($membershipID);
+ if(isset($membership)) {
+ try {
+ $this->membershipMapper->delete($membership);
+ } catch(Zend_Exception $e)
+ {
+ echo "Caught exception: " . get_class($e) . "<br/>";
+ echo "Message: " . $e->getMessage() . "<br/>";
+ return;
+ }
+ $this->_redirect("/user/group/show/groupID/" . $membership->getGroupID());
}
- $this->_redirect("/user/group/show/groupID/" . $membership->getGroupID());
- }
-
- } }
-} \ No newline at end of file
+ }
+ }
+ }
+}
diff --git a/application/modules/user/controllers/PersonController.php b/application/modules/user/controllers/PersonController.php
index bbdf232..25b1f0a 100644
--- a/application/modules/user/controllers/PersonController.php
+++ b/application/modules/user/controllers/PersonController.php
@@ -63,6 +63,7 @@ class user_PersonController extends Zend_Controller_Action
$this->view->showOtherRight = Pbs_Acl::checkRight('psood');
$this->view->editOtherRight = Pbs_Acl::checkRight('peoa');
$this->view->deleteOtherRight = Pbs_Acl::checkRight('pdo');
+ $this->view->suspendRight = Pbs_Acl::checkRight('psa');
$this->view->userIDsNamespace = $this->userIDsNamespace;
$this->view->personList = $this->personmapper->fetchAll();
@@ -80,7 +81,7 @@ class user_PersonController extends Zend_Controller_Action
// Pagination
$pagination = new Pbs_Pagination();
- $pagination->setPerPage(5);
+ $pagination->setPerPage(10);
$pagination->setElement($this->view->personList);
$pagination->setRequestPage($this->_request->getParam('page'));
$pagination->setPageUrl('/user/person/index/'.((isset($this->view->search))?'/search/'.$this->view->search:''));
@@ -111,7 +112,7 @@ class user_PersonController extends Zend_Controller_Action
}
// Pagination
$pagination = new Pbs_Pagination();
- $pagination->setPerPage(3);
+ $pagination->setPerPage(10);
$pagination->setElement($this->groups);
$pagination->setRequestPage($this->_request->getParam('page'));
$pagination->setPageUrl('/user/person/index' .((isset($this->view->search))?'/search/'.$this->view->search:''));
@@ -123,6 +124,7 @@ class user_PersonController extends Zend_Controller_Action
$this->view->groupRequestRight = true;
$this->view->editRight = Pbs_Acl::checkRight('peod');
$this->view->leaveRight = Pbs_Acl::checkRight('gl');
+ $this->view->suspendRight = Pbs_Acl::checkRight('psa');
$this->view->userIDsNamespace = Zend_Session::namespaceGet('userIDs');
}
@@ -375,7 +377,7 @@ class user_PersonController extends Zend_Controller_Action
}
// Pagination
$pagination = new Pbs_Pagination();
- $pagination->setPerPage(2);
+ $pagination->setPerPage(10);
$pagination->setElement($groups);
$pagination->setRequestPage($this->_request->getParam('page'));
$pagination->setPageUrl('/user/person/show/personID/' . $personID .((isset($this->view->search))?'/search/'.$this->view->search:''));
@@ -386,6 +388,7 @@ class user_PersonController extends Zend_Controller_Action
$this->view->personID = $personID;
$this->view->editRight = Pbs_Acl::checkRight('peoa');
$this->view->deleteRight = Pbs_Acl::checkRight('pd');
+ $this->view->suspendRight = Pbs_Acl::checkRight('psa');
$this->view->userIDsNamespace = Zend_Session::namespaceGet('userIDs');
} else {
$this->_helper->redirector('', 'person');
@@ -409,6 +412,52 @@ class user_PersonController extends Zend_Controller_Action
return;
}
+ public function suspendAction()
+ {
+ if(!Pbs_Acl::checkRight('psa')) {
+ $this->_redirect('/user');
+ }
+ $this->_helper->viewRenderer->setNoRender();
+ $personID = $this->_request->getParam('personID');
+ if(isset($personID)) {
+ $person = $this->personmapper->find($personID);
+ $person->setSuspended(1);
+ if(isset($person)) {
+ try {
+ $this->personmapper->save($person);
+ } catch(Zend_Exception $e)
+ {
+ echo "Caught exception: " . get_class($e) . "<br/>";
+ echo "Message: " . $e->getMessage() . "<br/>";
+ return;
+ }
+ $this->_redirect("/user/person/");
+ }
+ }
+ }
+ public function resumeAction()
+ {
+ if(!Pbs_Acl::checkRight('psa')) {
+ $this->_redirect('/user');
+ }
+ $this->_helper->viewRenderer->setNoRender();
+ $personID = $this->_request->getParam('personID');
+ if(isset($personID)) {
+ $person = $this->personmapper->find($personID);
+ $person->setSuspended(0);
+ if(isset($person)) {
+ try {
+ $this->personmapper->save($person);
+ } catch(Zend_Exception $e)
+ {
+ echo "Caught exception: " . get_class($e) . "<br/>";
+ echo "Message: " . $e->getMessage() . "<br/>";
+ return;
+ }
+ $this->_redirect("/user/person/");
+ }
+ }
+ }
}
diff --git a/application/modules/user/controllers/PoolController.php b/application/modules/user/controllers/PoolController.php
index 942f988..5c137a3 100644
--- a/application/modules/user/controllers/PoolController.php
+++ b/application/modules/user/controllers/PoolController.php
@@ -78,13 +78,13 @@ class User_PoolController extends Zend_Controller_Action
// Pagination
$pagination = new Pbs_Pagination();
- $pagination->setPerPage(4);
+ $pagination->setPerPage(10);
$pagination->setElement($yourpools);
$pagination->setRequestPage($this->_request->getParam('page'));
$pagination->setPageUrl('/user/pool/index'.((isset($this->view->search))?'/search/'.$this->view->search:''));
$yourpools = $pagination->getElements();
- $this->view->pagination = $pagination->pagination($pageurl);
+ $this->view->pagination = $pagination->pagination();
$this->view->page = $pagination->getRequestPage();
$this->view->pools = $yourpools;
diff --git a/application/modules/user/controllers/PrebootController.php b/application/modules/user/controllers/PrebootController.php
index 2aeafda..2e46b59 100644
--- a/application/modules/user/controllers/PrebootController.php
+++ b/application/modules/user/controllers/PrebootController.php
@@ -74,13 +74,13 @@ class User_PrebootController extends Zend_Controller_Action
// Pagination
$pagination = new Pbs_Pagination();
- $pagination->setPerPage(2);
+ $pagination->setPerPage(10);
$pagination->setElement($this->view->prebootlist);
$pagination->setRequestPage($this->_request->getParam('page'));
$pagination->setPageUrl('/user/preboot/index'.((isset($this->view->search))?'/search/'.$this->view->search:''));
$this->view->prebootlist = $pagination->getElements();
- $this->view->pagination = $pagination->pagination($pageurl);
+ $this->view->pagination = $pagination->pagination();
$this->view->page = $pagination->getRequestPage();
$this->view->update = array();
diff --git a/application/modules/user/controllers/RoleController.php b/application/modules/user/controllers/RoleController.php
index 1b2e54f..2c22031 100644
--- a/application/modules/user/controllers/RoleController.php
+++ b/application/modules/user/controllers/RoleController.php
@@ -41,13 +41,13 @@ class User_RoleController extends Zend_Controller_Action
// Pagination
$pagination = new Pbs_Pagination();
- $pagination->setPerPage(5);
+ $pagination->setPerPage(10);
$pagination->setElement($this->view->roleList);
$pagination->setRequestPage($this->_request->getParam('page'));
$pagination->setPageUrl('/user/role/index'.((isset($this->view->search))?'/search/'.$this->view->search:''));
$this->view->roleList = $pagination->getElements();
- $this->view->pagination = $pagination->pagination($pageurl);
+ $this->view->pagination = $pagination->pagination();
$this->view->page = $pagination->getRequestPage();
$this->view->addRight = Pbs_Acl::checkRight('ra');
$this->view->editRight = Pbs_Acl::checkRight('re');
diff --git a/application/modules/user/controllers/SessionController.php b/application/modules/user/controllers/SessionController.php
index c00d759..e17dbfe 100644
--- a/application/modules/user/controllers/SessionController.php
+++ b/application/modules/user/controllers/SessionController.php
@@ -94,7 +94,7 @@ class User_SessionController extends Zend_Controller_Action
$pagination->setPageUrl('/user/session/index'.((isset($this->view->search))?'/search/'.$this->view->search:''));
$mySessions = $pagination->getElements();
- $this->view->pagination = $pagination->pagination($pageurl);
+ $this->view->pagination = $pagination->pagination();
$this->view->page = $pagination->getRequestPage();
$this->view->sessions = $mySessions;
diff --git a/application/modules/user/forms/PersonEdit.php b/application/modules/user/forms/PersonEdit.php
index 7175691..392174c 100644
--- a/application/modules/user/forms/PersonEdit.php
+++ b/application/modules/user/forms/PersonEdit.php
@@ -92,7 +92,7 @@ class user_Form_PersonEdit extends Zend_Form
$this->addElement('password', 'newpassword', array(
'filters' => array('StringTrim'),
'validators' => array(
- array('StringLength', false, array(0, 50)),
+ array('StringLength', false, array(5, 50)),
),
'required' => false,
'label' => 'Neues Password:',
diff --git a/application/modules/user/forms/Register.php b/application/modules/user/forms/Register.php
index 9c2a42d..1a054c4 100644
--- a/application/modules/user/forms/Register.php
+++ b/application/modules/user/forms/Register.php
@@ -84,7 +84,7 @@ class user_Form_Register extends Zend_Form
$this->addElement('password', 'password', array(
'filters' => array('StringTrim'),
'validators' => array(
- array('StringLength', false, array(0, 50)),
+ array('StringLength', false, array(5, 50)),
),
'required' => true,
'label' => 'Password:',
diff --git a/application/modules/user/views/scripts/group/index.phtml b/application/modules/user/views/scripts/group/index.phtml
index 2e376b3..e3b5082 100644
--- a/application/modules/user/views/scripts/group/index.phtml
+++ b/application/modules/user/views/scripts/group/index.phtml
@@ -6,31 +6,34 @@
?>
<div class='searchvars'>
-<div class='head'>Available searchfilter:</div>
-<div class='code'>title</div>
-<div class='code'>description</div>
+ <div class='head'>Available searchfilter:</div>
+ <div class='code'>title</div>
+ <div class='code'>description</div>
</div>
-<div class='listelement'><?php
+<div class='listelement'>
+<?php
if(count($this->groupList)==0)
-echo "There are no groups" ?> <?php foreach ($this->groupList as $k => $group): ?>
+echo "There are no groups" ?>
+<?php foreach ($this->groupList as $k => $group): ?>
<?php
$class='';
if($group->getID() == $this->userIDsNamespace['groupID'])
$class= 'highlight checked';
?>
-<div class='element<?php echo " $class";?>'><?php if($group->getID() != $this->userIDsNamespace['groupID']) {
+ <div class='element<?php echo " $class";?>'>
+ <?php if($group->getID() != $this->userIDsNamespace['groupID']) {
+ ?>
+ <div class='number'>
+ <div class='smallnumber'>Group</div>
+ <?php echo $k+1; ?>
+ </div>
+ <?php
+ }
?>
-<div class='number'>
- <div class='smallnumber'>Group</div>
- <?php echo $k+1; ?>
-</div>
- <?php
-}
-?>
-<div class='content'>
-<div class='actions'><a
- href="<?php if($group->getID() == $this->userIDsNamespace['groupID']) echo $this->url(
+ <div class='content'>
+ <div class='actions'>
+ <a href="<?php if($group->getID() == $this->userIDsNamespace['groupID']) echo $this->url(
array(
'module' => 'user',
'controller' => 'group',
@@ -45,9 +48,8 @@ $class= 'highlight checked';
'groupID' => $group->getID()
),
'default',
- true); ?>"> <img src='/media/img/show.png' alt='Show Group' /></a>
-<a
- href="<?php if($group->getID() == $this->userIDsNamespace['groupID']) echo $this->url(
+ true); ?>"> <img src='/media/img/show.png' alt='Show Group' /> </a>
+ <a href="<?php if($group->getID() == $this->userIDsNamespace['groupID']) echo $this->url(
array(
'module' => 'user',
'controller' => 'group',
@@ -62,9 +64,8 @@ $class= 'highlight checked';
'groupID' => $group->getID()
),
'default',
- true); ?>"> <img src='/media/img/edit.png' alt='Edit Group' /></a>
-<a
- href="<?php if($group->getID() == $this->userIDsNamespace['groupID']) echo $this->url(
+ true); ?>"> <img src='/media/img/edit.png' alt='Edit Group' /> </a>
+ <a href="<?php if($group->getID() == $this->userIDsNamespace['groupID']) echo $this->url(
array(
'module' => 'user',
'controller' => 'group',
@@ -80,24 +81,26 @@ $class= 'highlight checked';
),
'default',
true); ?>"> <img src='/media/img/delete.png' alt='Delete Group' /></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 class='clear'></div>
+ </div>
+ <?php endforeach ?>
</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 class='clear'></div>
-</div>
-<?php endforeach ?></div>
-<?php echo $this->pagination; ?>
+ <?php echo $this->pagination; ?>
-<?php echo $this->formButton('linkgroups', 'Link Groups', array(
+ <?php echo $this->formButton('linkgroups', 'Link Groups', array(
'onclick' => 'self.location="/user/group/link"',
'class' => 'addbutton'))
?>
diff --git a/application/modules/user/views/scripts/group/show.phtml b/application/modules/user/views/scripts/group/show.phtml
index f1a14d1..b2a85ac 100644
--- a/application/modules/user/views/scripts/group/show.phtml
+++ b/application/modules/user/views/scripts/group/show.phtml
@@ -1,31 +1,32 @@
-<?php
-if($this->groupID) {
- if(isset($this->userIDsNamespace['groupID'])) {
- ?>
-<h1>Own Group</h1>
- <?php
- echo $this->formButton('deletegroup', 'Delete', array(
+<h1>Groupdetails - <?php echo $this->group->getTitle();?></h1>
+<?php
+if($this->usergroup == $this->requestgroup){
+ echo $this->formButton('deletegroup', 'Delete', array(
'onclick' => 'self.location="/user/group/delete/"',
'class' => 'rightbutton'));
- echo $this->formButton('editgroup', 'Edit', array(
+ echo $this->formButton('editgroup', 'Edit', array(
'onclick' => 'self.location="/user/group/edit/"',
'class' => 'rightbutton'));
- } else {
- ?>
-<h1>Group Details</h1>
- <?php
- echo $this->formButton('deletegroup', 'Delete', array(
+}
+else{
+ echo $this->formButton('deletegroup', 'Delete', array(
'onclick' => 'self.location="/user/group/delete/groupID/' . $this->group->getID() .'"',
'class' => 'rightbutton'));
- echo $this->formButton('editgroup', 'Edit', array(
+ echo $this->formButton('editgroup', 'Edit', array(
'onclick' => 'self.location="/user/group/edit/groupID/' . $this->group->getID() .'"',
'class' => 'rightbutton'));
- }
- ?>
+}
+?>
<div class='listelement'>
<div class='element'>
<div class='number'>
- <div class='smallnumber'>Your Group</div>
+ <?php
+ if($this->usergroup == $this->requestgroup){ ?>
+ <div class='smallnumber'>Your Group</div>
+ <?php }else{ ?>
+ <div class='smallnumber'>Group</div>
+ <?php echo $this->group->getID(); ?>
+ <?php } ?>
</div>
<div class='content'>
<div class='title'><?php echo $this->group->getTitle(); ?></div>
@@ -40,7 +41,7 @@ if($this->groupID) {
</div>
</div>
<?php
-}
+
// Show Request List
if(isset($this->groupRequestList)){
@@ -55,12 +56,23 @@ if(isset($this->groupRequestList)){
?>
<div class='element'>
<div class='content'>
+ <?php
+ if($this->usergroup == $this->requestgroup && (Pbs_Acl::checkRight('gam') || Pbs_Acl::checkRight('gdm'))){
+ ?>
<div class='actions'>
+ <?php if(Pbs_Acl::checkRight('gam')): ?>
<form action="/user/group/grantperson" method="post">
<input type="hidden" name="grouprequestID" value="<?php echo $grouprequestID; ?>" /> <?php printRoleSelect($this->roleList); ?>
<input type="image" src='/media/img/save.png' alt='Grant Person' name="confirm" value="confirm" />
</form>
+ <?php endif; ?>
+ <?php if(Pbs_Acl::checkRight('gdm')): ?>
+ TODO
+ <?php endif; ?>
</div>
+ <?php
+ }
+ ?>
<div class='title'><?php echo $person->getTitle(); ?>&nbsp;<?php echo $person->getFirstname(); ?>&nbsp;<?php echo $person->getName(); ?></div>
<div class='subtitle'><?php echo $person->getCity(); ?></div>
<div class='details dispnone'>
@@ -69,12 +81,14 @@ if(isset($this->groupRequestList)){
</div>
</div>
</div>
- <?php } ?>
+ <?php
+ }
+ ?>
</div>
<?php
}
// Show Memberlist
-if(isset($this->membersList)){
+if(isset($this->membersList) && Pbs_Acl::checkRight('gsmg')){
?>
<br />
<h2>Members:</h2>
@@ -105,6 +119,9 @@ if(count($this->membersList)==0)
?>
<div class='content'>
<div class='actions'>
+ <?php
+ if((Pbs_Acl::checkRight('gdmo') && $this->usergroup == $this->requestgroup) || (Pbs_Acl::checkRight('gdmog') && $this->usergroup != $this->requestgroup)):
+ ?>
<a href="<?php echo $this->url(
array(
'module' => 'user',
@@ -114,6 +131,9 @@ if(count($this->membersList)==0)
),
'default',
true) ?>"> <img src='/media/img/delete.png' alt='Revoke Membership' /></a>
+ <?php
+ endif;
+ ?>
</div>
<div class='title'><?php echo $person->getFirstname(); ?> <?php echo $person->getName(); ?></div>
<div class='subtitle'>Role: <?php echo $role->getTitle(); ?></div>
diff --git a/application/modules/user/views/scripts/person/index.phtml b/application/modules/user/views/scripts/person/index.phtml
index 1304299..93dfd78 100644
--- a/application/modules/user/views/scripts/person/index.phtml
+++ b/application/modules/user/views/scripts/person/index.phtml
@@ -15,14 +15,12 @@ $class='';
if($person->getID() == $this->userIDsNamespace['personID'])
$class= 'highlight checked';
?>
-<div class='element<?php echo " $class";?>'>
-<?php if($person->getID() != $this->userIDsNamespace['personID']) {
+<div class='element<?php echo " $class";?>'><?php if($person->getID() != $this->userIDsNamespace['personID']) {
?>
- <div class='number'>
- <div class='smallnumber'>Person</div>
- <?php echo $k+1; ?>
- </div>
-<?php
+<div class='number'>
+<div class='smallnumber'>Person</div>
+ <?php echo $k+1; ?></div>
+ <?php
}
?>
<div class='content'>
@@ -103,6 +101,33 @@ if($person->getID() == $this->userIDsNamespace['personID']) {
<?php
}
}
+if($this->suspendRight === true) {
+ if($person->getSuspended() == 1) {
+ ?> <a
+ href=" <?php echo $this->url(
+ array(
+ 'module' => 'user',
+ 'controller' => 'person',
+ 'action' => 'resume',
+ 'personID' => $person->getID()
+ ),
+ 'default',
+ true); ?>"> <img src='/media/img/resume.png' alt='Resume Account' /></a>
+ <?php
+ } else {
+ ?> <a
+ href=" <?php echo $this->url(
+ array(
+ 'module' => 'user',
+ 'controller' => 'person',
+ 'action' => 'suspend',
+ 'personID' => $person->getID()
+ ),
+ 'default',
+ true); ?>"> <img src='/media/img/suspend.png'
+ alt='Suspend Account' /></a> <?php
+ }
+}
?></div>
<div class='title'><?php echo $person->getTitle(); ?>&nbsp;<?php echo $person->getFirstname(); ?>&nbsp;<?php echo $person->getName(); ?></div>
<div class='subtitle'><?php echo $person->getEmail(); ?></div>
diff --git a/application/modules/user/views/scripts/person/owndetails.phtml b/application/modules/user/views/scripts/person/owndetails.phtml
index db9221d..dc6e9aa 100644
--- a/application/modules/user/views/scripts/person/owndetails.phtml
+++ b/application/modules/user/views/scripts/person/owndetails.phtml
@@ -1,27 +1,40 @@
<h1>Own Details</h1>
<style>
-label{width:150px !important;}
+label {
+ width: 150px !important;
+}
</style>
<?php if($this->editRight === true) echo $this->formButton('editperson', 'Edit', array(
'onclick' => 'self.location="/user/person/edit/"',
'class' => 'rightbutton'))?>
<div class='listelement'>
<div class='element'>
- <div class='content'>
- <div class='title'><?php echo $this->person->getTitle()." ".$this->person->getFirstname()." ".$this->person->getName(); ?></div>
- <div class='subtitle'><?php echo $this->person->getEmail(); ?></div>
- <div class='details'>
- <label>Street:</label><div class='item'><?php echo $this->person->getStreet(); ?>&nbsp;</div>
- <label>Housenumber:</label><div class='item'><?php echo $this->person->getHousenumber(); ?>&nbsp;</div>
- <label>City:</label><div class='item'><?php echo $this->person->getCity(); ?>&nbsp;</div>
- <label>Postalcode:</label><div class='item'><?php echo $this->person->getPostalcode(); ?>&nbsp;</div>
- <label>Email:</label><div class='item'><?php echo $this->person->getEmail(); ?>&nbsp;</div>
- <label>Last Login:</label><div class='item'><?php if( $this->person->getLogindate()) echo date ('d. F Y - H:i', $this->person->getLogindate()) . " Uhr"; ?>&nbsp;</div>
- <label>Register Date:</label><div class='item'><?php echo date ('d. F Y - H:i', $this->person->getRegisterdate()) . ' Uhr'; ?>&nbsp;</div>
- </div>
- </div>
- <div class='clear'>
+<div class='content'>
+<div class='title'><?php echo $this->person->getTitle()." ".$this->person->getFirstname()." ".$this->person->getName(); ?></div>
+<div class='subtitle'><?php echo $this->person->getEmail(); ?></div>
+<div class='details'><label>Street:</label>
+<div class='item'><?php echo $this->person->getStreet(); ?>&nbsp;</div>
+<label>Housenumber:</label>
+<div class='item'><?php echo $this->person->getHousenumber(); ?>&nbsp;</div>
+<label>City:</label>
+<div class='item'><?php echo $this->person->getCity(); ?>&nbsp;</div>
+<label>Postalcode:</label>
+<div class='item'><?php echo $this->person->getPostalcode(); ?>&nbsp;</div>
+<label>Email:</label>
+<div class='item'><?php echo $this->person->getEmail(); ?>&nbsp;</div>
+<label>Last Login:</label>
+<div class='item'><?php if( $this->person->getLogindate()) echo date ('d. F Y - H:i', $this->person->getLogindate()) . " Uhr"; ?>&nbsp;</div>
+<label>Register Date:</label>
+<div class='item'><?php echo date ('d. F Y - H:i', $this->person->getRegisterdate()) . ' Uhr'; ?>&nbsp;</div>
+<?php if($this->suspendRight === true)
+{
+ ?> <label>Suspended:</label>
+<div class='item'><?php if($this->person->getSuspended() == 1) echo "yes"; else echo "no"; ?></div>
+ <?php
+}
+?></div>
</div>
+<div class='clear'></div>
</div>
<br />
<h2>Member in the following Groups:</h2>
@@ -65,8 +78,7 @@ $class= 'highlight checked';
<?php endforeach ?></div>
<?php echo $this->pagination;
if(isset($this->groupRequestList)) {
- ?>
-<br />
+ ?> <br />
<h2>Requests:</h2>
<div class='listelement'><?php
foreach($this->groupRequestList as $grouprequest) {
@@ -103,4 +115,4 @@ foreach($this->groupRequestList as $grouprequest) {
?></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 c43bde3..2f2ef56 100644
--- a/application/modules/user/views/scripts/person/show.phtml
+++ b/application/modules/user/views/scripts/person/show.phtml
@@ -66,7 +66,18 @@
</div>
<div class='clear'></div>
</div>
+<?php if($this->suspendRight === true)
+{
+ ?>
+<div class='element'>
+<div class='content'>
+<div class="title">Suspended:&nbsp;<span class="noBold"><?php if($this->person->getSuspended() == 1) echo "yes"; else echo "no"; ?></span></div>
+</div>
+<div class='clear'></div>
</div>
+ <?php
+}
+?></div>
<br />
<h2>Member in the following Groups:</h2>
<div class='listelement'><?php if(count($this->groups)==0)
@@ -105,18 +116,18 @@ foreach($this->groupRequestList as $grouprequest) {
<div class='element'>
<div class='content'>
<div class='title'><?php echo $group->getTitle(); ?></div>
- <?php if($group->getDescription()) {
- ?>
+ <?php if($group->getDescription()) {
+ ?>
<div class='subtitle'><?php echo $group->getDescription(); ?></div>
- <?php
- } else {
- ?>
+ <?php
+ } else {
+ ?>
<div class='subtitle'>&nbsp;</div>
- <?php
- }
- ?></div>
+ <?php
+ }
+ ?></div>
</div>
- <?php
+ <?php
}
?></div>
<?php