Version 4.6.0

This commit is contained in:
Neo committed 2025-12-19 05:55:31 -08:00
1 parent f79dcf067a
commit 517a5e1f70
2036 files changed
+110041 -26162

No files matched your search

+5 -5
View File
@@ -54,8 +54,8 @@ class _files extends \IPS\Content\Api\ItemController
/* Sort by popular files */
if( \IPS\Request::i()->sortBy == 'popular' )
{
\IPS\Request::i()->sortDir = \IPS\Request::i()->sortDir ?: 'ASC';
$sortBy = 'file_rating ' . \IPS\Request::i()->sortDir . ', file_reviews';
$sortDirection = \strtoupper( \IPS\Request::i()->sortDir ) == 'DESC' ? 'DESC' : 'ASC';
$sortBy = 'file_rating ' . $sortDirection . ', file_reviews';
$where = array( array( 'file_rating>?', 0 ) );
}
@@ -111,7 +111,7 @@ class _files extends \IPS\Content\Api\ItemController
* Upload a file
*
* @note For requests using an OAuth Access Token for a particular member, any parameters the user doesn't have permission to use are ignored (for example, locked will only be honoured if the authenticated user has permission to lock files).
* @reqapiparam int category The ID number of the calendar the file should be created in
* @reqapiparam int category The ID number of the category the file should be created in
* @reqapiparam int author The ID number of the member creating the file (0 for guest). Required for requests made using an API Key or the Client Credentials Grant Type. For requests using an OAuth Access Token for a particular member, that member will always be the author
* @reqapiparam string title The file name
* @reqapiparam string description The description as HTML (e.g. "<p>This is an file.</p>"). Will be sanatized for requests using an OAuth Access Token for a particular member; will be saved unaltered for requests made using an API Key or the Client Credentials Grant Type.
@@ -311,7 +311,7 @@ class _files extends \IPS\Content\Api\ItemController
* Edit a file
*
* @note For requests using an OAuth Access Token for a particular member, any parameters the user doesn't have permission to use are ignored (for example, locked will only be honoured if the authenticated user has permission to lock records).
* @apiparam int category The ID number of the calendar the file should be created in
* @apiparam int category The ID number of the category the file should be created in
* @apiparam int author The ID number of the member creating the file (0 for guest). Ignored for requests using an OAuth Access Token for a particular member.
* @apiparam string title The file name
* @apiparam string description The description as HTML (e.g. "<p>This is an file.</p>"). Will be sanatized for requests using an OAuth Access Token for a particular member; will be saved unaltered for requests made using an API Key or the Client Credentials Grant Type.
@@ -657,7 +657,7 @@ class _files extends \IPS\Content\Api\ItemController
{
throw new \OutOfRangeException;
}
if ( $this->member and !$file->canEdit( $this->member ) )
if ( $this->member and ( !$file->canEdit( $this->member ) or !$file->container()->can( 'add', $this->member ) ) )
{
throw new \IPS\Api\Exception( 'NO_PERMISSION', '2S303/O', 403 );
}