]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Bookmarklet.php
Remove direct calls to App->user
[friendica.git] / src / Module / Bookmarklet.php
index 9ecce8ade1e9e32bad8facb8ac9c4395014408a7..9db1cc1381ea2918facd523c056acdf6a7cfb4e9 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -22,6 +22,7 @@
 namespace Friendica\Module;
 
 use Friendica\BaseModule;
+use Friendica\Content\PageInfo;
 use Friendica\Core\ACL;
 use Friendica\DI;
 use Friendica\Module\Security\Login;
@@ -55,14 +56,14 @@ class Bookmarklet extends BaseModule
                                throw new HTTPException\BadRequestException(DI::l10n()->t('This page is missing a url parameter.'));
                        }
 
-                       $content = add_page_info($_REQUEST["url"]);
+                       $content = "\n" . PageInfo::getFooterFromUrl($_REQUEST['url']);
 
                        $x = [
                                'is_owner'         => true,
-                               'allow_location'   => $app->user['allow_location'],
-                               'default_location' => $app->user['default-location'],
-                               'nickname'         => $app->user['nickname'],
-                               'lockstate'        => ((is_array($app->user) && ((strlen($app->user['allow_cid'])) || (strlen($app->user['allow_gid'])) || (strlen($app->user['deny_cid'])) || (strlen($app->user['deny_gid'])))) ? 'lock' : 'unlock'),
+                               'allow_location'   => $app->getUserValue('allow_location'),
+                               'default_location' => $app->getUserValue('default-location'),
+                               'nickname'         => $app->getNickname(),
+                               'lockstate'        => ACL::getLockstateForUserId($app->getUserId()) ? 'lock' : 'unlock',
                                'default_perms'    => ACL::getDefaultUserPermissions($app->user),
                                'acl'              => ACL::getFullSelectorHTML(DI::page(), $app->user, true),
                                'bang'             => '',