Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

get_resource_external_access()

Parameters

ColumnTypeDefaultDescription
$resource

Location

include/resource_functions.php lines 6486 to 6504

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 17th September 2024 21:35 Europe/London time based on the source file dated 9th September 2024 13:10 Europe/London time.