This commit is contained in:
joyqi 2013-11-21 09:50:21 +08:00
parent 4fdddab33d
commit 026cb3de8b
2 changed files with 4 additions and 4 deletions

View File

@ -512,12 +512,12 @@ class Widget_Abstract_Contents extends Widget_Abstract
$value['slug'] = $tmpSlug;
$value['category'] = $tmpCategory;
/** 处理密码保护流程 */
if (!empty($value['password']) &&
$value['password'] != $this->request->protectPassword &&
($value['authorId'] != $this->user->uid
|| !$this->user->pass('editor', true))) {
$value['authorId'] != $this->user->uid &&
!$this->user->pass('editor', true)) {
$value['hidden'] = true;
/** 抛出错误 */

View File

@ -121,7 +121,7 @@ class Widget_User extends Typecho_Widget
/** 开始验证用户 **/
$user = $this->db->fetchRow($this->db->select()
->from('table.users')
->where('name = ?', $name)
->where((strpos($name, '@') ? 'mail' : 'name') . ' = ?', $name)
->limit(1));
$hashValidate = $this->pluginHandle()->trigger($hashPluggable)->hashValidate($password, $user['password']);