use Friendica\Database\DBA;
use Friendica\Model\User;
use Friendica\Util\Security;
+use Friendica\Util\Strings;
require_once 'mod/settings.php';
return;
}
- if (count($a->user) && x($a->user, 'uid') && $a->user['uid'] != local_user()) {
+ if (count($a->user) && !empty($a->user['uid']) && $a->user['uid'] != local_user()) {
notice(L10n::t('Permission denied.') . EOL);
return;
}
if ($a->argc > 2 && $a->argv[1] === 'add' && intval($a->argv[2])) {
// delegated admins can view but not change delegation permissions
- if (x($_SESSION, 'submanage')) {
+ if (!empty($_SESSION['submanage'])) {
$a->internalRedirect('delegate');
}
if (DBA::isResult($user)) {
$condition = [
'uid' => local_user(),
- 'nurl' => normalise_link(System::baseUrl() . '/profile/' . $user['nickname'])
+ 'nurl' => Strings::normaliseLink(System::baseUrl() . '/profile/' . $user['nickname'])
];
if (DBA::exists('contact', $condition)) {
DBA::insert('manage', ['uid' => $user_id, 'mid' => local_user()]);
if ($a->argc > 2 && $a->argv[1] === 'remove' && intval($a->argv[2])) {
// delegated admins can view but not change delegation permissions
- if (x($_SESSION, 'submanage')) {
+ if (!empty($_SESSION['submanage'])) {
$a->internalRedirect('delegate');
}
AND SUBSTRING_INDEX(`nurl`, '/', 3) = '%s'
AND `uid` = %d
AND `network` = '%s' ",
- DBA::escape(normalise_link(System::baseUrl())),
+ DBA::escape(Strings::normaliseLink(System::baseUrl())),
intval(local_user()),
DBA::escape(Protocol::DFRN)
);
if (!is_null($parent_user)) {
$parent_password = ['parent_password', L10n::t('Parent Password:'), '', L10n::t('Please enter the password of the parent account to legitimize your request.')];
+ } else {
+ $parent_password = '';
}
- $o = Renderer::replaceMacros(get_markup_template('delegate.tpl'), [
+ $o = Renderer::replaceMacros(Renderer::getMarkupTemplate('delegate.tpl'), [
'$form_security_token' => BaseModule::getFormSecurityToken('delegate'),
'$parent_header' => L10n::t('Parent User'),
'$parent_user' => $parent_user,