Manages the creation and usage of access controlled links.
More...
|
| __construct ($ocsclient, $systemoauthclient, $systemocsclient, $issuer, $repositoryname) |
| Access_controlled_link_manager constructor. More...
|
|
| create_folder_path_access_controlled_links ($context, $component, $filearea, $itemid) |
| Creates a unique folder path for the access controlled link. More...
|
|
| create_share_user_sysaccount ($path, $username=null, $maywrite=false) |
| Creates a share between a user and the system account. More...
|
|
| create_storage_folder ($controlledlinkfoldername, $webdavclient) |
| Creates a folder to store access controlled links. More...
|
|
| create_system_dav () |
| Creates a new webdav_client for the system account. More...
|
|
| delete_share_dataowner_sysaccount ($shareid) |
| Deletes the share of the systemaccount and a user. More...
|
|
| download_for_offline_usage (string $srcpath, string $targetpath) |
| Download a file from the system account for the purpose of offline usage. More...
|
|
| find_share_in_sysaccount ($path) |
| Find a file that has previously been shared with the system account. More...
|
|
| get_share_information_from_shareid ($shareid, $username) |
| This method can only be used if the response is from a newly created share. More...
|
|
| get_shares_from_path ($path, $username) |
| Gets all shares from a path (the path is file specific) and extracts the share of a specific user. More...
|
|
| transfer_file_to_path ($srcpath, $dstpath, $operation, $webdavclient=null) |
| Copy or moves a file to a new path. More...
|
|
|
core oauth2 issuer | $issuer |
| Issuer from the oauthclient.
|
|
ocs_client | $ocsclient |
| OCS client that uses the Open Collaboration Services REST API.
|
|
string | $repositoryname |
| Name of the related repository.
|
|
core oauth2 client | $systemoauthclient |
| Client to manage oauth2 features from the systemaccount.
|
|
ocs_client | $systemocsclient |
| ocsclient of the systemaccount.
|
|
webdav_client | $systemwebdavclient |
| Client to manage webdav request from the systemaccount. More...
|
|
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
◆ __construct()
repository_nextcloud\access_controlled_link_manager::__construct |
( |
|
$ocsclient, |
|
|
|
$systemoauthclient, |
|
|
|
$systemocsclient, |
|
|
|
$issuer, |
|
|
|
$repositoryname |
|
) |
| |
Access_controlled_link_manager constructor.
- Parameters
-
- Exceptions
-
◆ create_folder_path_access_controlled_links()
repository_nextcloud\access_controlled_link_manager::create_folder_path_access_controlled_links |
( |
|
$context, |
|
|
|
$component, |
|
|
|
$filearea, |
|
|
|
$itemid |
|
) |
| |
Creates a unique folder path for the access controlled link.
- Parameters
-
context | $context | |
string | $component | |
string | $filearea | |
string | $itemid | |
- Return values
-
string::$result | full generated path. |
- Exceptions
-
◆ create_share_user_sysaccount()
repository_nextcloud\access_controlled_link_manager::create_share_user_sysaccount |
( |
|
$path, |
|
|
|
$username = null , |
|
|
|
$maywrite = false |
|
) |
| |
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.
- Parameters
-
string | $path | Remote path of the file that will be shared |
string | $username | optional when set the file is shared with the corresponding user otherwise with the systemaccount. |
bool | $maywrite | if false, only(!) read access is granted. |
- Return values
-
array | statuscode, shareid, and filetarget |
- Exceptions
-
◆ create_storage_folder()
repository_nextcloud\access_controlled_link_manager::create_storage_folder |
( |
|
$controlledlinkfoldername, |
|
|
|
$webdavclient |
|
) |
| |
Creates a folder to store access controlled links.
- Parameters
-
- Exceptions
-
◆ create_system_dav()
repository_nextcloud\access_controlled_link_manager::create_system_dav |
( |
| ) |
|
Creates a new webdav_client for the system account.
- Return values
-
- Exceptions
-
◆ delete_share_dataowner_sysaccount()
repository_nextcloud\access_controlled_link_manager::delete_share_dataowner_sysaccount |
( |
|
$shareid | ) |
|
Deletes the share of the systemaccount and a user.
In case the share could not be deleted a notification is displayed.
- Parameters
-
int | $shareid | Remote ID of the share to be deleted. |
◆ download_for_offline_usage()
repository_nextcloud\access_controlled_link_manager::download_for_offline_usage |
( |
string |
$srcpath, |
|
|
string |
$targetpath |
|
) |
| |
Download a file from the system account for the purpose of offline usage.
- Parameters
-
string | $srcpath | Name of a file owned by the system account |
string | $targetpath | Temporary filename in Moodle |
- Exceptions
-
◆ find_share_in_sysaccount()
repository_nextcloud\access_controlled_link_manager::find_share_in_sysaccount |
( |
|
$path | ) |
|
Find a file that has previously been shared with the system account.
- Parameters
-
string | $path | Path to file in user context. |
- Return values
-
array | shareid: ID of share, filetarget: path to file in sys account. |
- Exceptions
-
◆ get_share_information_from_shareid()
repository_nextcloud\access_controlled_link_manager::get_share_information_from_shareid |
( |
|
$shareid, |
|
|
|
$username |
|
) |
| |
◆ get_shares_from_path()
repository_nextcloud\access_controlled_link_manager::get_shares_from_path |
( |
|
$path, |
|
|
|
$username |
|
) |
| |
Gets all shares from a path (the path is file specific) and extracts the share of a specific user.
In case multiple shares exist the first one is taken. Multiple shares can only appear when shares are created outside of this plugin, therefore this case is not handled.
- Parameters
-
string | $path | |
string | $username | |
- Return values
-
- Exceptions
-
◆ transfer_file_to_path()
repository_nextcloud\access_controlled_link_manager::transfer_file_to_path |
( |
|
$srcpath, |
|
|
|
$dstpath, |
|
|
|
$operation, |
|
|
|
$webdavclient = null |
|
) |
| |
Copy or moves a file to a new path.
- Parameters
-
string | $srcpath | source path |
string | $dstpath | |
string | $operation | move or copy |
webdav_client | $webdavclient | needed when moving files. |
- Return values
-
String | Http-status of the request |
- Exceptions
-
◆ $systemwebdavclient
webdav_client repository_nextcloud\access_controlled_link_manager::$systemwebdavclient |
|
protected |
Client to manage webdav request from the systemaccount.
The documentation for this class was generated from the following file: