Collections functions
General functions
Render functions
Theme permission 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 3417 to 3432

Definition

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

This article was last updated 4th October 2022 11:35 Europe/London time based on the source file dated 4th October 2022 09:50 Europe/London time.