diff options
author | michael pereira | 2011-04-25 17:00:50 +0200 |
---|---|---|
committer | michael pereira | 2011-04-25 17:00:50 +0200 |
commit | feb2bf1f625a1ea35f69a981cf0e3d468a8f99d2 (patch) | |
tree | 946a47221e1c813f8252579b9430f4f55363e39d | |
parent | db fix (diff) | |
download | pbs2-feb2bf1f625a1ea35f69a981cf0e3d468a8f99d2.tar.gz pbs2-feb2bf1f625a1ea35f69a981cf0e3d468a8f99d2.tar.xz pbs2-feb2bf1f625a1ea35f69a981cf0e3d468a8f99d2.zip |
suspended fix
-rw-r--r-- | application/models/Membership.php | 10 | ||||
-rw-r--r-- | application/models/MembershipMapper.php | 6 | ||||
-rw-r--r-- | application/models/Person.php | 14 | ||||
-rw-r--r-- | application/models/PersonMapper.php | 54 | ||||
-rw-r--r-- | application/modules/user/controllers/AuthController.php | 5 | ||||
-rw-r--r-- | application/modules/user/controllers/GroupController.php | 8 | ||||
-rw-r--r-- | application/modules/user/controllers/PersonController.php | 8 | ||||
-rw-r--r-- | application/modules/user/views/scripts/group/show.phtml | 6 | ||||
-rw-r--r-- | application/modules/user/views/scripts/person/index.phtml | 2 | ||||
-rw-r--r-- | application/modules/user/views/scripts/person/owndetails.phtml | 2 | ||||
-rw-r--r-- | application/modules/user/views/scripts/person/show.phtml | 2 |
11 files changed, 82 insertions, 35 deletions
diff --git a/application/models/Membership.php b/application/models/Membership.php index c445338..a455848 100644 --- a/application/models/Membership.php +++ b/application/models/Membership.php @@ -16,7 +16,7 @@ class Application_Model_Membership protected $_groupID; protected $_roleID; protected $_personID; - protected $_suspended; + protected $_suspend; protected $_apikey; public function __construct(array $options = null) @@ -93,13 +93,13 @@ class Application_Model_Membership $this->_personID = $_personID; return $this; } - public function getSuspended() + public function getSuspend() { - return $this->_suspended; + return $this->_suspend; } - public function setSuspended($_suspended) + public function setSuspend($_suspend) { - $this->_suspended = $_suspended; + $this->_suspend = $_suspend; return $this; } public function getApikey() diff --git a/application/models/MembershipMapper.php b/application/models/MembershipMapper.php index a721453..6786c92 100644 --- a/application/models/MembershipMapper.php +++ b/application/models/MembershipMapper.php @@ -84,7 +84,7 @@ class Application_Model_MembershipMapper public function save(Application_Model_Membership $membership) { - $data = array('membershipID'=> $membership->getID() ,'groupID'=> $membership->getGroupID() ,'roleID'=> $membership->getRoleID() ,'personID'=> $membership->getPersonID() ,'suspended'=> $membership->getSuspended(), 'apikey'=> $membership->getApikey() ); + $data = array('membershipID'=> $membership->getID() ,'groupID'=> $membership->getGroupID() ,'roleID'=> $membership->getRoleID() ,'personID'=> $membership->getPersonID() ,'suspend'=> $membership->getSuspend(), 'apikey'=> $membership->getApikey() ); if (null === ($id = $membership->getID()) ) { unset($data['membershipID']); @@ -119,7 +119,7 @@ class Application_Model_MembershipMapper $row = $result->current(); - $membership->setID($row->membershipID)->setGroupID($row->groupID)->setRoleID($row->roleID)->setPersonID($row->personID)->setSuspended($row->suspended)->setApikey($row->apikey); + $membership->setID($row->membershipID)->setGroupID($row->groupID)->setRoleID($row->roleID)->setPersonID($row->personID)->setSuspend($row->suspend)->setApikey($row->apikey); if($return){ return $membership; } @@ -132,7 +132,7 @@ class Application_Model_MembershipMapper foreach ($resultSet as $row) { $entry = new Application_Model_Membership(); - $entry->setID($row->membershipID)->setGroupID($row->groupID)->setRoleID($row->roleID)->setPersonID($row->personID)->setSuspended($row->suspended)->setApikey($row->apikey); + $entry->setID($row->membershipID)->setGroupID($row->groupID)->setRoleID($row->roleID)->setPersonID($row->personID)->setSuspend($row->suspend)->setApikey($row->apikey); $entries[] = $entry; } diff --git a/application/models/Person.php b/application/models/Person.php index 4d4a000..637eb7d 100644 --- a/application/models/Person.php +++ b/application/models/Person.php @@ -27,7 +27,7 @@ class Application_Model_Person protected $_password; protected $_password_salt; protected $_loginpassword; - protected $_suspended; + protected $_suspend; public function __construct(array $options = null) { @@ -186,11 +186,11 @@ class Application_Model_Person $this->_password = $_password; return $this; } - public function getLoginPassword() + public function getLoginpassword() { return $this->_loginpassword; } - public function setLoginPassword($_loginpassword) + public function setLoginpassword($_loginpassword) { $this->_loginpassword = $_loginpassword; return $this; @@ -204,13 +204,13 @@ class Application_Model_Person { return $this->_password_salt; } - public function getSuspended() + public function getSuspend() { - return $this->_suspended; + return $this->_suspend; } - public function setSuspended($_suspended) + public function setSuspend($_suspend) { - $this->_suspended = $_suspended; + $this->_suspend = $_suspend; return $this; } /** diff --git a/application/models/PersonMapper.php b/application/models/PersonMapper.php index c123bdc..9330e7e 100644 --- a/application/models/PersonMapper.php +++ b/application/models/PersonMapper.php @@ -36,8 +36,9 @@ class Application_Model_PersonMapper $a[] = "$k $v"; $select->order($a); } - + # print_a($select); $stmt = $select->query(); + # print_a($stmt); $result = $stmt->fetchAll(); if(!$array){ @@ -84,7 +85,22 @@ 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(), 'loginpassword'=> $person->getLoginPassword() ,'password_salt'=> $person->getPasswordSalt() ,'suspended'=> $person->getSuspended() ); + $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(), + 'loginpassword'=> $person->getLoginpassword() , + 'password_salt'=> $person->getPasswordSalt() , + 'suspend'=> $person->getSuspend() ); if (null === ($id = $person->getID()) ) { unset($data['personID']); @@ -120,7 +136,22 @@ 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)->setLoginPassword($row->loginpassword)->setPasswordSalt($row->password_salt)->setSuspended($row->suspended); + $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) + ->setLoginpassword($row->loginpassword) + ->setSuspend($row->suspend); if($return){ return $person; } @@ -133,7 +164,22 @@ 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)->setLoginPassword($row->loginpassword)->setPasswordSalt($row->password_salt)->setSuspended($row->suspended); + $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) + ->setSuspend($row->suspend) + ->setLoginpassword($row->loginpassword); $entries[] = $entry; } diff --git a/application/modules/user/controllers/AuthController.php b/application/modules/user/controllers/AuthController.php index 47aa029..9c6faa8 100644 --- a/application/modules/user/controllers/AuthController.php +++ b/application/modules/user/controllers/AuthController.php @@ -52,10 +52,11 @@ class User_AuthController extends Zend_Controller_Action $this->personmapper = new Application_Model_PersonMapper(); $result = $this->personmapper->findBy(array('email' => Zend_Auth::getInstance()->getIdentity()),true); $person = new Application_Model_Person($result[0]); + print_a('case1',$person); $person->setID($result[0]['personID']); $date = new DateTime(); $person->setLogindate($date->getTimestamp()); - if($person->getSuspended()) { + if($person->getSuspend()) { $pbsNotifier = new Pbs_Notifier(); $this->view->notification = $pbsNotifier->notify('Your Account is suspended', 'error'); } else { @@ -103,7 +104,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->setSuspend(0); $person->setRegisterdate($date->getTimestamp()); $person->setPasswordSalt(MD5($date->getTimestamp())); $person->setPassword(MD5($person->getPassword() . $person->getPasswordSalt())); diff --git a/application/modules/user/controllers/GroupController.php b/application/modules/user/controllers/GroupController.php index 3f7fde0..bb39287 100644 --- a/application/modules/user/controllers/GroupController.php +++ b/application/modules/user/controllers/GroupController.php @@ -275,7 +275,7 @@ class User_GroupController extends Zend_Controller_Action $role = $this->rolemapper->find($membership_tmp->getRoleID()); $membersList[] = array( 'membershipID' => $member['membershipID'], - 'suspended' => $member['suspended'], + 'suspend' => $member['suspend'], 'person' => $person, 'role' => $role ); @@ -422,7 +422,7 @@ class User_GroupController extends Zend_Controller_Action $membership->setGroupID($groupRequest->getGroupID()); $membership->setPersonID($groupRequest->getPersonID()); $membership->setRoleID($_POST['roleID']); - $membership->setSuspended(0); + $membership->setSuspend(0); $apikey = randomString(32); $membership->setApikey($apikey); @@ -504,7 +504,7 @@ class User_GroupController extends Zend_Controller_Action $membershipID = $this->_request->getParam('membershipID'); if(isset($membershipID)) { $membership = $this->membershipMapper->find($membershipID); - $membership->setSuspended(1); + $membership->setSuspend(1); if(isset($membership)) { if($membership->getGroupID() != $this->userIDsNamespace['groupID']) { $pbsNotifier = new Pbs_Notifier(); @@ -533,7 +533,7 @@ class User_GroupController extends Zend_Controller_Action $membershipID = $this->_request->getParam('membershipID'); if(isset($membershipID)) { $membership = $this->membershipMapper->find($membershipID); - $membership->setSuspended(0); + $membership->setSuspend(0); if(isset($membership)) { if($membership->getGroupID() != $this->userIDsNamespace['groupID']) { $pbsNotifier = new Pbs_Notifier(); diff --git a/application/modules/user/controllers/PersonController.php b/application/modules/user/controllers/PersonController.php index cc8a1e2..c51a297 100644 --- a/application/modules/user/controllers/PersonController.php +++ b/application/modules/user/controllers/PersonController.php @@ -330,12 +330,12 @@ class user_PersonController extends Zend_Controller_Action } else { $groupMapper = new Application_Model_GroupMapper(); $roleMapper = new Application_Model_RoleMapper(); - if(isset($this->memberships)) { + if(isset($this->memberships)) { $suspendlist = array(); foreach($this->memberships as $membership) { $group = $groupMapper->find($membership['groupID']); $role = $roleMapper->find($membership['roleID']); - if($membership['suspended'] == 0){ + if($membership['suspend'] == 0){ $membershipList[] = array( 'membershipID' => $membership['membershipID'], 'group' => $group->getTitle(), @@ -463,7 +463,7 @@ class user_PersonController extends Zend_Controller_Action $personID = $this->_request->getParam('personID'); if(isset($personID)) { $person = $this->personmapper->find($personID); - $person->setSuspended(1); + $person->setSuspend(1); if(isset($person)) { try { $this->personmapper->save($person); @@ -487,7 +487,7 @@ class user_PersonController extends Zend_Controller_Action $personID = $this->_request->getParam('personID'); if(isset($personID)) { $person = $this->personmapper->find($personID); - $person->setSuspended(0); + $person->setSuspend(0); if(isset($person)) { try { $this->personmapper->save($person); diff --git a/application/modules/user/views/scripts/group/show.phtml b/application/modules/user/views/scripts/group/show.phtml index fae7b44..7e2eec0 100644 --- a/application/modules/user/views/scripts/group/show.phtml +++ b/application/modules/user/views/scripts/group/show.phtml @@ -110,7 +110,7 @@ if(count($this->membersList)==0) echo "This hroup has no members." ?> <?php foreach ($this->membersList as $k => $member): ?> <?php $membershipID = $member['membershipID']; -$suspended = $member['suspended']; +$suspend = $member['suspend']; $person = $member['person']; $role = $member['role']; $class=''; @@ -142,7 +142,7 @@ if((Pbs_Acl::checkRight('gdmo') && $this->usergroup == $this->requestgroup) || ( alt='Revoke Membership' /></a> <?php endif; if(Pbs_Acl::checkRight('gsm')) { - if($suspended == 1) + if($suspend == 1) { ?> <a href=" <?php echo $this->url( @@ -179,7 +179,7 @@ if((Pbs_Acl::checkRight('gdmo') && $this->usergroup == $this->requestgroup) || ( <?php if(Pbs_Acl::checkRight('gsm')) { ?> <label>Membership suspended</label> -<div class='item'><?php if($suspended == 1) echo "yes"; else echo "no"; ?></div> +<div class='item'><?php if($suspend == 1) echo "yes"; else echo "no"; ?></div> <?php } ?></div> diff --git a/application/modules/user/views/scripts/person/index.phtml b/application/modules/user/views/scripts/person/index.phtml index 515f9da..9899928 100644 --- a/application/modules/user/views/scripts/person/index.phtml +++ b/application/modules/user/views/scripts/person/index.phtml @@ -102,7 +102,7 @@ if($person->getID() == $this->userIDsNamespace['personID']) { } } if($this->suspendRight === true) { - if($person->getSuspended() == 1) { + if($person->getSuspend() == 1) { ?> <a href=" <?php echo $this->url( array( diff --git a/application/modules/user/views/scripts/person/owndetails.phtml b/application/modules/user/views/scripts/person/owndetails.phtml index 60364c0..896a52b 100644 --- a/application/modules/user/views/scripts/person/owndetails.phtml +++ b/application/modules/user/views/scripts/person/owndetails.phtml @@ -29,7 +29,7 @@ label { <?php if($this->suspendRight === true) { ?> <label>Suspended:</label> - <div class='item'><?php if($this->person->getSuspended() == 1) echo "yes"; else echo "no"; ?></div> + <div class='item'><?php if($this->person->getSuspend() == 1) echo "yes"; else echo "no"; ?></div> <?php } ?> diff --git a/application/modules/user/views/scripts/person/show.phtml b/application/modules/user/views/scripts/person/show.phtml index 6283808..a62557b 100644 --- a/application/modules/user/views/scripts/person/show.phtml +++ b/application/modules/user/views/scripts/person/show.phtml @@ -32,7 +32,7 @@ label { <?php if($this->suspendRight === true) { ?> <label>Suspended:</label> - <div class='item'><?php if($this->person->getSuspended() == 1) echo "yes"; else echo "no"; ?></div> + <div class='item'><?php if($this->person->getSuspend() == 1) echo "yes"; else echo "no"; ?></div> <?php } ?> |