diff options
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | appinfo/info.xml | 2 | ||||
-rw-r--r-- | lib/Constant/Opt.php | 1 | ||||
-rw-r--r-- | lib/Query/QueryProvider.php | 5 | ||||
-rw-r--r-- | templates/admin.php | 3 |
6 files changed, 11 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index d189cf9..b40801f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added +- Reverse active column option ## [4.2.0] - 2018-12-16 ### Added @@ -50,6 +50,7 @@ Name | Description | Details **Allow display name change** | With this option enabled user can change its display name. The display name change is propagated to the database. | Optional.<br/>Default: false.<br/>Requires: user *Display name* column. **Allow password change** | Can user change its password. The password change is propagated to the database. See [Hash algorithms](#hash-algorithms). | Optional.<br/>Default: false. **Case-insensitive username** | Whether user query should be case-sensitive or case-insensitive. | Optional.<br/>Default: false. +**Reverse active column** | Reverse value of active column in user table. | Optional.<br/>Default: false. **Use cache** | Use database query results cache. The cache can be cleared any time with the *Clear cache* button click. | Optional.<br/>Default: false. **Hash algorithm** | How users passwords are stored in the database. See [Hash algorithms](#hash-algorithms). | Mandatory. **Email sync** | Sync e-mail address with the Nextcloud.<br/>- *None* - Disables this feature. This is the default option.<br/>- *Synchronise only once* - Copy the e-mail address to the Nextcloud preferences if its not set.<br/>- *Nextcloud always wins* - Always copy the e-mail address to the database. This updates the user table.<br/>- *SQL always wins* - Always copy the e-mail address to the Nextcloud preferences. | Optional.<br/>Default: *None*.<br/>Requires: user *Email* column. diff --git a/appinfo/info.xml b/appinfo/info.xml index 01f2a2a..ecb2963 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -22,7 +22,7 @@ <category>auth</category> <dependencies> <php min-version="7.0"/> - <nextcloud min-version="14" max-version="15"/> + <nextcloud min-version="14" max-version="16"/> </dependencies> <settings> <admin>\OCA\UserSQL\Settings\Admin</admin> diff --git a/lib/Constant/Opt.php b/lib/Constant/Opt.php index 5093210..6cdc6c2 100644 --- a/lib/Constant/Opt.php +++ b/lib/Constant/Opt.php @@ -38,5 +38,6 @@ final class Opt const PASSWORD_CHANGE = "opt.password_change"; const PREPEND_SALT = "opt.prepend_salt"; const QUOTA_SYNC = "opt.quota_sync"; + const REVERSE_ACTIVE = "opt.reverse_active"; const USE_CACHE = "opt.use_cache"; } diff --git a/lib/Query/QueryProvider.php b/lib/Query/QueryProvider.php index cd027d0..03b1f5b 100644 --- a/lib/Query/QueryProvider.php +++ b/lib/Query/QueryProvider.php @@ -22,6 +22,7 @@ namespace OCA\UserSQL\Query; use OCA\UserSQL\Constant\DB; +use OCA\UserSQL\Constant\Opt; use OCA\UserSQL\Constant\Query; use OCA\UserSQL\Properties; @@ -86,6 +87,8 @@ class QueryProvider implements \ArrayAccess $searchParam = Query::SEARCH_PARAM; $uidParam = Query::UID_PARAM; + $reverseActiveOpt = $this->properties[Opt::REVERSE_ACTIVE]; + $groupColumns = "$gGID AS gid, " . (empty($gName) ? $gGID : $gName) . " AS name, " . @@ -96,7 +99,7 @@ class QueryProvider implements \ArrayAccess (empty($uEmail) ? "null" : $uEmail) . " AS email, " . (empty($uQuota) ? "null" : $uQuota) . " AS quota, " . (empty($uHome) ? "null" : $uHome) . " AS home, " . - (empty($uActive) ? "true" : $uActive) . " AS active, " . + (empty($uActive) ? "true" : (empty($reverseActiveOpt) ? "" : "NOT ") . $uActive) . " AS active, " . (empty($uAvatar) ? "false" : $uAvatar) . " AS avatar, " . (empty($uSalt) ? "null" : $uSalt) . " AS salt"; diff --git a/templates/admin.php b/templates/admin.php index c00b06e..0a5f042 100644 --- a/templates/admin.php +++ b/templates/admin.php @@ -110,7 +110,8 @@ function print_select_options( <fieldset><?php print_checkbox_input($l, "opt-name_change", "Allow display name change", $_["opt.name_change"]); print_checkbox_input($l, "opt-password_change", "Allow password change", $_["opt.password_change"]); - print_checkbox_input($l, "opt-case_insensitive_username", "Case-insensitive username", $_["opt.case_insensitive_username"]); ?> + print_checkbox_input($l, "opt-case_insensitive_username", "Case-insensitive username", $_["opt.case_insensitive_username"]); + print_checkbox_input($l, "opt-reverse_active", "Reverse active column", $_["opt.reverse_active"]); ?> <div class="button-right"><?php print_checkbox_input($l, "opt-use_cache", "Use cache", $_["opt.use_cache"], false); ?> <input type="submit" id="user_sql-clear_cache" value="<?php p($l->t("Clear cache")); ?>"> |