This file contains 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 | |
/** | |
* references: | |
* http://www.murraypicton.com/2010/09/extending-objects-using-anonymous-functions-in-php/ | |
* http://php.net/manual/en/functions.anonymous.php | |
* http://php.net/manual/en/function.is-callable.php | |
*/ | |
class Foo { | |
public $bar; |
This file contains 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
/* ========================================================= | |
* bootstrap-modal.js v3.0.0 | |
* http://twitter.github.com/bootstrap/javascript.html#modals | |
* ========================================================= | |
* Copyright 2012 Twitter, Inc. | |
* | |
* Licensed 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 | |
* |
This file contains 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
# mysqlbup.cron by josephdpurcell | |
# | |
# This cron will export all databases every day at 4am. Those exports are | |
# automatically rotating from servername.com.day0 to servername.com.day6 so you | |
# always have a bup of the last 7 days of backups. | |
# | |
# Also, this cron will export all databases every week for the last 4 weeks at | |
# 2am on Sunday. Those exports are automatically rotating from | |
# servername.com.week0 to servername.com.week3 so you always have a bup of the | |
# last 4 weeks of backups. |
This file contains 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
#!/bin/bash | |
# This is my script for setting up firewall rules. It's a work in progress and | |
# I'm not 100% convinced this is the best setup for me. But, it's a start. | |
# Also, many thanks to Digital Ocean from which I drew a few hints: | |
# https://www.digitalocean.com/community/articles/how-to-setup-a-basic-ip-tables-configuration-on-centos-6 | |
# | |
# I don't like the idea of anything on the machine being able to use a port | |
# that isn't an application port I explicitly allow. For example, I know that I | |
# only want mail, DNS, HTTP(S), and SSH. But, alas! I had to allow ports | |
# sourced from the machine (see b) and default output policy to accept (see i) |
This file contains 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
#!/bin/sh | |
# | |
# An example hook script to prepare the commit log message. | |
# Called by "git commit" with the name of the file that has the | |
# commit message, followed by the description of the commit | |
# message's source. The hook's purpose is to edit the commit | |
# message file. If the hook fails with a non-zero status, | |
# the commit is aborted. | |
# | |
# To enable this hook, rename this file to "prepare-commit-msg" and |
This file contains 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
diff --git a/src/Authentication/AuthenticationManager.php b/src/Authentication/AuthenticationManager.php | |
index 460815c..2f0e059 100644 | |
--- a/src/Authentication/AuthenticationManager.php | |
+++ b/src/Authentication/AuthenticationManager.php | |
@@ -96,13 +96,13 @@ class AuthenticationManager implements AuthenticationManagerInterface { | |
$account = NULL; | |
foreach ($this->plugins as $provider) { | |
/* @var \Drupal\restful\Plugin\authentication\AuthenticationInterface $provider */ | |
- if ($provider->applies($request) && $account = $provider->authenticate($request)) { | |
+ if ($provider->applies($request) && ($account = $provider->authenticate($request)) && $account->uid) { |
This file contains 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
diff --git a/modules/restful_token_auth/src/Plugin/authentication/TokenAuthentication.php b/modules/restful_token_auth/src/Plugin/authentication/TokenAuthentication.php | |
index 331281a..9d33d7a 100644 | |
--- a/modules/restful_token_auth/src/Plugin/authentication/TokenAuthentication.php | |
+++ b/modules/restful_token_auth/src/Plugin/authentication/TokenAuthentication.php | |
@@ -93,7 +93,7 @@ class TokenAuthentication extends Authentication { | |
// If we don't have a $key_name on either the URL or the in the headers, | |
// then check again using a hyphen instead of an underscore. This is due to | |
// new versions of Apache not accepting headers with underscores. | |
- if (empty($input[$key_name]) && $request->getHeaders()->get($key_name)->getValueString()) { | |
+ if (!$input[$key_name] && !$request->getHeaders()->get($key_name)->getValueString()) { |
This file contains 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
<?xml version="1.0"?> | |
<ruleset | |
name="PMD Ruleset for Drupal" | |
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd" | |
> | |
<rule ref="rulesets/unusedcode.xml" /> | |
<rule ref="rulesets/codesize.xml"> | |
<exclude name="ExcessiveMethodLength" /> |
OlderNewer