issue#95 - Do not include users which are disabled
This commit is contained in:
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||
- Support Nextcloud password_policy
|
||||
- Extend user/group search
|
||||
- Support for Nextcloud 18
|
||||
- Do not include users which are disabled
|
||||
|
||||
### Fixed
|
||||
- Getting user display names backend
|
||||
|
||||
@@ -73,6 +73,7 @@ Name | Description | Details
|
||||
**Password** | Password hash column. | Mandatory for user backend.
|
||||
**Display name** | Display name column. | Optional.
|
||||
**Active** | Flag indicating if user can log in. | Optional.<br/>Default: true.
|
||||
**Disabled** | Flag indicating if user should not be visible (not included in searches). | Optional.<br/>Default: false.
|
||||
**Provide avatar** | Flag indicating if user can change its avatar. | Optional.<br/>Default: false.
|
||||
**Salt** | Salt which is appended to password when checking or changing the password. | Optional.
|
||||
**Append salt** | Append a salt to the password. | Optional.<br/>Default: false.
|
||||
|
||||
@@ -47,6 +47,7 @@ final class DB
|
||||
|
||||
const USER_ACTIVE_COLUMN = "db.table.user.column.active";
|
||||
const USER_AVATAR_COLUMN = "db.table.user.column.avatar";
|
||||
const USER_DISABLED_COLUMN = "db.table.user.column.disabled";
|
||||
const USER_EMAIL_COLUMN = "db.table.user.column.email";
|
||||
const USER_HOME_COLUMN = "db.table.user.column.home";
|
||||
const USER_NAME_COLUMN = "db.table.user.column.name";
|
||||
|
||||
@@ -68,6 +68,7 @@ class QueryProvider implements \ArrayAccess
|
||||
|
||||
$uActive = $this->properties[DB::USER_ACTIVE_COLUMN];
|
||||
$uAvatar = $this->properties[DB::USER_AVATAR_COLUMN];
|
||||
$uDisabled = $this->properties[DB::USER_DISABLED_COLUMN];
|
||||
$uEmail = $this->properties[DB::USER_EMAIL_COLUMN];
|
||||
$uHome = $this->properties[DB::USER_HOME_COLUMN];
|
||||
$uName = $this->properties[DB::USER_NAME_COLUMN];
|
||||
@@ -121,7 +122,8 @@ class QueryProvider implements \ArrayAccess
|
||||
Query::COUNT_USERS =>
|
||||
"SELECT COUNT(u.$uUID) AS count " .
|
||||
"FROM $user u " .
|
||||
"WHERE u.$uUID LIKE :$searchParam",
|
||||
"WHERE u.$uUID LIKE :$searchParam " .
|
||||
(empty($uDisabled) ? "" : "AND NOT u.$uDisabled"),
|
||||
|
||||
Query::FIND_GROUP =>
|
||||
"SELECT $groupColumns " .
|
||||
@@ -146,12 +148,14 @@ class QueryProvider implements \ArrayAccess
|
||||
Query::FIND_USER =>
|
||||
"SELECT $userColumns, u.$uPassword AS password " .
|
||||
"FROM $user u " .
|
||||
"WHERE u.$uUID = :$uidParam",
|
||||
"WHERE u.$uUID = :$uidParam " .
|
||||
(empty($uDisabled) ? "" : "AND NOT u.$uDisabled"),
|
||||
|
||||
Query::FIND_USER_CASE_INSENSITIVE =>
|
||||
"SELECT $userColumns, u.$uPassword AS password " .
|
||||
"FROM $user u " .
|
||||
"WHERE lower(u.$uUID) = lower(:$uidParam)",
|
||||
"WHERE lower(u.$uUID) = lower(:$uidParam) " .
|
||||
(empty($uDisabled) ? "" : "AND NOT u.$uDisabled"),
|
||||
|
||||
Query::FIND_USER_GROUPS =>
|
||||
"SELECT $groupColumns " .
|
||||
@@ -163,9 +167,12 @@ class QueryProvider implements \ArrayAccess
|
||||
Query::FIND_USERS =>
|
||||
"SELECT $userColumns " .
|
||||
"FROM $user u " .
|
||||
"WHERE u.$uUID LIKE :$searchParam " .
|
||||
"WHERE (" .
|
||||
"u.$uUID LIKE :$searchParam " .
|
||||
(empty($uName) ? "" : "OR u.$uName LIKE :$searchParam ") .
|
||||
(empty($uEmail) ? "" : "OR u.$uEmail LIKE :$searchParam ") .
|
||||
")" .
|
||||
(empty($uDisabled) ? "" : "AND NOT u.$uDisabled ") .
|
||||
"ORDER BY u.$uUID",
|
||||
|
||||
Query::UPDATE_DISPLAY_NAME =>
|
||||
|
||||
@@ -158,6 +158,7 @@ function print_select_options(
|
||||
print_text_input($l, "db-table-user-column-password", "Password", $_["db.table.user.column.password"]);
|
||||
print_text_input($l, "db-table-user-column-name", "Display name", $_["db.table.user.column.name"]);
|
||||
print_text_input($l, "db-table-user-column-active", "Active", $_["db.table.user.column.active"]);
|
||||
print_text_input($l, "db-table-user-column-disabled", "Disabled", $_["db.table.user.column.disabled"]);
|
||||
print_text_input($l, "db-table-user-column-avatar", "Provide avatar", $_["db.table.user.column.avatar"]);
|
||||
print_text_input($l, "db-table-user-column-salt", "Salt", $_["db.table.user.column.salt"]); ?>
|
||||
<div class="inner-fieldset">
|
||||
|
||||
Reference in New Issue
Block a user