Collections functions
Encryption functions
General 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 2368 to 2377

Definition

 
function get_collection_external_access($collection)
    {
    global 
$userref;

    
# Restrict to only their shares unless they have the elevated 'v' permission
    
$condition="";
    if (!
checkperm("v")) {$condition="AND user='" escape_check($userref) . "'";}

    return 
sql_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 from external_access_keys where collection='" escape_check($collection) . "' $condition group by access_key order by date");
    }

This article was last updated 10th July 2020 23:05 Europe/London time based on the source file dated 9th July 2020 17:22 Europe/London time.