Version 4.5.0
This commit is contained in:
1 parent
1a0c7fd3c2
commit
f79dcf067a
3791 files changed
+248032
-76372
No files matched your search
@@ -12,7 +12,7 @@
|
||||
namespace IPS\nexus\Fraud;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
@@ -94,7 +94,7 @@ class _Rule extends \IPS\Node\Model
|
||||
/* Preceeding rules */
|
||||
foreach ( new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'nexus_fraud_rules', array( 'f_order<?', $this->order ), 'f_order' ), 'IPS\nexus\Fraud\Rule' ) as $otherRule )
|
||||
{
|
||||
if ( !count( $conditions ) )
|
||||
if ( !\count( $conditions ) )
|
||||
{
|
||||
$conditions[] = \IPS\Member::loggedIn()->language()->addToStack('f_has_preceeding');
|
||||
}
|
||||
@@ -463,7 +463,7 @@ class _Rule extends \IPS\Node\Model
|
||||
$customFieldValues = $this->custom_fields ? json_decode( $this->custom_fields, TRUE ) : array();
|
||||
$memberFields = \IPS\core\ProfileFields\Field::roots( NULL, NULL, "pf_type NOT IN('Address','Date','Member','Poll','Upload')" );
|
||||
$customerFields = \IPS\nexus\Customer\CustomField::roots( NULL, NULL, "f_type NOT IN('Address','Date','Member','Poll','Upload')" );
|
||||
if ( count( $memberFields ) or count( $customerFields ) )
|
||||
if ( \count( $memberFields ) or \count( $customerFields ) )
|
||||
{
|
||||
$form->addHeader( 'fraud_customer_fields' );
|
||||
foreach ( $memberFields as $field )
|
||||
@@ -521,7 +521,7 @@ class _Rule extends \IPS\Node\Model
|
||||
case 'CheckboxSet':
|
||||
case 'Radio':
|
||||
case 'Select':
|
||||
$formField = new \IPS\Helpers\Form\Select( $name, ( is_array( $value ) and $value ) ? $value : '*', FALSE, array( 'options' => json_decode( $field->content, TRUE ), 'multiple' => TRUE, 'class' => 'ipsField_long', 'unlimited' => '*', 'unlimitedLang' => 'any', 'returnLabels' => TRUE ) );
|
||||
$formField = new \IPS\Helpers\Form\Select( $name, ( \is_array( $value ) and $value ) ? $value : '*', FALSE, array( 'options' => json_decode( $field->content, TRUE ), 'multiple' => TRUE, 'class' => 'ipsField_long', 'unlimited' => '*', 'unlimitedLang' => 'any', 'returnLabels' => TRUE ) );
|
||||
break;
|
||||
case 'Codemirror':
|
||||
case 'Color':
|
||||
@@ -563,7 +563,7 @@ class _Rule extends \IPS\Node\Model
|
||||
$field2Key = $field1Key . '_unit';
|
||||
|
||||
$validate = NULL;
|
||||
if ( in_array( $field2Class, array( 'IPS\nexus\Form\Money', 'IPS\Helpers\Form\Number' ) ) )
|
||||
if ( \in_array( $field2Class, array( 'IPS\nexus\Form\Money', 'IPS\Helpers\Form\Number' ) ) )
|
||||
{
|
||||
$options = array(
|
||||
'options' => array(
|
||||
@@ -608,8 +608,8 @@ class _Rule extends \IPS\Node\Model
|
||||
};
|
||||
}
|
||||
|
||||
$field1 = new \IPS\Helpers\Form\Select( $name . '_type', is_array( $valueOverride ) ? $valueOverride[0] : $this->$field1Key, FALSE, $options, NULL, NULL, NULL );
|
||||
$field2 = new $field2Class( $field1Key . '_unit', is_array( $valueOverride ) ? $valueOverride[1] : $this->$field2Key, FALSE, $_options, $validate, NULL, $field2Suffix );
|
||||
$field1 = new \IPS\Helpers\Form\Select( $name . '_type', \is_array( $valueOverride ) ? $valueOverride[0] : $this->$field1Key, FALSE, $options, NULL, NULL, NULL );
|
||||
$field2 = new $field2Class( $field1Key . '_unit', \is_array( $valueOverride ) ? $valueOverride[1] : $this->$field2Key, FALSE, $_options, $validate, NULL, $field2Suffix );
|
||||
|
||||
return new \IPS\Helpers\Form\Custom( $name, array( $this->$field1Key, $this->$field2Key ), FALSE, array(
|
||||
'getHtml' => function() use ( $name, $field1, $field2 )
|
||||
@@ -649,7 +649,7 @@ class _Rule extends \IPS\Node\Model
|
||||
{
|
||||
if( isset( $values[ $k ] ) )
|
||||
{
|
||||
$values[ $k ] = is_array( $values[ $k ] ) ? implode(',', array_keys( $values[ $k ] ) ) : '*';
|
||||
$values[ $k ] = \is_array( $values[ $k ] ) ? implode(',', array_keys( $values[ $k ] ) ) : '*';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -657,7 +657,7 @@ class _Rule extends \IPS\Node\Model
|
||||
{
|
||||
if( isset( $values[ $k ] ) )
|
||||
{
|
||||
$values[ $k ] = is_array( $values[ $k ] ) ? implode(',', $values[ $k ] ) : '*';
|
||||
$values[ $k ] = \is_array( $values[ $k ] ) ? implode(',', $values[ $k ] ) : '*';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -711,7 +711,7 @@ class _Rule extends \IPS\Node\Model
|
||||
/* Methods */
|
||||
if ( $this->methods != '*' )
|
||||
{
|
||||
if ( !in_array( $transaction->method->id, explode(',', $this->methods ) ) )
|
||||
if ( !\in_array( $transaction->method->id, explode(',', $this->methods ) ) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -723,7 +723,7 @@ class _Rule extends \IPS\Node\Model
|
||||
$match = FALSE;
|
||||
foreach ( $transaction->invoice->items as $item )
|
||||
{
|
||||
if ( $item instanceof \IPS\nexus\extensions\nexus\Item\Package and in_array( $item->id, explode( ',', $this->products ) ) )
|
||||
if ( $item instanceof \IPS\nexus\extensions\nexus\Item\Package and \in_array( $item->id, explode( ',', $this->products ) ) )
|
||||
{
|
||||
$match = TRUE;
|
||||
break;
|
||||
@@ -762,7 +762,7 @@ class _Rule extends \IPS\Node\Model
|
||||
/* Country */
|
||||
if ( $this->country != '*' and $transaction->invoice->billaddress )
|
||||
{
|
||||
if ( !in_array( $transaction->invoice->billaddress->country, explode(',', $this->country ) ) )
|
||||
if ( !\in_array( $transaction->invoice->billaddress->country, explode(',', $this->country ) ) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -812,7 +812,7 @@ class _Rule extends \IPS\Node\Model
|
||||
$memberValues = array();
|
||||
try
|
||||
{
|
||||
$memberValues = \IPS\Db::i()->select( '*', 'core_pfields_content', array( 'member_id = ?', intval( $transaction->member->member_id ) ) )->first();
|
||||
$memberValues = \IPS\Db::i()->select( '*', 'core_pfields_content', array( 'member_id = ?', \intval( $transaction->member->member_id ) ) )->first();
|
||||
}
|
||||
catch ( \UnderflowException $e ) {}
|
||||
foreach ( \IPS\core\ProfileFields\Field::roots( NULL, NULL ) as $field )
|
||||
@@ -882,7 +882,7 @@ class _Rule extends \IPS\Node\Model
|
||||
{
|
||||
$value = isset( $spent[ $currency ] ) ? $spent[ $currency ] : 0;
|
||||
|
||||
if ( $this->_checkCondition( floatval( $value ), $this->customer_spend, floatval( $requirement ) ) )
|
||||
if ( $this->_checkCondition( \floatval( $value ), $this->customer_spend, \floatval( $requirement ) ) )
|
||||
{
|
||||
$match = TRUE;
|
||||
break;
|
||||
@@ -1033,7 +1033,7 @@ class _Rule extends \IPS\Node\Model
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
return in_array( $memberValue, $valueToCheck );
|
||||
return \in_array( $memberValue, $valueToCheck );
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1333,7 +1333,7 @@ class _Rule extends \IPS\Node\Model
|
||||
}
|
||||
else
|
||||
{
|
||||
$thisValues = is_array( $value1 ) ? $value1 : explode( ',', $value1 );
|
||||
$thisValues = \is_array( $value1 ) ? $value1 : explode( ',', $value1 );
|
||||
}
|
||||
|
||||
if ( !$value2 or $value2 === '*' )
|
||||
@@ -1342,7 +1342,7 @@ class _Rule extends \IPS\Node\Model
|
||||
}
|
||||
else
|
||||
{
|
||||
$otherValues = is_array( $value2 ) ? $value2 : explode( ',', $value2 );
|
||||
$otherValues = \is_array( $value2 ) ? $value2 : explode( ',', $value2 );
|
||||
}
|
||||
|
||||
$diff = array_diff( $thisValues, $otherValues );
|
||||
|
||||
Reference in new issue
Block a user