Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<category>auth</category>
<dependencies>
<php min-version="8.0"/>
<nextcloud min-version="25" max-version="27"/>
<nextcloud min-version="25" max-version="30"/>
</dependencies>
<settings>
<admin>\OCA\UserSQL\Settings\Admin</admin>
Expand Down
11 changes: 10 additions & 1 deletion lib/Backend/GroupBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions lib/Backend/UserBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions lib/Constant/Opt.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
2 changes: 1 addition & 1 deletion lib/Properties.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
);
Expand Down
3 changes: 2 additions & 1 deletion templates/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"]); ?>
<div class="button-right"><?php
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")); ?>">
Expand Down