Skip to content

Commit 55797f0

Browse files
committed
merge feature into develop
2 parents ae87b83 + ed53272 commit 55797f0

6 files changed

Lines changed: 12 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Added
9+
- Reverse active column option
10+
- Support for Nextcloud 16
811

912
## [4.2.1] - 2018-12-22
1013
### Fixed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Name | Description | Details
5050
**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.
5151
**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.
5252
**Case-insensitive username** | Whether user query should be case-sensitive or case-insensitive. | Optional.<br/>Default: false.
53+
**Reverse active column** | Reverse value of active column in user table. | Optional.<br/>Default: false.
5354
**Use cache** | Use database query results cache. The cache can be cleared any time with the *Clear cache* button click. | Optional.<br/>Default: false.
5455
**Hash algorithm** | How users passwords are stored in the database. See [Hash algorithms](#hash-algorithms). | Mandatory.
5556
**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.

appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<category>auth</category>
2323
<dependencies>
2424
<php min-version="7.0"/>
25-
<nextcloud min-version="14" max-version="15"/>
25+
<nextcloud min-version="14" max-version="16"/>
2626
</dependencies>
2727
<settings>
2828
<admin>\OCA\UserSQL\Settings\Admin</admin>

lib/Constant/Opt.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@ final class Opt
3838
const PASSWORD_CHANGE = "opt.password_change";
3939
const PREPEND_SALT = "opt.prepend_salt";
4040
const QUOTA_SYNC = "opt.quota_sync";
41+
const REVERSE_ACTIVE = "opt.reverse_active";
4142
const USE_CACHE = "opt.use_cache";
4243
}

lib/Query/QueryProvider.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
namespace OCA\UserSQL\Query;
2323

2424
use OCA\UserSQL\Constant\DB;
25+
use OCA\UserSQL\Constant\Opt;
2526
use OCA\UserSQL\Constant\Query;
2627
use OCA\UserSQL\Properties;
2728

@@ -86,6 +87,8 @@ private function loadQueries()
8687
$searchParam = Query::SEARCH_PARAM;
8788
$uidParam = Query::UID_PARAM;
8889

90+
$reverseActiveOpt = $this->properties[Opt::REVERSE_ACTIVE];
91+
8992
$groupColumns
9093
= "g.$gGID AS gid, " .
9194
(empty($gName) ? "g." . $gGID : "g." . $gName) . " AS name, " .
@@ -96,7 +99,7 @@ private function loadQueries()
9699
(empty($uEmail) ? "null" : "u." . $uEmail) . " AS email, " .
97100
(empty($uQuota) ? "null" : "u." . $uQuota) . " AS quota, " .
98101
(empty($uHome) ? "null" : "u." . $uHome) . " AS home, " .
99-
(empty($uActive) ? "true" : "u." . $uActive) . " AS active, " .
102+
(empty($uActive) ? "true" : (empty($reverseActiveOpt) ? "" : "NOT ") . "u." . $uActive) . " AS active, " .
100103
(empty($uAvatar) ? "false" : "u." . $uAvatar) . " AS avatar, " .
101104
(empty($uSalt) ? "null" : "u." . $uSalt) . " AS salt";
102105

templates/admin.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ function print_select_options(
110110
<fieldset><?php
111111
print_checkbox_input($l, "opt-name_change", "Allow display name change", $_["opt.name_change"]);
112112
print_checkbox_input($l, "opt-password_change", "Allow password change", $_["opt.password_change"]);
113-
print_checkbox_input($l, "opt-case_insensitive_username", "Case-insensitive username", $_["opt.case_insensitive_username"]); ?>
113+
print_checkbox_input($l, "opt-case_insensitive_username", "Case-insensitive username", $_["opt.case_insensitive_username"]);
114+
print_checkbox_input($l, "opt-reverse_active", "Reverse active column", $_["opt.reverse_active"]); ?>
114115
<div class="button-right"><?php
115116
print_checkbox_input($l, "opt-use_cache", "Use cache", $_["opt.use_cache"], false); ?>
116117
<input type="submit" id="user_sql-clear_cache" value="<?php p($l->t("Clear cache")); ?>">

0 commit comments

Comments
 (0)