Version 4.7.23
This commit is contained in:
1 parent
7124a02564
commit
25ddeb65d6
1791 files changed
+76990
-44452
No files matched your search
@@ -11,6 +11,8 @@
|
||||
|
||||
namespace IPS\nexus\Support;
|
||||
|
||||
use IPS\Member;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
@@ -32,6 +34,13 @@ class _Request extends \IPS\Content\Item implements \IPS\Content\ReadMarkers
|
||||
* @brief Application
|
||||
*/
|
||||
public static $application = 'nexus';
|
||||
|
||||
/**
|
||||
* Should IndexNow be skipped for this item? Can be used to prevent that Private Messages,
|
||||
* Reports and other content which is never going to be visible to guests is triggering the requests.
|
||||
* @var bool
|
||||
*/
|
||||
public static bool $skipIndexNow = TRUE;
|
||||
|
||||
/**
|
||||
* @brief Module
|
||||
@@ -590,7 +599,7 @@ class _Request extends \IPS\Content\Item implements \IPS\Content\ReadMarkers
|
||||
$allowedPackageIds = explode( ',', $department->packages );
|
||||
$allowedSubscriptionIds = explode( ',', $department->subscriptions );
|
||||
$allowedPackages = $department->serializedPackageIds();
|
||||
$departmentToggles[ $department->id ][] = 'support_purchase_' . $allowedPackages;
|
||||
$departmentToggles[ $department->id ][] = 'support_purchase_' . $allowedPackages;
|
||||
if ( !isset( $purchaseFields[ $allowedPackages ] ) )
|
||||
{
|
||||
$field = new \IPS\Helpers\Form\Node(
|
||||
@@ -600,11 +609,12 @@ class _Request extends \IPS\Content\Item implements \IPS\Content\ReadMarkers
|
||||
array(
|
||||
'class' => 'IPS\nexus\Purchase',
|
||||
'where' => $purchaseWhere,
|
||||
'permissionCheck' => function( $node ) use ( $allowedPackageIds, $allowedSubscriptionIds )
|
||||
'permissionCheck' => function( $node ) use ( $allowedPackageIds, $allowedSubscriptionIds, $account )
|
||||
{
|
||||
return (
|
||||
return ((
|
||||
( $node->active and $node->app === 'nexus' and ( $node->type === 'package' and \in_array( $node->item_id, $allowedPackageIds ) ) )
|
||||
or ( $node->active and $node->app === 'nexus' and ( $node->type === 'subscription' and \in_array( $node->item_id, $allowedSubscriptionIds ) ) )
|
||||
) and $node->canView( $account )
|
||||
);
|
||||
},
|
||||
'forceOwner' => FALSE,
|
||||
@@ -1951,6 +1961,28 @@ class _Request extends \IPS\Content\Item implements \IPS\Content\ReadMarkers
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save Changed Columns
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
/* There is a rare case where the request can be generated from a guest transaction
|
||||
after the member account has already been created. In those instances,
|
||||
the member ID does not get properly assigned. */
|
||||
if( $this->email and !$this->member )
|
||||
{
|
||||
$member = Member::load( $this->email, 'email' );
|
||||
if( $member->member_id )
|
||||
{
|
||||
$this->member = $member->member_id;
|
||||
}
|
||||
}
|
||||
|
||||
parent::save();
|
||||
}
|
||||
|
||||
/* !Delete */
|
||||
|
||||
|
||||
Reference in new issue
Block a user