mirror of
https://github.com/typecho/typecho.git
synced 2025-01-17 20:48:42 +01:00
fix #753
This commit is contained in:
parent
df7aeda761
commit
b497004516
@ -738,6 +738,7 @@ class Widget_Abstract_Contents extends Widget_Abstract
|
||||
. '" method="post">' .
|
||||
'<p class="word">' . _t('请输入密码访问') . '</p>' .
|
||||
'<p><input type="password" class="text" name="protectPassword" />
|
||||
<input type="hidden" name="protectCID" value="' . $value['cid'] . '" />
|
||||
<input type="submit" class="submit" value="' . _t('提交') . '" /></p>' .
|
||||
'</form>';
|
||||
|
||||
|
@ -809,6 +809,15 @@ class Widget_Archive extends Widget_Abstract_Contents
|
||||
$select->where('table.contents.created >= ? AND table.contents.created < ?', $from, $to);
|
||||
}
|
||||
|
||||
/** 保存密码至cookie */
|
||||
if ($this->request->isPost()
|
||||
&& isset($this->request->protectPassword)
|
||||
&& isset($this->request->protectCID)
|
||||
&& !$this->parameter->preview) {
|
||||
$this->security->protect();
|
||||
Typecho_Cookie::set('protectPassword_' . $this->request->filter('int')->protectCID, $this->request->protectPassword, 0);
|
||||
}
|
||||
|
||||
/** 匹配类型 */
|
||||
$select->limit(1);
|
||||
$this->query($select);
|
||||
@ -825,12 +834,6 @@ class Widget_Archive extends Widget_Abstract_Contents
|
||||
}
|
||||
}
|
||||
|
||||
/** 保存密码至cookie */
|
||||
if ($this->request->isPost() && isset($this->request->protectPassword) && !$this->parameter->preview) {
|
||||
$this->security->protect();
|
||||
Typecho_Cookie::set('protectPassword_' . $this->cid, $this->request->protectPassword, 0);
|
||||
}
|
||||
|
||||
/** 设置模板 */
|
||||
if ($this->template) {
|
||||
/** 应用自定义模板 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user