Skip to content
Open
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
46 changes: 46 additions & 0 deletions lib/Db/UserMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,29 @@ public function getUser(string $uid): User {
public function find(string $search, $limit = null, $offset = null): array {
$qb = $this->db->getQueryBuilder();

$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
$stack = [];

foreach ($backtrace as $index => $trace) {
$class = $trace['class'] ?? '';
$type = $trace['type'] ?? '';
$function = $trace['function'] ?? '';
$file = $trace['file'] ?? 'unknown file';
$line = $trace['line'] ?? 'unknown line';

$stack[] = sprintf(
"#%d %s%s%s() called at [%s:%s]",
$index,
$class,
$type,
$function,
$file,
$line
);
}

$this->logger->debug("Find user by string: " . $search . " -- Call Stack:\n" . implode("\n", $stack));

$oidcSystemConfig = $this->config->getSystemValue('user_oidc', []);
$matchEmails = !isset($oidcSystemConfig['user_search_match_emails']) || $oidcSystemConfig['user_search_match_emails'] === true;
if ($matchEmails) {
Expand Down Expand Up @@ -91,6 +114,29 @@ public function find(string $search, $limit = null, $offset = null): array {
public function findDisplayNames(string $search, $limit = null, $offset = null): array {
$qb = $this->db->getQueryBuilder();

$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
$stack = [];

foreach ($backtrace as $index => $trace) {
$class = $trace['class'] ?? '';
$type = $trace['type'] ?? '';
$function = $trace['function'] ?? '';
$file = $trace['file'] ?? 'unknown file';
$line = $trace['line'] ?? 'unknown line';

$stack[] = sprintf(
"#%d %s%s%s() called at [%s:%s]",
$index,
$class,
$type,
$function,
$file,
$line
);
}

$this->logger->debug("Find user display names by string: " . $search . " -- Call Stack:\n" . implode("\n", $stack));

$oidcSystemConfig = $this->config->getSystemValue('user_oidc', []);
$matchEmails = !isset($oidcSystemConfig['user_search_match_emails']) || $oidcSystemConfig['user_search_match_emails'] === true;
if ($matchEmails) {
Expand Down