X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fdelegate.php;h=456078451570cbc1db5f929201f6de0fa5cd6ad3;hb=a11206dbcd662a73d1c8200f2bef5287533cdbe6;hp=c8987ab570c95c6c2ab719a1017f712f736417df;hpb=ffc406d8195871a6580c78f1cc42ff0b7deeba02;p=friendica.git diff --git a/mod/delegate.php b/mod/delegate.php index c8987ab570..4560784515 100644 --- a/mod/delegate.php +++ b/mod/delegate.php @@ -11,14 +11,13 @@ use Friendica\Core\Renderer; use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\Model\User; -use Friendica\Util\Security; use Friendica\Util\Strings; require_once 'mod/settings.php'; function delegate_init(App $a) { - return settings_init($a); + settings_init($a); } function delegate_post(App $a) @@ -27,7 +26,7 @@ function delegate_post(App $a) 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; } @@ -63,7 +62,7 @@ function delegate_content(App $a) 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'); } @@ -84,7 +83,7 @@ function delegate_content(App $a) 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'); } @@ -163,6 +162,8 @@ function delegate_content(App $a) 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(Renderer::getMarkupTemplate('delegate.tpl'), [