Skip to content

Instantly share code, notes, and snippets.

View imcbride's full-sized avatar

Ian McBride imcbride

View GitHub Profile
diff --git a/src/SamlService.php b/src/SamlService.php
index 34dbac0..0905e68 100644
--- a/src/SamlService.php
+++ b/src/SamlService.php
@@ -301,6 +301,10 @@ class SamlService {
$this->flood->register('samlauth.failed_login_ip', $flood_config->get('ip_window'));
throw $acs_exception;
}
+
+ // Added by Adam Franco 2017-11-02 to help debug authentication and account issues.
diff --git a/config/schema/jsonapi_reference.schema.yml b/config/schema/jsonapi_reference.schema.yml
index 98a8eca..278a279 100644
--- a/config/schema/jsonapi_reference.schema.yml
+++ b/config/schema/jsonapi_reference.schema.yml
@@ -2,14 +2,20 @@ field.storage_settings.typed_resource_object:
type: mapping
label: 'Typed resource object storage settings'
mapping:
+ jsonapi_reference_entity:
+ type: string
index d4823d5..ab6dc25 100644
--- a/webprofiler/src/Command/BenchmarkCommand.php
+++ b/webprofiler/src/Command/BenchmarkCommand.php
@@ -2,6 +2,7 @@
namespace Drupal\webprofiler\Command;
+use Drupal\Console\Annotations\DrupalCommand;
use GuzzleHttp\ClientInterface;
use GuzzleHttp\Cookie\CookieJar;
@imcbride
imcbride / video-embed-html5-force-refresh-parameter.patch
Created June 22, 2020 13:14
Update downloadThumbnail() to match parent definition
diff --git a/src/Plugin/video_embed_field/Provider/Html5.php b/src/Plugin/video_embed_field/Provider/Html5.php
index a645be6..413f9d8 100644
--- a/src/Plugin/video_embed_field/Provider/Html5.php
+++ b/src/Plugin/video_embed_field/Provider/Html5.php
@@ -94,7 +94,7 @@ class Html5 extends ProviderPluginBase {
/**
* {@inheritdoc}
*/
- public function downloadThumbnail() {
+ public function downloadThumbnail($force_refresh = false) {
diff --git a/src/Typogrify.php b/src/Typogrify.php
index 44855f0..107323d 100644
--- a/src/Typogrify.php
+++ b/src/Typogrify.php
@@ -190,7 +190,7 @@ class Typogrify {
([^<>\s]+ # must be flollowed by non-tag non-space characters
\s* # optional white space!
(<\/(a|em|span|strong|i|b)[^>]*>\s*)* # optional closing inline tags with optional white space after each
- ((<\/(p|h[1-6]|li|dt|dd)>)|$)) # end with a closing p, h1-6, li or the end of the string
+ ((<\/(p|h[1-6])>)|$)) # end with a closing p, h1-6, li or the end of the string
@imcbride
imcbride / video-embed-html5-force-refresh-parameter.patch
Last active June 22, 2020 13:05
Patch for drupal/video_embed_html5
diff --git a/src/Plugin/video_embed_field/Provider/Html5.php b/src/Plugin/video_embed_field/Provider/Html5.php
index a645be6..413f9d8 100644
--- a/src/Plugin/video_embed_field/Provider/Html5.php
+++ b/src/Plugin/video_embed_field/Provider/Html5.php
@@ -94,7 +94,7 @@ class Html5 extends ProviderPluginBase {
/**
* {@inheritdoc}
*/
- public function downloadThumbnail() {
+ public function downloadThumbnail($force_refresh = false) {
@imcbride
imcbride / samlauth-logging-debug-accounts.patch
Created April 30, 2018 17:35
Patch for drupal/samlauth to add logging for account issues.
diff --git a/src/SamlService.php b/src/SamlService.php
index b068e3d..a542592 100644
--- a/src/SamlService.php
+++ b/src/SamlService.php
@@ -155,6 +155,9 @@ class SamlService {
throw new RuntimeException('Could not authenticate.');
}
+ // Added by Adam Franco 2017-11-02 to help debug authentication and account issues.
+ $this->logger->debug('SAML attributes: @saml', ['@saml' => json_encode($this->getAttributes())]);
<?php
$photo_dir = file_default_scheme() . '://middlebury_profile_sync';
if ($profile->hasPhoto() && file_prepare_directory($photo_dir)) {
$photo = $profile->getPhoto();
$id = $profile->getId();
$destination = $photo_dir . '/' . $id . '.' . pathinfo($photo, PATHINFO_EXTENSION);
$file = system_retrieve_file($photo, $destination, TRUE, FILE_EXISTS_REPLACE);
@imcbride
imcbride / middlebury_profile_sync.install.php
Created July 11, 2017 14:42
middlebury_profile_sync install
<?php
/**
* @file
* Contains install, uninstall and update functions for Middlebury Profile Sync.
*/
/**
* Implements hook_install().
*/
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.DirectoryServices;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Script.Services;