Skip to content

Commit

Permalink
fix 私密动态问题
Browse files Browse the repository at this point in the history
  • Loading branch information
kraity authored Jul 21, 2020
1 parent d64fff2 commit 28a0f26
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ public function dispatch()
Typecho_Response::getInstance()
);
$dynamic->setDid($dic['did']);
$dynamic->setStatus($dic['status']);
$dynamic->setAuthorId($dic['authorId']);
$dynamic->setMail($dic['mail']);
$dynamic->setAuthorName($dic['screenName']);
$dynamic->setStatus($dic['status']);
$dynamic->setText($dic['text']);
$dynamic->setCreated($dic['created']);
$dynamic->setModified($dic['modified']);
Expand Down
3 changes: 2 additions & 1 deletion Dynamics.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
/** @noinspection DuplicatedCode */
include_once 'Dynamics_Abstract.php';
include_once 'Dynamics_Page.php';

Expand Down Expand Up @@ -46,10 +47,10 @@ public function next()
if ($this->_have) {
$dic = $this->_dynamics_list[$this->_position];
$this->setDid($dic['did']);
$this->setStatus($dic['status']);
$this->setAuthorId($dic['authorId']);
$this->setMail($dic['mail']);
$this->setAuthorName($dic['screenName']);
$this->setStatus($dic['status']);
$this->setText($dic['text']);
$this->setCreated($dic['created']);
$this->setModified($dic['modified']);
Expand Down
12 changes: 6 additions & 6 deletions Dynamics_Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ public function authorId()
public function setAuthorId($authorId)
{
$this->authorId = $authorId;
try {
$hasLogin = $this->user->pass("administrator", true);
} catch (Exception $e) {
$hasLogin = false;
}
$this->visualAble = $hasLogin ? true : ($this->status == "private" ? false : true);
}

public function authorName()
Expand Down Expand Up @@ -148,6 +142,12 @@ public function status()
public function setStatus($status)
{
$this->status = $status;
try {
$hasLogin = $this->user->pass("administrator", true);
} catch (Exception $e) {
$hasLogin = false;
}
$this->visualAble = $hasLogin ? true : ($this->status == "private" ? false : true);
}

public function url()
Expand Down

0 comments on commit 28a0f26

Please sign in to comment.