-cc-2126: user should not be able to delete himself
added server side check
This commit is contained in:
parent
df3b24d3ad
commit
a937dcb5ac
|
@ -83,10 +83,16 @@ class UserController extends Zend_Controller_Action
|
||||||
public function removeUserAction()
|
public function removeUserAction()
|
||||||
{
|
{
|
||||||
// action body
|
// action body
|
||||||
$id = $this->_getParam('id');
|
$delId = $this->_getParam('id');
|
||||||
$user = new User($id);
|
|
||||||
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
$this->view->entries = $user->delete();
|
$userId = $userInfo->id;
|
||||||
|
|
||||||
|
if ($delId != $userId){
|
||||||
|
$user = new User($delId);
|
||||||
|
$this->view->entries = $user->delete();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue