2014-07-09 17:32:33 +04:00
|
|
|
<?php
|
|
|
|
/**
|
2015-02-23 13:28:53 +03:00
|
|
|
* @author Lukas Reschke <lukas@owncloud.com>
|
|
|
|
* @author Robin Appelman <icewind@owncloud.com>
|
|
|
|
* @author Thomas Müller <thomas.mueller@tmit.eu>
|
|
|
|
*
|
|
|
|
* @copyright Copyright (c) 2015, ownCloud, Inc.
|
|
|
|
* @license AGPL-3.0
|
|
|
|
*
|
|
|
|
* This code is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License, version 3,
|
|
|
|
* as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License, version 3,
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
|
|
*
|
2014-07-09 17:32:33 +04:00
|
|
|
*/
|
|
|
|
namespace OCP;
|
|
|
|
|
|
|
|
interface IUser {
|
|
|
|
/**
|
|
|
|
* get the user id
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getUID();
|
|
|
|
|
|
|
|
/**
|
2014-07-24 14:50:39 +04:00
|
|
|
* get the display name for the user, if no specific display name is set it will fallback to the user id
|
2014-07-09 17:32:33 +04:00
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getDisplayName();
|
|
|
|
|
|
|
|
/**
|
2014-07-24 14:50:39 +04:00
|
|
|
* set the display name for the user
|
2014-07-09 17:32:33 +04:00
|
|
|
*
|
|
|
|
* @param string $displayName
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function setDisplayName($displayName);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* returns the timestamp of the user's last login or 0 if the user did never
|
|
|
|
* login
|
|
|
|
*
|
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function getLastLogin();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* updates the timestamp of the most recent login of this user
|
|
|
|
*/
|
|
|
|
public function updateLastLoginTimestamp();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Delete the user
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function delete();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the password of the user
|
|
|
|
*
|
|
|
|
* @param string $password
|
|
|
|
* @param string $recoveryPassword for the encryption app to reset encryption keys
|
|
|
|
* @return bool
|
|
|
|
*/
|
2014-07-24 14:50:39 +04:00
|
|
|
public function setPassword($password, $recoveryPassword = null);
|
2014-07-09 17:32:33 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* get the users home folder to mount
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getHome();
|
|
|
|
|
Expose backend type via REST API
This change will expose the user backend via the REST API which is a pre-requisite for https://github.com/owncloud/core/issues/12620.
For example:
````json
[{"name":"9707A09E-CA9A-4ABE-A66A-3F632F16C409","displayname":"Document Conversion User Account","groups":[],"subadmin":[],"quota":"default","storageLocation":"\/Users\/lreschke\/Programming\/core\/data\/9707A09E-CA9A-4ABE-A66A-3F632F16C409","lastLogin":0,"backend":"OCA\\user_ldap\\USER_LDAP"},{"name":"ED86733E-745C-4E4D-90CB-278A9737DB3C","displayname":"Hacker","groups":[],"subadmin":[],"quota":"default","storageLocation":"\/Users\/lreschke\/Programming\/core\/data\/ED86733E-745C-4E4D-90CB-278A9737DB3C","lastLogin":0,"backend":"OCA\\user_ldap\\USER_LDAP"},{"name":"71CDF45B-E125-450D-983C-D9192F36EC88","displayname":"admin","groups":[],"subadmin":[],"quota":"default","storageLocation":"\/Users\/lreschke\/Programming\/core\/data\/71CDF45B-E125-450D-983C-D9192F36EC88","lastLogin":0,"backend":"OCA\\user_ldap\\USER_LDAP"},{"name":"admin","displayname":"admin","groups":["admin"],"subadmin":[],"quota":"default","storageLocation":"\/Users\/lreschke\/Programming\/core\/data\/admin","lastLogin":"1418057287","backend":"OC_User_Database"},{"name":"test","displayname":"test","groups":[],"subadmin":[],"quota":"default","storageLocation":"\/Users\/lreschke\/Programming\/core\/data\/test","lastLogin":0,"backend":"OC_User_Database"}]
```
2014-12-09 00:38:54 +03:00
|
|
|
/**
|
|
|
|
* Get the name of the backend class the user is connected with
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getBackendClassName();
|
|
|
|
|
2014-07-09 17:32:33 +04:00
|
|
|
/**
|
|
|
|
* check if the backend allows the user to change his avatar on Personal page
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function canChangeAvatar();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* check if the backend supports changing passwords
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function canChangePassword();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* check if the backend supports changing display names
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function canChangeDisplayName();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* check if the user is enabled
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function isEnabled();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* set the enabled status for the user
|
|
|
|
*
|
|
|
|
* @param bool $enabled
|
|
|
|
*/
|
|
|
|
public function setEnabled($enabled);
|
|
|
|
}
|