From c65ecf0c1ddfb6df5b1823b5b0dc837c3821dba0 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sat, 10 Dec 2022 23:21:08 +0100 Subject: [PATCH] fix again and again zcfs posts owner --- inc/class.zoneclearfeedserver.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/inc/class.zoneclearfeedserver.php b/inc/class.zoneclearfeedserver.php index 8212692..d450e0e 100644 --- a/inc/class.zoneclearfeedserver.php +++ b/inc/class.zoneclearfeedserver.php @@ -427,7 +427,7 @@ class zoneclearFeedServer } # Set feeds user - $this->enableUser($s->zoneclearFeedServer_user); + $this->enableUser(true); $updates = false; $loop_mem = []; @@ -708,14 +708,17 @@ class zoneclearFeedServer { # Enable if ($enable) { + // backup current user $this->user = dcCore::app()->auth->userID(); - if (!dcCore::app()->auth->checkUser($this->user ?? '')) { + // set zcfs posts user + if (!dcCore::app()->auth->checkUser((string) dcCore::app()->blog->settings->__get(basename(dirname('../' . __DIR__)))->zoneclearFeedServer_user)) { throw new Exception('Unable to set user'); } # Disable } else { dcCore::app()->auth = null; dcCore::app()->auth = new dcAuth(); + // restore current user dcCore::app()->auth->checkUser($this->user ?? ''); } }