issue#85 Revers active column checkbox
This commit is contained in:
@@ -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).
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
### Added
|
||||||
|
- Reverse active column option
|
||||||
|
|
||||||
## [4.2.0] - 2018-12-16
|
## [4.2.0] - 2018-12-16
|
||||||
### Added
|
### 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 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.
|
**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.
|
**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.
|
**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.
|
**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.
|
**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.
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<category>auth</category>
|
<category>auth</category>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<php min-version="7.0"/>
|
<php min-version="7.0"/>
|
||||||
<nextcloud min-version="14" max-version="15"/>
|
<nextcloud min-version="14" max-version="16"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<settings>
|
<settings>
|
||||||
<admin>\OCA\UserSQL\Settings\Admin</admin>
|
<admin>\OCA\UserSQL\Settings\Admin</admin>
|
||||||
|
|||||||
@@ -38,5 +38,6 @@ final class Opt
|
|||||||
const PASSWORD_CHANGE = "opt.password_change";
|
const PASSWORD_CHANGE = "opt.password_change";
|
||||||
const PREPEND_SALT = "opt.prepend_salt";
|
const PREPEND_SALT = "opt.prepend_salt";
|
||||||
const QUOTA_SYNC = "opt.quota_sync";
|
const QUOTA_SYNC = "opt.quota_sync";
|
||||||
|
const REVERSE_ACTIVE = "opt.reverse_active";
|
||||||
const USE_CACHE = "opt.use_cache";
|
const USE_CACHE = "opt.use_cache";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
namespace OCA\UserSQL\Query;
|
namespace OCA\UserSQL\Query;
|
||||||
|
|
||||||
use OCA\UserSQL\Constant\DB;
|
use OCA\UserSQL\Constant\DB;
|
||||||
|
use OCA\UserSQL\Constant\Opt;
|
||||||
use OCA\UserSQL\Constant\Query;
|
use OCA\UserSQL\Constant\Query;
|
||||||
use OCA\UserSQL\Properties;
|
use OCA\UserSQL\Properties;
|
||||||
|
|
||||||
@@ -86,6 +87,8 @@ class QueryProvider implements \ArrayAccess
|
|||||||
$searchParam = Query::SEARCH_PARAM;
|
$searchParam = Query::SEARCH_PARAM;
|
||||||
$uidParam = Query::UID_PARAM;
|
$uidParam = Query::UID_PARAM;
|
||||||
|
|
||||||
|
$reverseActiveOpt = $this->properties[Opt::REVERSE_ACTIVE];
|
||||||
|
|
||||||
$groupColumns
|
$groupColumns
|
||||||
= "$gGID AS gid, " .
|
= "$gGID AS gid, " .
|
||||||
(empty($gName) ? $gGID : $gName) . " AS name, " .
|
(empty($gName) ? $gGID : $gName) . " AS name, " .
|
||||||
@@ -96,7 +99,7 @@ class QueryProvider implements \ArrayAccess
|
|||||||
(empty($uEmail) ? "null" : $uEmail) . " AS email, " .
|
(empty($uEmail) ? "null" : $uEmail) . " AS email, " .
|
||||||
(empty($uQuota) ? "null" : $uQuota) . " AS quota, " .
|
(empty($uQuota) ? "null" : $uQuota) . " AS quota, " .
|
||||||
(empty($uHome) ? "null" : $uHome) . " AS home, " .
|
(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($uAvatar) ? "false" : $uAvatar) . " AS avatar, " .
|
||||||
(empty($uSalt) ? "null" : $uSalt) . " AS salt";
|
(empty($uSalt) ? "null" : $uSalt) . " AS salt";
|
||||||
|
|
||||||
|
|||||||
@@ -110,7 +110,8 @@ function print_select_options(
|
|||||||
<fieldset><?php
|
<fieldset><?php
|
||||||
print_checkbox_input($l, "opt-name_change", "Allow display name change", $_["opt.name_change"]);
|
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-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
|
<div class="button-right"><?php
|
||||||
print_checkbox_input($l, "opt-use_cache", "Use cache", $_["opt.use_cache"], false); ?>
|
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")); ?>">
|
<input type="submit" id="user_sql-clear_cache" value="<?php p($l->t("Clear cache")); ?>">
|
||||||
|
|||||||
Reference in New Issue
Block a user