Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 310 and 402] [Versions 39 and 402]

Manages the creation and usage of access controlled links.

Copyright: 2017 Nina Herrmann (Learnweb, University of Münster)
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 477 lines (20 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: access_controlled_link_manager  - X-Ref

Manages the creation and usage of access controlled links.

__construct($ocsclient, $systemoauthclient, $systemocsclient, $issuer, $repositoryname)   X-Ref
Access_controlled_link_manager constructor.

param: ocs_client $ocsclient
param: \core\oauth2\client $systemoauthclient
param: ocs_client $systemocsclient
param: \core\oauth2\issuer $issuer
param: string $repositoryname

delete_share_dataowner_sysaccount($shareid)   X-Ref
Deletes the share of the systemaccount and a user. In case the share could not be deleted a notification is
displayed.

param: int $shareid Remote ID of the share to be deleted.

create_share_user_sysaccount($path, $username = null, $maywrite = false)   X-Ref
Creates a share between a user and the system account. If $username is set the sharing direction is system account -> user,
otherwise user -> system account.

param: string $path Remote path of the file that will be shared
param: string $username optional when set the file is shared with the corresponding user otherwise with
param: bool $maywrite if false, only(!) read access is granted.
return: array statuscode, shareid, and filetarget

transfer_file_to_path($srcpath, $dstpath, $operation, $webdavclient = null)   X-Ref
No description

create_folder_path_access_controlled_links($context, $component, $filearea, $itemid)   X-Ref
Creates a unique folder path for the access controlled link.

param: context $context
param: string $component
param: string $filearea
param: string $itemid
return: string $result full generated path.

create_system_dav()   X-Ref
No description

create_storage_folder($controlledlinkfoldername, $webdavclient)   X-Ref
No description

get_shares_from_path($path, $username)   X-Ref
No description

get_share_information_from_shareid($shareid, $username)   X-Ref
No description

find_share_in_sysaccount($path)   X-Ref
Find a file that has previously been shared with the system account.

param: string $path Path to file in user context.
return: array shareid: ID of share, filetarget: path to file in sys account.

download_for_offline_usage(string $srcpath, string $targetpath)   X-Ref
Download a file from the system account for the purpose of offline usage.

param: string $srcpath Name of a file owned by the system account
param: string $targetpath Temporary filename in Moodle