]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Profile/Schedule.php
Merge pull request #12962 from annando/issue-12876c
[friendica.git] / src / Module / Profile / Schedule.php
index 590786824c8c7b769314a59e5ee9b071965283cc..ef57c294aaa437cc42b897f87d4afdea0ae4b734 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -24,7 +24,6 @@ namespace Friendica\Module\Profile;
 use Friendica\BaseModule;
 use Friendica\Content\Text\BBCode;
 use Friendica\Core\Renderer;
-use Friendica\Core\Session;
 use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Model\Post;
@@ -36,7 +35,7 @@ class Schedule extends BaseProfile
 {
        protected function post(array $request = [])
        {
-               if (!Session::getLocalUser()) {
+               if (!DI::userSession()->getLocalUserId()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
                }
 
@@ -44,7 +43,7 @@ class Schedule extends BaseProfile
                        throw new HTTPException\BadRequestException();
                }
 
-               if (!DBA::exists('delayed-post', ['id' => $_REQUEST['delete'], 'uid' => Session::getLocalUser()])) {
+               if (!DBA::exists('delayed-post', ['id' => $_REQUEST['delete'], 'uid' => DI::userSession()->getLocalUserId()])) {
                        throw new HTTPException\NotFoundException();
                }
 
@@ -53,16 +52,16 @@ class Schedule extends BaseProfile
 
        protected function content(array $request = []): string
        {
-               if (!Session::getLocalUser()) {
+               if (!DI::userSession()->getLocalUserId()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
                }
 
                $a = DI::app();
 
-               $o = self::getTabsHTML($a, 'schedule', true, $a->getLoggedInUserNickname(), false);
+               $o = self::getTabsHTML('schedule', true, $a->getLoggedInUserNickname(), false);
 
                $schedule = [];
-               $delayed = DBA::select('delayed-post', [], ['uid' => Session::getLocalUser()]);
+               $delayed = DBA::select('delayed-post', [], ['uid' => DI::userSession()->getLocalUserId()]);
                while ($row = DBA::fetch($delayed)) {
                        $parameter = Post\Delayed::getParametersForid($row['id']);
                        if (empty($parameter)) {
@@ -79,7 +78,6 @@ class Schedule extends BaseProfile
                $tpl = Renderer::getMarkupTemplate('profile/schedule.tpl');
                $o .= Renderer::replaceMacros($tpl, [
                        '$form_security_token' => BaseModule::getFormSecurityToken("profile_schedule"),
-                       '$baseurl'             => DI::baseUrl()->get(true),
                        '$title'               => DI::l10n()->t('Scheduled Posts'),
                        '$nickname'            => $this->parameters['nickname'] ?? '',
                        '$scheduled_at'        => DI::l10n()->t('Scheduled'),