Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/user_sql.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Łojewski <marcin.lojewski@mlojewski.me>2018-12-26 14:58:15 +0300
committerMarcin Łojewski <marcin.lojewski@mlojewski.me>2018-12-26 15:05:41 +0300
commit8370f4b8d00d889e6a918c694ab4c315c1f437a0 (patch)
tree839f8148528b71f7052fea9b006aece5ed7eac69
parent55797f0d568f908c5a70c0800428fe221e3f45cf (diff)
issue#86 Problem with "Provide avatar" field with user_sql 4.2.1
-rw-r--r--CHANGELOG.md1
-rw-r--r--README.md1
-rw-r--r--lib/Backend/UserBackend.php2
-rw-r--r--lib/Constant/Opt.php1
-rw-r--r--templates/admin.php1
5 files changed, 5 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ed22287..4334e2d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Added
- Reverse active column option
- Support for Nextcloud 16
+- Set default value for "provide avatar" option
## [4.2.1] - 2018-12-22
### Fixed
diff --git a/README.md b/README.md
index 65cfb89..4eed489 100644
--- a/README.md
+++ b/README.md
@@ -49,6 +49,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.
+**Allow providing avatar** | Can user provide its avatar. The value is used when column *Provide avatar* is not set. | 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.
diff --git a/lib/Backend/UserBackend.php b/lib/Backend/UserBackend.php
index 27927e4..b8c1a5d 100644
--- a/lib/Backend/UserBackend.php
+++ b/lib/Backend/UserBackend.php
@@ -555,7 +555,7 @@ final class UserBackend extends ABackend implements
);
if (empty($this->properties[DB::USER_AVATAR_COLUMN])) {
- return false;
+ return !empty($this->properties[Opt::PROVIDE_AVATAR]);
}
$user = $this->userRepository->findByUid($uid);
diff --git a/lib/Constant/Opt.php b/lib/Constant/Opt.php
index 6cdc6c2..94e9db5 100644
--- a/lib/Constant/Opt.php
+++ b/lib/Constant/Opt.php
@@ -37,6 +37,7 @@ final class Opt
const NAME_CHANGE = "opt.name_change";
const PASSWORD_CHANGE = "opt.password_change";
const PREPEND_SALT = "opt.prepend_salt";
+ const PROVIDE_AVATAR = "opt.provide_avatar";
const QUOTA_SYNC = "opt.quota_sync";
const REVERSE_ACTIVE = "opt.reverse_active";
const USE_CACHE = "opt.use_cache";
diff --git a/templates/admin.php b/templates/admin.php
index 0a5f042..d799b32 100644
--- a/templates/admin.php
+++ b/templates/admin.php
@@ -110,6 +110,7 @@ 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-provide_avatar", "Allow providing avatar", $_["opt.provide_avatar"]);
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