/**
  * Execute the action
  */
 public function execute()
 {
     $settingsService = $this->get('fork.settings');
     // Save access_token to settings
     $instagramUserId = $settingsService->get($this->URL->getModule(), 'default_instagram_user_id', false);
     if ($instagramUserId) {
         BackendInstagramModel::delete($instagramUserId);
     }
     $settingsService->set('Instagram', 'client_id', null);
     $settingsService->set('Instagram', 'client_secret', null);
     $settingsService->set('Instagram', 'username', null);
     $settingsService->set('Instagram', 'access_token', null);
     $settingsService->set('Instagram', 'default_instagram_user_id', null);
     $this->redirect(BackendModel::createURLForAction('Settings'));
 }
 /**
  * Execute the action
  */
 public function execute()
 {
     $this->id = $this->getParameter('id', 'int');
     // Does the item exist?
     if ($this->id !== null && BackendInstagramModel::exists($this->id)) {
         parent::execute();
         $this->record = (array) BackendInstagramModel::get($this->id);
         if ($this->record['locked'] == 'Y') {
             $this->redirect(Model::createURLForAction('Index') . '&error=is-locked');
         }
         // Delete the file
         BackendInstagramModel::delete($this->id);
         Model::triggerEvent($this->getModule(), 'after_delete', array('id' => $this->id));
         $this->redirect(Model::createURLForAction('Index') . '&report=deleted&var=' . urlencode($this->record['title']));
     } else {
         $this->redirect(Model::createURLForAction('Index') . '&error=non-existing');
     }
 }