Merge pull request #8086 from annando/delegations
Fix: Show possible managers again
This commit is contained in:
commit
a7774f6f5e
1 changed files with 11 additions and 21 deletions
|
@ -102,29 +102,19 @@ class Delegation extends BaseSettingsModule
|
||||||
|
|
||||||
// find every contact who might be a candidate for delegation
|
// find every contact who might be a candidate for delegation
|
||||||
$potentials = [];
|
$potentials = [];
|
||||||
|
$nicknames = [];
|
||||||
|
|
||||||
$contacts = DBA::selectToArray(
|
$condition = ['baseurl' => DI::baseUrl(), 'self' => false, 'uid' => local_user(), 'blocked' => false];
|
||||||
'contact',
|
$contacts = DBA::select('contact', ['nick'], $condition);
|
||||||
['nurl'],
|
while ($contact = DBA::fetch($contacts)) {
|
||||||
[
|
$nicknames[] = $contact['nick'];
|
||||||
"`self` = 0 AND SUBSTRING_INDEX(`nurl`, '/', 3) = ? AND `uid` = ? AND `network` = ?",
|
}
|
||||||
Strings::normaliseLink(DI::baseUrl()),
|
|
||||||
local_user(),
|
|
||||||
Protocol::DFRN,
|
|
||||||
]
|
|
||||||
);
|
|
||||||
if ($contacts) {
|
|
||||||
$nicknames = [];
|
|
||||||
foreach ($contacts as $contact) {
|
|
||||||
$nicknames[] = "'" . DBA::escape(basename($contact['nurl'])) . "'";
|
|
||||||
}
|
|
||||||
|
|
||||||
// get user records for all potential page delegates who are not already delegates or managers
|
// get user records for all potential page delegates who are not already delegates or managers
|
||||||
$potentialDelegateUsers = DBA::selectToArray('user', ['uid', 'username', 'nickname'], ['nickname' => $nicknames]);
|
$potentialDelegateUsers = DBA::selectToArray('user', ['uid', 'username', 'nickname'], ['nickname' => $nicknames]);
|
||||||
foreach ($potentialDelegateUsers as $user) {
|
foreach ($potentialDelegateUsers as $user) {
|
||||||
if (!in_array($user['uid'], $uids)) {
|
if (!in_array($user['uid'], $uids)) {
|
||||||
$potentials[] = $user;
|
$potentials[] = $user;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue