conkal/owncloud-provisioning-api

owncloud provisioning api wrapper

v1.0.4 2023-12-28 09:52 UTC

This package is auto-updated.

Last update: 2024-05-28 10:38:35 UTC


README

This is a PHP library for interacting with the OwnCloud Provisioning API. It provides a simple and convenient way to manage users and groups within an OwnCloud instance.

Installation

To install the wrapper, you can use composer by running the following command in your project directory:

composer require conkal/owncloud-provisioning-api

Usage

To use the wrapper, you first need to include the autoload file from composer:

require 'vendor/autoload.php';

Then you can create a new instance of the wrapper:

use Conkal\OwncloudProvisioningApi\Owncloud;

$owncloud = new Owncloud('http://example.com/ocs/v1.php/cloud', 'admin', 'secret');

Once you have an Owncloud instance, you can use it to manage users and groups.

Listing Users

$users = $owncloud->users()->get();

Creating a User

$owncloud->users()->create([
'userid' => 'Frank',
'password' => 'secret',
'email' => 'frank@example.org',
]);

Finding a User

$user = $owncloud->users()->find('user-id');

Update a User

$owncloud->users()->update('user-id', 'email', 'new-email@example.com');

Disable a User

$owncloud->users()->disable('user-id');

Enable a User

$owncloud->users()->enable('user-id');

Add a User to a Group

$owncloud->users()->addToGroup('user-id', 'group-name');

Remove a User from a Group

$owncloud->users()->removeFromGroup('user-id', 'group-name');

Create a Group

$owncloud->groups()->create('group-name');

List Group

$group = $owncloud->groups()->get();

For more information on the available methods, please refer to the code.