Collections functions
General functions
Render functions
Theme permission functions
Resource functions

get_resource_external_access()

Parameters

ColumnTypeDefaultDescription
$resource

Location

include/resource_functions.php lines 5879 to 5897

Definition

 
function get_resource_external_access($resource)
    {
    
# Return all external access given to a resource
    # Users, emails and dates could be multiple for a given access key, an in this case they are returned comma-separated.
    
global $userref;

    
# Build parameters for the query
    
$params=array("i",$resource);

    
# Restrict to only their shares unless they have the elevated 'v' permission
    
$condition="";
    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,collection,usergroup, password_hash from external_access_keys where resource=? $condition group by access_key,access,expires,collection,usergroup order by maxdate",$params);
    }

This article was last updated 4th October 2022 12:05 Europe/London time based on the source file dated 30th September 2022 14:20 Europe/London time.