2012-07-20 10:25:54 -04:00
|
|
|
<?php
|
2024-05-23 03:26:56 -04:00
|
|
|
|
2012-07-20 10:25:54 -04:00
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
2013-11-03 07:51:39 -05:00
|
|
|
*/
|
2013-11-03 07:38:25 -05:00
|
|
|
// use OCP namespace for all classes that are considered public.
|
2024-05-23 03:26:56 -04:00
|
|
|
// This means that they should be used by apps instead of the internal Nextcloud classes
|
2019-11-22 14:52:10 -05:00
|
|
|
|
2012-07-20 10:25:54 -04:00
|
|
|
namespace OCP;
|
|
|
|
|
|
2015-04-16 11:00:08 -04:00
|
|
|
/**
|
2016-01-14 08:34:35 -05:00
|
|
|
* TODO actually this is a IUserBackend
|
2015-04-16 11:00:08 -04:00
|
|
|
*
|
|
|
|
|
* @since 4.5.0
|
|
|
|
|
*/
|
2016-01-14 08:28:03 -05:00
|
|
|
interface UserInterface {
|
|
|
|
|
/**
|
|
|
|
|
* Check if backend implements actions
|
|
|
|
|
* @param int $actions bitwise-or'ed actions
|
|
|
|
|
* @return boolean
|
|
|
|
|
*
|
|
|
|
|
* Returns the supported actions as int to be
|
2017-07-25 02:57:58 -04:00
|
|
|
* compared with \OC\User\Backend::CREATE_USER etc.
|
2016-01-14 08:28:03 -05:00
|
|
|
* @since 4.5.0
|
2018-03-22 04:16:34 -04:00
|
|
|
* @deprecated 14.0.0 Switch to the interfaces from OCP\User\Backend
|
2016-01-14 08:28:03 -05:00
|
|
|
*/
|
|
|
|
|
public function implementsActions($actions);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* delete a user
|
|
|
|
|
* @param string $uid The username of the user to delete
|
|
|
|
|
* @return bool
|
|
|
|
|
* @since 4.5.0
|
|
|
|
|
*/
|
|
|
|
|
public function deleteUser($uid);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get a list of all users
|
|
|
|
|
*
|
|
|
|
|
* @param string $search
|
|
|
|
|
* @param null|int $limit
|
|
|
|
|
* @param null|int $offset
|
|
|
|
|
* @return string[] an array of all uids
|
|
|
|
|
* @since 4.5.0
|
|
|
|
|
*/
|
|
|
|
|
public function getUsers($search = '', $limit = null, $offset = null);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* check if a user exists
|
|
|
|
|
* @param string $uid the username
|
|
|
|
|
* @return boolean
|
|
|
|
|
* @since 4.5.0
|
|
|
|
|
*/
|
|
|
|
|
public function userExists($uid);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* get display name of the user
|
|
|
|
|
* @param string $uid user ID of the user
|
|
|
|
|
* @return string display name
|
|
|
|
|
* @since 4.5.0
|
|
|
|
|
*/
|
|
|
|
|
public function getDisplayName($uid);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get a list of all display names and user ids.
|
|
|
|
|
*
|
|
|
|
|
* @param string $search
|
2021-03-17 04:36:06 -04:00
|
|
|
* @param int|null $limit
|
|
|
|
|
* @param int|null $offset
|
2016-01-14 08:28:03 -05:00
|
|
|
* @return array an array of all displayNames (value) and the corresponding uids (key)
|
|
|
|
|
* @since 4.5.0
|
|
|
|
|
*/
|
|
|
|
|
public function getDisplayNames($search = '', $limit = null, $offset = null);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Check if a user list is available or not
|
|
|
|
|
* @return boolean if users can be listed or not
|
|
|
|
|
* @since 4.5.0
|
|
|
|
|
*/
|
|
|
|
|
public function hasUserListings();
|
|
|
|
|
}
|