Skip to content

Instantly share code, notes, and snippets.

<?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;
}
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=
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=
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 February 22, 2018 14:52
CiviCRM 4.7 patch to avoid BOA perms issue
--- 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 April 23, 2018 12:15
CiviCRM patch with is_readable() for BOA perms issue
--- 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;
}
@sluc23
sluc23 / gist:1c6f6f1eccddf06316e514d8e83f5344
Created November 29, 2018 15:03
CRM.buildCustomData(
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 November 30, 2018 12:31
CiviCRM files using `CRM.buildCustomData()`
./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 February 1, 2019 11:43
Gitlab update hook to rejct tag if extension <version> is different than tag
#!/bin/bash
# Git arguments
refname="$1"
oldrev="$2"
newrev="$3"
log() { printf '%s\n' "$*"; }
error() { log "ERROR: $*" >&2; }
fatal() { error "$*"; exit 1; }
--- 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.