Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource 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 3526 to 3538

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 19th March 2024 05:05 Europe/London time based on the source file dated 15th March 2024 17:00 Europe/London time.