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

edit_resource_external_access()

Parameters

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

Location

include/resource_functions.php lines 4938 to 4947

Definition

 
function edit_resource_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":"'" $expires "'") . ",date=now(),usergroup='$group'" . (($sharepwd != "(unchanged)") ? ", password_hash='" . (($sharepwd == "") ? "" hash('sha256'$key $sharepwd $scramble_key)) . "'" "") . " where access_key='$key'");
    
hook('edit_resource_external_access','',array($key,$access,$expires,$group));
    return 
true;
    }

This article was last updated 30th November 2020 10:35 Europe/London time based on the source file dated 27th November 2020 14:50 Europe/London time.