Skip to content

Instantly share code, notes, and snippets.

View gist:d30c59ab835c81b2a22cd77ace364b2c
<?php # local settings.php
$request_type = ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') ? 'SSL' : 'NONSSL';
if ($request_type != "SSL" && isset($_SERVER['HTTP_USER_AGENT']) && !preg_match('<ignore_url>',$_SERVER['REQUEST_URI'])){
header('X-Accel-Expires: 1');
header("HTTP/1.1 301 Moved Permanently");
header("Location: https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
header("Connection: close");
exit;
}
View gist:45cc7aea817c046925ac7146d8fd3d77
Aegir on Debian/jessie x86_64
VPS Linux KVM guest
CPU 6
RAM 12012
XTR _XTRAS_LIST="ADM CSF FTP CGP SR4 CSS"
MFX _MODULES_FIX=YES
PFX _PERMISSIONS_FIX=NO
DBS _DB_SERIES=10.1
DNS _DNS_SETUP_TEST=YES
PKG _EXTRA_PACKAGES=
View gist:02a73d8767eaec73484a5def5fe5a72b
Aegir on Debian/jessie x86_64
VPS unknown / not a virtual machine
CPU 8
RAM 15771
XTR _XTRAS_LIST="ADM CSF FTP"
MFX _MODULES_FIX=YES
PFX _PERMISSIONS_FIX=YES
DBS _DB_SERIES=10.1
DNS _DNS_SETUP_TEST=YES
PKG _EXTRA_PACKAGES=
View gist:b3c9dfb5abf091c65491e4e6283192e6
root@server-dev:~# cat /var/aegir/install.log
'drush' cache was cleared. [success]
Aegir HEAD automated install script
==============================================================================
Some settings have not been provided and will now be prompted.
Don't worry: you will get to review those settings after the final install
This script will operate the following changes in your system:
1. Create server-level configuration directories
@sluc23
sluc23 / gist:cb491aff6fdb3eee224045ead30e40f9
Created Feb 22, 2018
CiviCRM 4.7 patch to avoid BOA perms issue
View gist:cb491aff6fdb3eee224045ead30e40f9
--- CRM/Extension/ClassLoader.php.bkp 2018-02-07 04:59:01.000000000 +0100
+++ CRM/Extension/ClassLoader.php 2018-02-22 15:30:16.242395374 +0100
@@ -82,7 +82,7 @@
}
$file = $this->getCacheFile();
- if (file_exists($file)) {
+ if (file_exists($file) && fileperms($file)) {
$loader = require $file;
}
@sluc23
sluc23 / gist:4188ae5c1432872b34813376ce727f49
Created Apr 23, 2018
CiviCRM patch with is_readable() for BOA perms issue
View gist:4188ae5c1432872b34813376ce727f49
--- civicrm/CRM/Extension/ClassLoader.php.original 2018-04-23 14:12:36.774673526 +0200
+++ civicrm/CRM/Extension/ClassLoader.php 2018-04-23 14:14:05.838673697 +0200
@@ -82,7 +82,7 @@
}
$file = $this->getCacheFile();
- if (file_exists($file)) {
+ if (is_readable($file)) {
$loader = require $file;
}
View gist:1c6f6f1eccddf06316e514d8e83f5344
Searching 5208 files for "CRM.buildCustomData("
/data/work/source/civicrm/civicrm-core/CRM/Activity/Form/Activity.php:
667 array('' => '- ' . ts('select') . ' -') + $this->_fields['followup_activity_type_id']['attributes'],
668 FALSE, array(
669: 'onchange' => "CRM.buildCustomData( 'Activity', this.value );",
670 'class' => 'crm-select2 required',
671 )
/data/work/source/civicrm/civicrm-core/CRM/Campaign/Form/Campaign.php:
@sluc23
sluc23 / gist:a83cb45c05c784747b4d8b0c16a19af7
Created Nov 30, 2018
CiviCRM files using `CRM.buildCustomData()`
View gist:a83cb45c05c784747b4d8b0c16a19af7
./CRM/Member/Form/Membership.php:580: 'onChange' => "buildMaxRelated(this.value,true); CRM.buildCustomData('Membership', this.value);",
./CRM/Member/Form/MembershipRenewal.php:328: $js = array('onChange' => "setPaymentBlock(); CRM.buildCustomData('Membership', this.value);");
./CRM/Contribute/Form/Contribution.php:633: array('onChange' => "CRM.buildCustomData( 'Contribution', this.value );")
./CRM/Campaign/Form/Campaign.php:217: $this->addSelect('campaign_type_id', array('onChange' => "CRM.buildCustomData( 'Campaign', this.value );"), TRUE);
./CRM/Grant/Form/Grant.php:174: $this->addSelect('grant_type_id', array('onChange' => "CRM.buildCustomData( 'Grant', this.value );"), TRUE);
./CRM/Case/Form/Activity/OpenCase.php:161: 'onchange' => "CRM.buildCustomData('Case', this.value);",
./CRM/Activity/Form/Activity.php:669: 'onchange' => "CRM.buildCustomData( 'Activity', this.value );",
./CRM/Event/Form/ManageEvent/EventInfo.php:155: array('onChange' => "CRM.buildCustomData( 'Event
@sluc23
sluc23 / update
Created Feb 1, 2019
Gitlab update hook to rejct tag if extension <version> is different than tag
View update
#!/bin/bash
# Git arguments
refname="$1"
oldrev="$2"
newrev="$3"
log() { printf '%s\n' "$*"; }
error() { log "ERROR: $*" >&2; }
fatal() { error "$*"; exit 1; }
View Query.php.patch
--- CRM/Contact/BAO/Query.php 2018-05-14 17:20:43.662954863 +0200
+++ CRM/Contact/BAO/Query.php 2018-05-14 17:51:30.726875417 +0200
@@ -6054,7 +6054,7 @@
}
}
elseif ($value['pseudoField'] == 'state_province_abbreviation') {
- $dao->$key = CRM_Core_PseudoConstant::stateProvinceAbbreviation($val);
+ $dao->$key = CRM_Core_PseudoConstant::stateProvince($val);
}
// @todo handle this in the section above for pseudoconstants.