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

edit_collection_external_access()

Parameters

ColumnTypeDefaultDescription
$key
$access -1
$expires ""
$group ""
$sharepwd ""

Location

include/collections_functions.php lines 2883 to 2892

Definition

 
function edit_collection_external_access($key,$access=-1,$expires="",$group="",$sharepwd="")
    {
    global 
$userref,$usergroup$scramble_key;
    if (
$group=="" || !checkperm("x")) {$group=$usergroup;} # Default to sharing with the permission of the current usergroup if not specified OR no access to alternative group selection.
    
if ($key==""){return false;}
    
# Update the expiration and acccess
    
sql_query("update external_access_keys set access='$access', expires=" . (($expires=="")?"null":"'" escape_check($expires) . "'") . ",date=now(),usergroup='$group'" . (($sharepwd != "(unchanged)") ? ", password_hash='" . (($sharepwd == "") ? "" hash('sha256'$key $sharepwd $scramble_key)) . "'" "") . " where access_key='$key'");
    
hook("edit_collection_external_access","",array($key,$access,$expires,$group,$sharepwd));
    return 
true;
    }

This article was last updated 24th November 2020 16:35 Europe/London time based on the source file dated 23rd November 2020 16:00 Europe/London time.