public function handleDeleteAvatar()
 {
     $status = $this->userManager->removeAvatar($this->user->getId());
     if ($status) {
         $this->user->identity->avatar = '';
         $this->flashMessage('Photo was removed');
     } else {
         $this->flashMessage('Problem with photo removing', 'error');
     }
     $this->person = $this->userManager->get($this->getUser()->getId());
     if ($this->isAjax()) {
         $this->redrawControl('flashes');
         $this->redrawControl('profilePhoto');
         $this->redrawControl('layoutAvatar');
     } else {
         $this->redirect('this');
     }
 }
Ejemplo n.º 2
0
 /**
  * @param $personId int
  */
 public function handleDeleteAvatar($personId)
 {
     $this->canUser('edit', TRUE);
     $status = $this->mainManager->removeAvatar($personId);
     if ($status) {
         $this->flashMessage('Photo was removed');
     } else {
         $this->flashMessage('Problem with photo removing', 'error');
     }
     $this->detailObject = $this->mainManager->get($personId);
     if ($this->isAjax()) {
         $this->redrawControl('profilePhoto');
     } else {
         $this->redirect('this');
     }
 }