]> git.mxchange.org Git - friendica.git/blobdiff - mod/delegate.php
Catch HTTPExceptions in App::runFrontend()
[friendica.git] / mod / delegate.php
index c8987ab570c95c6c2ab719a1017f712f736417df..4bfc0e31ba8b78879d5c47021f7f524ae9ea8606 100644 (file)
@@ -27,7 +27,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 +63,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 +84,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 +163,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'), [