diff --git a/appinfo/info.xml b/appinfo/info.xml
index 78b30f4..e75e846 100644
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -22,7 +22,7 @@
auth
-
+
\OCA\UserSQL\Settings\Admin
diff --git a/lib/Backend/GroupBackend.php b/lib/Backend/GroupBackend.php
index e48a2a5..82fe706 100644
--- a/lib/Backend/GroupBackend.php
+++ b/lib/Backend/GroupBackend.php
@@ -32,6 +32,7 @@
use OCP\Group\Backend\IGroupDetailsBackend;
use OCP\Group\Backend\IIsAdminBackend;
use OCP\Group\Backend\ISearchableGroupBackend;
+use OCP\Group\Backend\INamedBackend;
use OCP\ILogger;
use OCP\IUserManager;
@@ -91,7 +92,15 @@ public function __construct(
$this->groupRepository = $groupRepository;
}
- /**
+ /**
+ * @inheritdoc
+ */
+ public function getBackendName(): string
+ {
+ return "User SQL";
+ }
+
+ /**
* @inheritdoc
*/
public function getGroups($search = "", $limit = null, $offset = null)
diff --git a/lib/Backend/UserBackend.php b/lib/Backend/UserBackend.php
index 1824c4a..8d531b8 100644
--- a/lib/Backend/UserBackend.php
+++ b/lib/Backend/UserBackend.php
@@ -264,6 +264,13 @@ private function getUser($uid)
foreach ($this->actions as $action) {
$action->doAction($user);
}
+ }elseif ($this->properties[Opt::PLACEHOLDER_USERS]){
+ $user = new User();
+ $user->uid = $uid;
+ $user->active = false;
+ $user->email = "";
+ $user->name = "Deleted User";
+ $user->username = "deleted";
}
return $user;
diff --git a/lib/Constant/Opt.php b/lib/Constant/Opt.php
index 005122c..f7a1b44 100644
--- a/lib/Constant/Opt.php
+++ b/lib/Constant/Opt.php
@@ -48,4 +48,5 @@ final class Opt
const REVERSE_ACTIVE = "opt.reverse_active";
const SAFE_STORE = "opt.safe_store";
const USE_CACHE = "opt.use_cache";
+ const PLACEHOLDER_USERS = "opt.placeholder_users";
}
diff --git a/lib/Properties.php b/lib/Properties.php
index 762ce3c..bd90314 100644
--- a/lib/Properties.php
+++ b/lib/Properties.php
@@ -176,7 +176,7 @@ private function isBooleanParam($param)
$param, [
Opt::APPEND_SALT, Opt::CASE_INSENSITIVE_USERNAME, Opt::EMAIL_LOGIN,
Opt::NAME_CHANGE, Opt::PASSWORD_CHANGE, Opt::PREPEND_SALT,
- Opt::PROVIDE_AVATAR, Opt::REVERSE_ACTIVE, Opt::SAFE_STORE,
+ Opt::PROVIDE_AVATAR, Opt::REVERSE_ACTIVE, Opt::PLACEHOLDER_USERS, Opt::SAFE_STORE,
Opt::USE_CACHE
]
);
diff --git a/templates/admin.php b/templates/admin.php
index 74772e7..629f48d 100644
--- a/templates/admin.php
+++ b/templates/admin.php
@@ -118,7 +118,8 @@ function print_select_options(
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"]); ?>
+ print_checkbox_input($l, "opt-reverse_active", "Reverse ACTIVE column", $_["opt.reverse_active"]);
+ print_checkbox_input($l, "opt-placeholder_users", "Placeholders for missing users in SQL database", $_["opt.placeholder_users"]); ?>
">