Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

get_collection_external_access()

Description

Return all external access given to a collection.
Users, emails and dates could be multiple for a given access key, an in this case they are returned comma-separated.

Parameters

ColumnTypeDefaultDescription
$collection integer

Return

array

Location

include/collections_functions.php lines 3553 to 3565

Definition

 
function get_collection_external_access($collection)
    {
    global 
$userref;

    
# Restrict to only their shares unless they have the elevated 'v' permission
    
$condition="AND upload=0 ";$params=array("i",$collection);
    if (!
checkperm("v"))
        {
        
$condition .= "AND user=?";
        
$params[]="i";$params[]=$userref;
        }
    return 
ps_query("SELECT access_key,GROUP_CONCAT(DISTINCT user ORDER BY user SEPARATOR ', ') users,GROUP_CONCAT(DISTINCT email ORDER BY email SEPARATOR ', ') emails,MAX(date) maxdate,MAX(lastused) lastused,access,expires,usergroup,password_hash,upload from external_access_keys WHERE collection=? $condition group by access_key order by date",$params);
    }

This article was last updated 15th December 2024 17:35 Europe/London time based on the source file dated 12th December 2024 10:55 Europe/London time.