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.
Default: false.
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.
Default: false.
+**Allow providing avatar** | Can user provide its avatar. The value is used when column *Provide avatar* is not set. | Optional.
Default: false.
**Case-insensitive username** | Whether user query should be case-sensitive or case-insensitive. | Optional.
Default: false.
**Reverse active column** | Reverse value of active column in user table. | Optional.
Default: false.
**Use cache** | Use database query results cache. The cache can be cleared any time with the *Clear cache* button click. | Optional.
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(