fix again and again zcfs posts owner
This commit is contained in:
parent
7c90aea074
commit
c65ecf0c1d
@ -427,7 +427,7 @@ class zoneclearFeedServer
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Set feeds user
|
# Set feeds user
|
||||||
$this->enableUser($s->zoneclearFeedServer_user);
|
$this->enableUser(true);
|
||||||
|
|
||||||
$updates = false;
|
$updates = false;
|
||||||
$loop_mem = [];
|
$loop_mem = [];
|
||||||
@ -708,14 +708,17 @@ class zoneclearFeedServer
|
|||||||
{
|
{
|
||||||
# Enable
|
# Enable
|
||||||
if ($enable) {
|
if ($enable) {
|
||||||
|
// backup current user
|
||||||
$this->user = dcCore::app()->auth->userID();
|
$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');
|
throw new Exception('Unable to set user');
|
||||||
}
|
}
|
||||||
# Disable
|
# Disable
|
||||||
} else {
|
} else {
|
||||||
dcCore::app()->auth = null;
|
dcCore::app()->auth = null;
|
||||||
dcCore::app()->auth = new dcAuth();
|
dcCore::app()->auth = new dcAuth();
|
||||||
|
// restore current user
|
||||||
dcCore::app()->auth->checkUser($this->user ?? '');
|
dcCore::app()->auth->checkUser($this->user ?? '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user