Restrict access to avatar edit page

This commit is contained in:
Dmitriy Simushev 2014-05-23 09:11:35 +00:00
parent c39131199d
commit af45d34721

View File

@ -51,6 +51,11 @@ class AvatarController extends AbstractController
$can_modify = ($op_id == $operator['operatorid'] && is_capable(CAN_MODIFYPROFILE, $operator))
|| is_capable(CAN_ADMINISTRATE, $operator);
// Check if the curent operator has enough rights to access the page
if ($op_id != $operator['operatorid'] && !is_capable(CAN_ADMINISTRATE, $operator)) {
throw new AccessDeniedException();
}
// Try to load the target operator.
$op = operator_by_id($op_id);
if (!$op) {