Skip to content

Commit

Permalink
Fixed issue: [security] Administrator can change his own password wit…
Browse files Browse the repository at this point in the history
…hout entering the existing one
  • Loading branch information
c-schmitz committed Apr 13, 2023
1 parent 759d9b3 commit 10d5513
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions application/controllers/UserManagementController.php
Expand Up @@ -166,6 +166,16 @@ public function actionApplyEdit()
$aUser['expires'] = null;
}

// A user may not edit himself using this action
if (isset($aUser['uid']) && $aUser['uid'] && $aUser['uid'] == Yii::app()->user->id) {
return App()->getController()->renderPartial('/admin/super/_renderJson', [
"data" => [
'success' => false,
'errors' => gT('No permission')
]
]);
}

if (isset($aUser['uid']) && $aUser['uid']) {
$oUser = $this->updateAdminUser($aUser);
if ($oUser->hasErrors()) {
Expand Down

0 comments on commit 10d5513

Please sign in to comment.