/** * Notifies managing contact about updated metadata of entity * * @param sspmod_janus_Entity $entity * @param string $metadataXml * @return void */ protected function _mailUpdatedMetaData(sspmod_janus_Entity $entity, $metadataXml) { $config = SimpleSAML_Configuration::getInstance(); $time = date(DATE_RFC822); $entityName = $entity->getPrettyname(); $entityId = $entity->getEntityId(); $message = <<<MESSAGE <h1>Metadata Change detected</h1> <p>Cron ran at {$time}</p> <p>Name: {$entityName}</p> <p>EntityId: {$entityId}</p> MESSAGE; $toAddress = $config->getString('managingcontact_email'); if (empty($toAddress)) { SimpleSAML_Logger::error('Cron - Could not send email. [managingcontact_email] not set in config.'); } $fromAddress = '*****@*****.**'; $subject = "Metadata Change detected for entity " . $entity->getPrettyname() . " (" . $entity->getEntityId() . "])"; $email = new SimpleSAML_XHTML_EMail($toAddress, $subject, $fromAddress); $email->setBody($message); // Add gzipped metadata $attachmentContent = gzencode($metadataXml); $attachmentFileName = 'metadata-' . $entityName . '.xml.gz'; $email->addAttachment($attachmentContent, $attachmentFileName, 'application/zip'); $email->send(); }
<img src="resources/images/pm_plus_16.png" alt="Edit" width="16" height="16" onclick="ARP.create();" /> <br /> <!-- ARP Add --> <div id="arpEdit" style="display: none;"> <script type="text/javascript"> <?php foreach ($this->data['adminentities'] as $entity) { $arpId = $entity->getArp(); $entityId = $entity->getEntityid(); $entityName = $entity->getPrettyname(); $entityData = array('eid' => $entity->getEid(), 'entityId' => $entity->getEntityid(), 'name' => $entity->getPrettyname(), 'revision' => $entity->getRevisionid()); $entityDataJson = json_encode($entityData, true); echo "ARP.setEntityForArp({$arpId}, {$entityDataJson});" . PHP_EOL; } ?> </script> <form action="" method="post" onsubmit="return ARP.validate()"> <a href="#" style="float: right;" onclick="$(this).parents('#arpEdit').hide(); return false;" > [<?php echo strtoupper($this->t('text_close')); ?> ]