Skip to content

Commit

Permalink
Merged in PG-344-CiviCRM-Security-Update-4.6.21 (pull request civicrm#10
Browse files Browse the repository at this point in the history
)

PG-344: CiviCRM-4.6.21 update
  • Loading branch information
vincent1892 committed Nov 1, 2016
2 parents 26ee342 + 9cc61ba commit 5cefa35
Show file tree
Hide file tree
Showing 432 changed files with 6,481 additions and 50,480 deletions.
12 changes: 3 additions & 9 deletions sites/all/modules/civicrm/CRM/ACL/BAO/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,20 +147,14 @@ public static function resetCache() {
// reset any static caching
self::$_cache = NULL;

// reset any db caching
$config = CRM_Core_Config::singleton();
$smartGroupCacheTimeout = CRM_Contact_BAO_GroupContactCache::smartGroupCacheTimeout();

//make sure to give original timezone settings again.
$now = CRM_Utils_Date::getUTCTime();

$query = "
DELETE
FROM civicrm_acl_cache
WHERE modified_date IS NULL
OR (TIMESTAMPDIFF(MINUTE, modified_date, $now) >= $smartGroupCacheTimeout)
OR (modified_date <= %1)
";
CRM_Core_DAO::singleValueQuery($query);
$params = array(1 => array(CRM_Contact_BAO_GroupContactCache::getCacheInvalidDateTime(), 'String'));
CRM_Core_DAO::singleValueQuery($query, $params);

// CRM_Core_DAO::singleValueQuery("TRUNCATE TABLE civicrm_acl_contact_cache"); // No, force-commits transaction
// CRM_Core_DAO::singleValueQuery("DELETE FROM civicrm_acl_contact_cache"); // Transaction-safe
Expand Down
27 changes: 9 additions & 18 deletions sites/all/modules/civicrm/CRM/ACL/DAO/ACL.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
*/
require_once 'CRM/Core/DAO.php';
require_once 'CRM/Utils/Type.php';
class CRM_ACL_DAO_ACL extends CRM_Core_DAO
{
class CRM_ACL_DAO_ACL extends CRM_Core_DAO {
/**
* static instance to hold the table name
*
Expand Down Expand Up @@ -151,8 +150,7 @@ class CRM_ACL_DAO_ACL extends CRM_Core_DAO
*
* @return civicrm_acl
*/
function __construct()
{
function __construct() {
$this->__table = 'civicrm_acl';
parent::__construct();
}
Expand All @@ -162,8 +160,7 @@ function __construct()
* @return array
* [CRM_Core_Reference_Interface]
*/
static function getReferenceColumns()
{
static function getReferenceColumns() {
if (!self::$_links) {
self::$_links = static ::createReferenceColumns(__CLASS__);
self::$_links[] = new CRM_Core_Reference_Dynamic(self::getTableName() , 'entity_id', NULL, 'id', 'entity_table');
Expand All @@ -175,8 +172,7 @@ static function getReferenceColumns()
*
* @return array
*/
static function &fields()
{
static function &fields() {
if (!(self::$_fields)) {
self::$_fields = array(
'id' => array(
Expand Down Expand Up @@ -284,8 +280,7 @@ static function &fields()
*
* @return array
*/
static function &fieldKeys()
{
static function &fieldKeys() {
if (!(self::$_fieldKeys)) {
self::$_fieldKeys = array(
'id' => 'id',
Expand All @@ -308,17 +303,15 @@ static function &fieldKeys()
*
* @return string
*/
static function getTableName()
{
static function getTableName() {
return self::$_tableName;
}
/**
* Returns if this table needs to be logged
*
* @return boolean
*/
function getLog()
{
function getLog() {
return self::$_log;
}
/**
Expand All @@ -328,8 +321,7 @@ function getLog()
*
* @return array
*/
static function &import($prefix = false)
{
static function &import($prefix = false) {
if (!(self::$_import)) {
self::$_import = array();
$fields = self::fields();
Expand All @@ -352,8 +344,7 @@ static function &import($prefix = false)
*
* @return array
*/
static function &export($prefix = false)
{
static function &export($prefix = false) {
if (!(self::$_export)) {
self::$_export = array();
$fields = self::fields();
Expand Down
34 changes: 13 additions & 21 deletions sites/all/modules/civicrm/CRM/ACL/DAO/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
*/
require_once 'CRM/Core/DAO.php';
require_once 'CRM/Utils/Type.php';
class CRM_ACL_DAO_Cache extends CRM_Core_DAO
{
class CRM_ACL_DAO_Cache extends CRM_Core_DAO {
/**
* static instance to hold the table name
*
Expand Down Expand Up @@ -101,16 +100,15 @@ class CRM_ACL_DAO_Cache extends CRM_Core_DAO
/**
* When was this cache entry last modified
*
* @var date
* @var timestamp
*/
public $modified_date;
/**
* class constructor
*
* @return civicrm_acl_cache
*/
function __construct()
{
function __construct() {
$this->__table = 'civicrm_acl_cache';
parent::__construct();
}
Expand All @@ -120,8 +118,7 @@ function __construct()
* @return array
* [CRM_Core_Reference_Interface]
*/
static function getReferenceColumns()
{
static function getReferenceColumns() {
if (!self::$_links) {
self::$_links = static ::createReferenceColumns(__CLASS__);
self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id');
Expand All @@ -134,8 +131,7 @@ static function getReferenceColumns()
*
* @return array
*/
static function &fields()
{
static function &fields() {
if (!(self::$_fields)) {
self::$_fields = array(
'id' => array(
Expand All @@ -159,9 +155,10 @@ static function &fields()
) ,
'modified_date' => array(
'name' => 'modified_date',
'type' => CRM_Utils_Type::T_DATE,
'title' => ts('Modified Date') ,
'type' => CRM_Utils_Type::T_TIMESTAMP,
'title' => ts('Cache Modified Date') ,
'description' => 'When was this cache entry last modified',
'required' => false,
) ,
);
}
Expand All @@ -173,8 +170,7 @@ static function &fields()
*
* @return array
*/
static function &fieldKeys()
{
static function &fieldKeys() {
if (!(self::$_fieldKeys)) {
self::$_fieldKeys = array(
'id' => 'id',
Expand All @@ -190,17 +186,15 @@ static function &fieldKeys()
*
* @return string
*/
static function getTableName()
{
static function getTableName() {
return self::$_tableName;
}
/**
* Returns if this table needs to be logged
*
* @return boolean
*/
function getLog()
{
function getLog() {
return self::$_log;
}
/**
Expand All @@ -210,8 +204,7 @@ function getLog()
*
* @return array
*/
static function &import($prefix = false)
{
static function &import($prefix = false) {
if (!(self::$_import)) {
self::$_import = array();
$fields = self::fields();
Expand All @@ -234,8 +227,7 @@ static function &import($prefix = false)
*
* @return array
*/
static function &export($prefix = false)
{
static function &export($prefix = false) {
if (!(self::$_export)) {
self::$_export = array();
$fields = self::fields();
Expand Down
27 changes: 9 additions & 18 deletions sites/all/modules/civicrm/CRM/ACL/DAO/EntityRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
*/
require_once 'CRM/Core/DAO.php';
require_once 'CRM/Utils/Type.php';
class CRM_ACL_DAO_EntityRole extends CRM_Core_DAO
{
class CRM_ACL_DAO_EntityRole extends CRM_Core_DAO {
/**
* static instance to hold the table name
*
Expand Down Expand Up @@ -115,8 +114,7 @@ class CRM_ACL_DAO_EntityRole extends CRM_Core_DAO
*
* @return civicrm_acl_entity_role
*/
function __construct()
{
function __construct() {
$this->__table = 'civicrm_acl_entity_role';
parent::__construct();
}
Expand All @@ -126,8 +124,7 @@ function __construct()
* @return array
* [CRM_Core_Reference_Interface]
*/
static function getReferenceColumns()
{
static function getReferenceColumns() {
if (!self::$_links) {
self::$_links = static ::createReferenceColumns(__CLASS__);
self::$_links[] = new CRM_Core_Reference_Dynamic(self::getTableName() , 'entity_id', NULL, 'id', 'entity_table');
Expand All @@ -139,8 +136,7 @@ static function getReferenceColumns()
*
* @return array
*/
static function &fields()
{
static function &fields() {
if (!(self::$_fields)) {
self::$_fields = array(
'id' => array(
Expand Down Expand Up @@ -189,8 +185,7 @@ static function &fields()
*
* @return array
*/
static function &fieldKeys()
{
static function &fieldKeys() {
if (!(self::$_fieldKeys)) {
self::$_fieldKeys = array(
'id' => 'id',
Expand All @@ -207,17 +202,15 @@ static function &fieldKeys()
*
* @return string
*/
static function getTableName()
{
static function getTableName() {
return self::$_tableName;
}
/**
* Returns if this table needs to be logged
*
* @return boolean
*/
function getLog()
{
function getLog() {
return self::$_log;
}
/**
Expand All @@ -227,8 +220,7 @@ function getLog()
*
* @return array
*/
static function &import($prefix = false)
{
static function &import($prefix = false) {
if (!(self::$_import)) {
self::$_import = array();
$fields = self::fields();
Expand All @@ -251,8 +243,7 @@ static function &import($prefix = false)
*
* @return array
*/
static function &export($prefix = false)
{
static function &export($prefix = false) {
if (!(self::$_export)) {
self::$_export = array();
$fields = self::fields();
Expand Down
Loading

0 comments on commit 5cefa35

Please sign in to comment.