Database¶
-
class
OC\User\
Database
¶ - Class for user management in a SQL Database (e.g. MySQL, SQLite)
Properties¶
Methods¶
-
public
OC\User\Database::
__construct
($eventDispatcher=null, $table=users)¶ - \OC\User\Database constructor.
Source: Parameters: - $eventDispatcher (
OCP\EventDispatcher\IEventDispatcher
) - $table (string)
- $eventDispatcher (
-
public
OC\User\Database::
createUser
($uid, $password)¶ - Create a new user
Source: Parameters: - $uid (string) The username of the user to create
- $password (string) The password of the new user
Returns: bool Creates a new user. Basic checking of username is done in OC_User itself, not in its subclasses.
-
public
OC\User\Database::
deleteUser
($uid)¶ - delete a user
Source: Parameters: - $uid (string) The username of the user to delete
Returns: bool Deletes a user
-
public
OC\User\Database::
setPassword
($uid, $password)¶ - Set password
Source: Parameters: - $uid (string) The username
- $password (string) The new password
Returns: bool Change the password of a user
-
public
OC\User\Database::
setDisplayName
($uid, $displayName)¶ - Set display name
Source: Parameters: - $uid (string) The username
- $displayName (string) The new display name
Returns: bool Change the display name of a user
-
public
OC\User\Database::
getDisplayName
($uid)¶ - get display name of the user
Source: Parameters: - $uid (string) user ID of the user
Returns: string display name
-
public
OC\User\Database::
getDisplayNames
($search="", $limit=null, $offset=null)¶ - Get a list of all display names and user ids.
Source: Parameters: - $search (string)
- $limit (int | null)
- $offset (int | null)
Returns: array an array of all displayNames (value) and the corresponding uids (key)
-
public
OC\User\Database::
searchKnownUsersByDisplayName
($searcher, $pattern, $limit=null, $offset=null)¶ Source: Parameters: - $searcher (string)
- $pattern (string)
- $limit (int | null)
- $offset (int | null)
Returns: array
Since: 21.0.1
-
public
OC\User\Database::
checkPassword
($loginName, $password)¶ - Check if the password is correct
Source: Parameters: - $loginName (string) The loginname
- $password (string) The password
Returns: string Check if the password is correct without logging in the user returns the user id or false
-
public
OC\User\Database::
getUsers
($search="", $limit=null, $offset=null)¶ - Get a list of all users
Source: Parameters: - $search (string)
- $limit (null | int)
- $offset (null | int)
Returns: string[] an array of all uids
-
public
OC\User\Database::
userExists
($uid)¶ - check if a user exists
Source: Parameters: - $uid (string) the username
Returns: bool
-
public
OC\User\Database::
getHome
($uid)¶ - get the user’s home directory
Source: Parameters: - $uid (string) the username
Returns: string | bool
-
public
OC\User\Database::
hasUserListings
()¶ Source: lib/private/User/Database.php#464 Returns: bool
-
public
OC\User\Database::
countUsers
()¶ - counts the users in the database
Source: lib/private/User/Database.php#473 Returns: int | bool
-
public
OC\User\Database::
loginName2UserName
($loginName)¶ - returns the username for the given login name in the correct casing
Source: Parameters: - $loginName (string)
Returns: string | bool
-
public
OC\User\Database::
getBackendName
()¶ - Backend name to be shown in user management
Source: lib/private/User/Database.php#503 Returns: string the name of the backend to be shown
-
public static
OC\User\Database::
preLoginNameUsedAsUserName
($param)¶ Source: lib/private/User/Database.php#507
-
public
OC\User\Database::
getRealUID
($uid)¶ Source: lib/private/User/Database.php#525