Version 4.1.19

This commit is contained in:
Neo committed 2025-12-19 05:38:56 -08:00
1 parent 28bd025b35
commit 2bd5025018
2674 files changed
+233518 -77766

No files matched your search

@@ -2,9 +2,9 @@
/**
* @brief My Attachments Controller
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @package IPS Community Suite
* @since 22 Jul 2013
* @version SVN_VERSION_NUMBER
*/
@@ -64,36 +64,6 @@ class _attachments extends \IPS\Dispatcher\Controller
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate('myAttachments')->template( (string) $table, \IPS\Db::i()->select( 'SUM(attach_filesize)', 'core_attachments', array( 'attach_member_id=?', \IPS\Member::loggedIn()->member_id ) )->first(), \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments', array( 'attach_member_id=?', \IPS\Member::loggedIn()->member_id ) )->first() );
}
/**
* Lookup
*
* @return void
*/
public function lookup()
{
/* Load and check permission */
try
{
$attachment = \IPS\Db::i()->select( '*', 'core_attachments', array( 'attach_id=?', \IPS\Request::i()->id ) )->first();
}
catch ( \UnderflowException $e )
{
\IPS\Output::i()->error( 'node_error', '2C229/6', 404, '' );
}
/* Check it belongs to us */
if ( $attachment['attach_member_id'] !== \IPS\Member::loggedIn()->member_id or !\IPS\Member::loggedIn()->group['gbw_delete_attachments'] )
{
\IPS\Output::i()->error( 'no_module_permission', '2C229/7', 403, '' );
}
/* Display */
\IPS\Output::i()->title = $attachment['attach_file'];
\IPS\Output::i()->breadcrumb[] = array( \IPS\Http\Url::internal( 'app=core&module=system&controller=attachments', 'front', 'attachments' ), \IPS\Member::loggedIn()->language()->addToStack('my_attachments') );
\IPS\Output::i()->breadcrumb[] = array( NULL, $attachment['attach_file'] );
\IPS\Output::i()->output = $this->_getLocations( $attachment['attach_id'] );
}
/**
* Delete
*
@@ -103,6 +73,9 @@ class _attachments extends \IPS\Dispatcher\Controller
{
/* Security check */
\IPS\Session::i()->csrfCheck();
/* Make sure the user confirmed the deletion */
\IPS\Request::i()->confirmedDelete();
/* Load and check permission */
try
@@ -152,6 +125,5 @@ class _attachments extends \IPS\Dispatcher\Controller
/* Redirect */
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=system&controller=attachments', 'front', 'attachments' ) );
}
}
}