Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move constants required by UserInterface into interface definition #8896

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions lib/private/User/Backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,6 @@ abstract class Backend implements UserInterface {
*/
const NOT_IMPLEMENTED = -501;

/**
* actions that user backends can define
*/
const CREATE_USER = 1; // 1 << 0
const SET_PASSWORD = 16; // 1 << 4
const CHECK_PASSWORD = 256; // 1 << 8
const GET_HOME = 4096; // 1 << 12
const GET_DISPLAYNAME = 65536; // 1 << 16
const SET_DISPLAYNAME = 1048576; // 1 << 20
const PROVIDE_AVATAR = 16777216; // 1 << 24
const COUNT_USERS = 268435456; // 1 << 28

protected $possibleActions = array(
self::CREATE_USER => 'createUser',
self::SET_PASSWORD => 'setPassword',
Expand Down
15 changes: 14 additions & 1 deletion lib/public/UserInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,27 @@
* @since 4.5.0
*/
interface UserInterface {
/**
* actions that user backends can define
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a @since 14.0.0 tag so everybody knows when this was added and with what version it could be used.

*
* @since 14.0.0
*/
const CREATE_USER = 1; // 1 << 0
const SET_PASSWORD = 16; // 1 << 4
const CHECK_PASSWORD = 256; // 1 << 8
const GET_HOME = 4096; // 1 << 12
const GET_DISPLAYNAME = 65536; // 1 << 16
const SET_DISPLAYNAME = 1048576; // 1 << 20
const PROVIDE_AVATAR = 16777216; // 1 << 24
const COUNT_USERS = 268435456; // 1 << 28

/**
* Check if backend implements actions
* @param int $actions bitwise-or'ed actions
* @return boolean
*
* Returns the supported actions as int to be
* compared with \OC\User\Backend::CREATE_USER etc.
* compared with self::CREATE_USER etc.
* @since 4.5.0
*/
public function implementsActions($actions);
Expand Down