Collections functions
General functions
Node functions
Render functions
Theme permission functions
User 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 3547 to 3562

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 19th March 2024 11:05 Europe/London time based on the source file dated 15th March 2024 17:00 Europe/London time.