Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video 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 2710 to 2721

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 ";
    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,upload,status from external_access_keys WHERE collection='" escape_check($collection) . "' $condition group by access_key order by date");
    }

This article was last updated 25th February 2021 16:05 Europe/London time based on the source file dated 24th February 2021 09:50 Europe/London time.