Collections functions
General functions
Render functions
Theme permission 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 3396 to 3408

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 3rd October 2022 12:35 Europe/London time based on the source file dated 22nd September 2022 11:00 Europe/London time.