$note .= 'Remote entity added: ' . $key . '<br />';
             }
         }
         // Remove the ones that were, but are now no longer selected
         foreach ($current as $entityid) {
             if (!in_array($entityid, $_POST['addAllowed'])) {
                 if ($mcontroller->removeAllowedEntity($entityid)) {
                     $update = TRUE;
                     $note .= 'Existing entity removed: ' . $entityid . '<br/>';
                 }
             }
         }
     } else {
         if (count($mcontroller->getAllowedEntities())) {
             // There were allowed entities but they were no longer posted; we should clear them all.
             $mcontroller->clearAllowedEntities();
             $update = TRUE;
         }
     }
 }
 // Allowedal
 if ((isset($_POST['allowall']) || isset($_POST['allownone'])) && $guard->hasPermission('blockremoteentity', $entity->getWorkflow(), $user->getType())) {
     if ($mcontroller->setAllowedAll(isset($_POST['allowall']) ? 'yes' : 'no')) {
         $update = TRUE;
         $mcontroller->clearAllowedEntities();
         $mcontroller->clearBlockedEntities();
         $note .= 'Set block/allow all remote entities<br />';
     }
 }
 // Change workflow
 if (isset($_POST['entity_workflow']) && $guard->hasPermission('changeworkflow', $entity->getWorkflow(), $user->getType())) {