Version 4.5.0

This commit is contained in:
Neo committed 2025-12-19 05:51:58 -08:00
1 parent 1a0c7fd3c2
commit f79dcf067a
3791 files changed
+248032 -76372

No files matched your search

+8 -6
View File
@@ -12,7 +12,7 @@
namespace IPS\nexus\Support;
/* 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;
@@ -130,7 +130,7 @@ class _Reply extends \IPS\Content\Comment implements \IPS\Content\Hideable
*/
public static function create( $item, $comment, $first=FALSE, $guestName=NULL, $incrementPostCount=NULL, $member=NULL, \IPS\DateTime $time=NULL, $ipAddress=NULL, $hiddenStatus=NULL )
{
$obj = call_user_func_array( 'parent::create', func_get_args() );
$obj = parent::create( $item, $comment, $first, $guestName, $incrementPostCount, $member, $time, $ipAddress, $hiddenStatus );
if ( $obj->type === static::REPLY_MEMBER and $obj->author()->member_id !== $obj->item()->author()->member_id )
{
@@ -296,7 +296,7 @@ class _Reply extends \IPS\Content\Comment implements \IPS\Content\Hideable
$alternativeContactWhere[] = '( r_member=' . $contact->main_id->member_id . ' AND ' . \IPS\Db::i()->in( 'r_purchase', $contact->purchaseIds() ) . ' )';
}
}
if ( count( $alternativeContactWhere ) )
if ( \count( $alternativeContactWhere ) )
{
$extraClause[0] = '( ' . $extraClause[0] . ' OR ( ' . implode( ' OR ', $alternativeContactWhere ) . ' ) )';
}
@@ -365,13 +365,13 @@ class _Reply extends \IPS\Content\Comment implements \IPS\Content\Hideable
foreach ( $staffToSendTo as $staffId )
{
if ( in_array( $staffId, $staffIds ) )
if ( \in_array( $staffId, $staffIds ) )
{
/* The department may only be available to specific members OR groups - we need to load an \IPS\Member object here so that we can check both and send the notification as appropriate. */
$staff = \IPS\Member::load( $staffId );
$departmentStaff = $this->item()->department->staff;
if ( !in_array( $staffId, $sentTo ) and ( $this->item()->department->staff === '*' or count( array_intersect( explode( ',', $departmentStaff ), Department::staffDepartmentPerms( $staff ) ) ) ) )
if ( !\in_array( $staffId, $sentTo ) and ( $this->item()->department->staff === '*' or \count( array_intersect( explode( ',', $departmentStaff ), Department::staffDepartmentPerms( $staff ) ) ) ) )
{
$fromEmail = ( $this->item()->department->email ) ? $this->item()->department->email : \IPS\Settings::i()->email_out;
switch ( \IPS\Settings::i()->nexus_sout_from )
@@ -380,7 +380,7 @@ class _Reply extends \IPS\Content\Comment implements \IPS\Content\Hideable
$fromName = $this->member ? $this->author()->name : $fromEmail;
break;
case 'dpt':
$member = is_int( $this->member ) ? \IPS\Member::load( $this->member ) : $this->member;
$member = \is_int( $this->member ) ? \IPS\Member::load( $this->member ) : $this->member;
$fromName = $this->member
? $member->language()->get( 'nexus_department_' . $this->item()->department->_id )
: \IPS\Lang::load( \IPS\Lang::defaultLanguage() )->get( 'nexus_department_' . $this->item()->department->_id );
@@ -402,6 +402,8 @@ class _Reply extends \IPS\Content\Comment implements \IPS\Content\Hideable
\IPS\Db::i()->delete( 'nexus_support_notify', array( 'staff_id=?', $staffId ) );
}
}
\IPS\core\AdminNotification::send( 'nexus', 'Support', NULL, TRUE, NULL, TRUE );
}
/**