Beispiel #1
0
 public function updateEntity($id, $data)
 {
     if (!empty($data['parentId']) && $data['parentId'] == $id) {
         throw new Forbidden();
     }
     return parent::updateEntity($id, $data);
 }
 public function updateEntity($id, $data)
 {
     $entity = parent::updateEntity($id, $data);
     $entity->clear('password');
     return $entity;
 }
Beispiel #3
0
 public function updateEntity($id, $data)
 {
     if ($id == 'system') {
         throw new Forbidden();
     }
     $newPassword = null;
     if (array_key_exists('password', $data)) {
         $newPassword = $data['password'];
         $data['password'] = $this->hashPassword($data['password']);
     }
     if ($id == $this->getUser()->id) {
         unset($data['isActive']);
     }
     if (!$this->getUser()->get('isSuperAdmin')) {
         unset($data['isSuperAdmin']);
     }
     $user = parent::updateEntity($id, $data);
     if (!is_null($newPassword)) {
         try {
             if ($user->isActive()) {
                 $this->sendPassword($user, $newPassword);
             }
         } catch (\Exception $e) {
         }
     }
     return $user;
 }
Beispiel #4
0
 public function updateEntity($id, $data)
 {
     $entity = parent::updateEntity($id, $data);
     return $entity;
 }
Beispiel #5
0
 public function updateEntity($id, $data)
 {
     if ($id == 'system') {
         throw new Forbidden();
     }
     $newPassword = null;
     if (array_key_exists('password', $data)) {
         $newPassword = $data['password'];
         $data['password'] = $this->hashPassword($data['password']);
     }
     $user = parent::updateEntity($id, $data);
     if (!is_null($newPassword)) {
         $this->sendPassword($user, $newPassword);
     }
     return $user;
 }