Skip to content

Commit

Permalink
Fix to users with auth key access not being able to reset their authkey
Browse files Browse the repository at this point in the history
  • Loading branch information
iglocska committed Nov 12, 2013
1 parent 8c1d42d commit 7f6c842
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Controller/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ public function resetauthkey($id = null) {
}
$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));
Expand Down

0 comments on commit 7f6c842

Please sign in to comment.