Fix to users with auth key access not being able to reset their authkey

pull/195/head
iglocska 2013-11-12 15:11:59 +01:00
parent 8c1d42d1c1
commit 7f6c8425ae
1 changed files with 1 additions and 1 deletions

View File

@ -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));