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\downloads\extensions\core\MemberSync;
|
||||
|
||||
/* 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;
|
||||
@@ -34,7 +34,29 @@ class _Downloads
|
||||
{
|
||||
\IPS\Db::i()->update( 'downloads_downloads', array( 'dmid' => $member->member_id ), array( 'dmid=?', $member2->member_id ) );
|
||||
\IPS\Db::i()->update( 'downloads_files', array( 'file_approver' => $member->member_id ), array( 'file_approver=?', $member2->member_id ) );
|
||||
\IPS\Db::i()->update( 'downloads_files_notify', array( 'notify_member_id' => $member->member_id ), array( 'notify_member_id=?', $member2->member_id ) );
|
||||
\IPS\Db::i()->delete( 'downloads_sessions', array( 'dsess_mid=?', $member2->member_id ) );
|
||||
|
||||
/* Clean up duplicate notify rows */
|
||||
$unique = array();
|
||||
$duplicate = array();
|
||||
|
||||
foreach( \IPS\Db::i()->select( 'downloads_files_notify.*, downloads_files.file_submitter', 'downloads_files_notify', array( 'notify_member_id=?', $member->member_id ) )->join( 'downloads_files', "downloads_files_notify.notify_file_id=downloads_files.file_id" ) as $notify )
|
||||
{
|
||||
if( !\in_array( $notify['notify_file_id'], $unique ) and $notify['notify_member_id'] !== $notify['file_submitter'] )
|
||||
{
|
||||
$unique[] = $notify['notify_file_id'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$duplicate[] = $notify['notify_id'];
|
||||
}
|
||||
}
|
||||
|
||||
if( \count( $duplicate ) )
|
||||
{
|
||||
\IPS\Db::i()->delete( 'downloads_files_notify', array( "notify_id IN('" . implode( "','", $duplicate ) . "')" ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,5 +70,6 @@ class _Downloads
|
||||
\IPS\Db::i()->delete( 'downloads_downloads', array( 'dmid=?', $member->member_id ) );
|
||||
\IPS\Db::i()->delete( 'downloads_sessions', array( 'dsess_mid=?', $member->member_id ) );
|
||||
\IPS\Db::i()->update( 'downloads_files', array( 'file_approver' => 0 ), array( 'file_approver=?', $member->member_id ) );
|
||||
\IPS\Db::i()->delete( 'downloads_files_notify', array( 'notify_member_id=?', $member->member_id ) );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user