2019-05-19 03:01:46 +00:00
|
|
|
<?php
|
2020-02-09 14:45:36 +00:00
|
|
|
/**
|
2022-01-02 07:27:47 +00:00
|
|
|
* @copyright Copyright (C) 2010-2022, the Friendica project
|
2020-02-09 14:45:36 +00:00
|
|
|
*
|
|
|
|
* @license GNU AGPL version 3 or any later version
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
2019-05-19 03:01:46 +00:00
|
|
|
|
|
|
|
namespace Friendica\Module\Search;
|
|
|
|
|
|
|
|
use Friendica\Content\Widget;
|
2022-10-19 04:43:47 +00:00
|
|
|
use Friendica\Core\Session;
|
2019-12-15 21:34:11 +00:00
|
|
|
use Friendica\DI;
|
2020-01-23 04:14:14 +00:00
|
|
|
use Friendica\Module\BaseSearch;
|
2019-12-27 21:19:28 +00:00
|
|
|
use Friendica\Module\Security\Login;
|
2019-05-19 03:01:46 +00:00
|
|
|
|
|
|
|
/**
|
2019-05-19 03:06:02 +00:00
|
|
|
* Directory search module
|
2019-05-19 03:01:46 +00:00
|
|
|
*/
|
2020-01-23 04:14:14 +00:00
|
|
|
class Directory extends BaseSearch
|
2019-05-19 03:01:46 +00:00
|
|
|
{
|
2021-11-20 14:38:03 +00:00
|
|
|
protected function content(array $request = []): string
|
2019-05-19 03:01:46 +00:00
|
|
|
{
|
2022-10-19 04:43:47 +00:00
|
|
|
if (!Session::getLocalUser()) {
|
2022-10-17 18:55:22 +00:00
|
|
|
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
2019-05-19 03:01:46 +00:00
|
|
|
return Login::form();
|
|
|
|
}
|
|
|
|
|
2021-11-07 09:18:25 +00:00
|
|
|
$search = trim(rawurldecode($_REQUEST['search'] ?? ''));
|
2019-10-07 18:27:20 +00:00
|
|
|
|
2019-12-30 19:02:09 +00:00
|
|
|
if (empty(DI::page()['aside'])) {
|
|
|
|
DI::page()['aside'] = '';
|
2019-05-19 03:01:46 +00:00
|
|
|
}
|
|
|
|
|
2019-12-30 19:02:09 +00:00
|
|
|
DI::page()['aside'] .= Widget::findPeople();
|
|
|
|
DI::page()['aside'] .= Widget::follow();
|
2019-05-19 03:01:46 +00:00
|
|
|
|
2019-12-24 22:15:41 +00:00
|
|
|
return self::performContactSearch($search);
|
2019-05-19 03:01:46 +00:00
|
|
|
}
|
|
|
|
}
|