From 7f6c8425ae63477b48bd60724630c7aa1ce8628c Mon Sep 17 00:00:00 2001 From: iglocska Date: Tue, 12 Nov 2013 15:11:59 +0100 Subject: [PATCH] Fix to users with auth key access not being able to reset their authkey --- app/Controller/UsersController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Controller/UsersController.php b/app/Controller/UsersController.php index 387ca8c78..abfd1a380 100755 --- a/app/Controller/UsersController.php +++ b/app/Controller/UsersController.php @@ -407,7 +407,7 @@ class UsersController extends AppController { } $this->User->read(); if ('me' == $id ) $id = $this->Auth->user('id'); - else if (!$this->_isSiteAdmin() && !($this->_isAdmin() && $this->Auth->user('org') == $this->User->data['User']['org'])) throw new MethodNotAllowedException(); + else if (!$this->_isSiteAdmin() && !($this->_isAdmin() && $this->Auth->user('org') == $this->User->data['User']['org']) && ($this->Auth->user('id') != $id)) throw new MethodNotAllowedException(); $newkey = $this->User->generateAuthKey(); $this->User->saveField('authkey', $newkey); $this->Session->setFlash(__('New authkey generated.', true));