Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

delete_collection_access_key()

Description

Delete a specific collection access key, withdrawing access via that key to the collection in question

Parameters

ColumnTypeDefaultDescription
$collection integer
$access_key string

Return

void

Location

include/collections_functions.php lines 2733 to 2746

Definition

 
function delete_collection_access_key($collection,$access_key)
    {
    
# Get details for log
    
$users sql_value("SELECT group_concat(DISTINCT email ORDER BY email SEPARATOR ', ') value FROM external_access_keys WHERE collection='" escape_check($collection) . "' AND access_key = '" escape_check($access_key) . "' group by access_key """);
    
# Deletes the given access key.
    
$sql "DELETE FROM external_access_keys WHERE access_key='" escape_check($access_key) . "'";
    if(
$collection != 0)
        {
        
$sql .= " AND collection='" escape_check($collection) . "'";
        }
    
sql_query($sql);
    
# log changes
    
collection_log($collection,LOG_CODE_COLLECTION_STOPPED_RESOURCE_ACCESS,"",$users " (" $access_key")");
    }

This article was last updated 27th February 2021 22:05 Europe/London time based on the source file dated 26th February 2021 11:40 Europe/London time.