This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\middlebury_course_hub\Plugin\Group\RelationHandler; | |
use Drupal\Core\Access\AccessResult; | |
use Drupal\Core\Entity\EntityInterface; | |
use Drupal\Core\Session\AccountInterface; | |
use Drupal\group\Plugin\Group\RelationHandler\AccessControlTrait; | |
use Drupal\group\Plugin\Group\RelationHandler\AccessControlInterface; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
$file = $argv[1]; | |
if (!preg_match('#\.html$#', $file)) { | |
throw new Exception("$file must be a .html file."); | |
} | |
if (preg_match('#(.+)sites.middlebury.edu/middmag-old/(.+)#', $file, $pathMatches)) { | |
$directory = dirname($pathMatches[2]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.mapboxgl-map,.maplibregl-map{-webkit-tap-highlight-color:rgba(0,0,0,0);font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative}.mapboxgl-canvas,.maplibregl-canvas{left:0;position:absolute;top:0}.mapboxgl-map:-webkit-full-screen,.maplibregl-map:-webkit-full-screen{height:100%;width:100%}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass,.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer,.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active,.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this function gets executed | |
// if the CAS username doesn't match a username in WordPress | |
function wpcas_nowpuser( $user_name ) { | |
midd_wpcas_nowpuser($user_name); | |
// Authenticate again now that the user exists | |
$wpCAS = new wpCAS; | |
$wpCAS->authenticate(); | |
} | |
function midd_wpcas_nowpuser($username) { | |
require_once( ABSPATH . WPINC . '/registration.php' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: DynamicAddUsers | |
Plugin URI: | |
Description: Replaces the 'Add User' screen with a dynamic search for users and groups | |
Author: Adam Franco | |
Author URI: http://www.adamfranco.com/ | |
*/ | |
global $dynaddusers_db_version; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$nids = \Drupal::entityQuery('node')->condition('type', 'event')->condition('status', 0)->execute(); | |
$nodes = entity_load_multiple('node', $nids); | |
foreach ($nodes as $entity) { | |
$entity->set('moderation_state', 'published'); | |
if ($entity instanceof RevisionLogInterface) { | |
$entity->setRevisionLogMessage('Programatically updating workflow state.'); | |
$entity->setRevisionUserId(\Drupal::currentUser()->id()); | |
} | |
$entity->save(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$query = \Drupal::entityQuery('node'); | |
$query->condition('type', 'story'); | |
$nids = $query->execute(); | |
echo "Updating " . count($nids) . " stories:\n"; | |
$nodes = node_load_multiple($nids); | |
foreach ($nodes as $node) { | |
$node->field_aggregate = TRUE; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lstat("/home/afranco/directory", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0 | |
lstat("/home/afranco/directory/.git", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0 | |
lstat("/home/afranco/directory/.git/index", {st_mode=S_IFREG|0664, st_size=346, ...}) = 0 | |
lstat("/home/afranco/directory", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0 | |
lstat("/home/afranco/directory/.git", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0 | |
open("directory/.git", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 36 | |
lstat("directory/.git/index", {st_mode=S_IFREG|0664, st_size=346, ...}) = 0 | |
lstat("/home/afranco/directory", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0 | |
lstat("/home/afranco/directory/.git", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0 | |
lstat("/home/afranco/directory/.git/index", {st_mode=S_IFREG|0664, st_size=346, ...}) = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<!-- LDAP Authentication Configuration --> | |
<bean id="ldapAuthenticationHandler" | |
class="org.jasig.cas.authentication.LdapAuthenticationHandler" | |
p:principalIdAttribute="middleburyCollegeUID" | |
c:authenticator-ref="authenticator"> | |
<property name="principalAttributeMap"> | |
<map> | |
<!--| This map provides a simple attribute resolution mechanism. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Licensed to Jasig under one or more contributor license | |
* agreements. See the NOTICE file distributed with this work | |
* for additional information regarding copyright ownership. | |
* Jasig licenses this file to you under the Apache License, | |
* Version 2.0 (the "License"); you may not use this file | |
* except in compliance with the License. You may obtain a | |
* copy of the License at: | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 |
NewerOlder