cakephp错误512河豚用盐无效
使用教程中的一些代码制作博客,我成功地添加了用户。。。问题是当我尝试登录时,臭名昭著的512错误突然出现。如果这是来自我的core.php文件,或者与我的代码有关,你有什么想法吗 在这里,以防你想知道 视图: 以及与登录和注销功能相关的控制器功能cakephp错误512河豚用盐无效,php,cakephp,Php,Cakephp,使用教程中的一些代码制作博客,我成功地添加了用户。。。问题是当我尝试登录时,臭名昭著的512错误突然出现。如果这是来自我的core.php文件,或者与我的代码有关,你有什么想法吗 在这里,以防你想知道 视图: 以及与登录和注销功能相关的控制器功能 public function beforeFilter() { parent::beforeFilter(); // Allow users to register and logout. $this->Auth->allow('add'
public function beforeFilter() {
parent::beforeFilter();
// Allow users to register and logout.
$this->Auth->allow('add', 'logout');
}
public function login() {
if ($this->request->is('post')) {
if ($this->Auth->login()) {
return $this->redirect($this->Auth->redirect());
}
$this->Session->setFlash(__('Invalid username or password, try again'));
}
}
public function logout() {
return $this->redirect($this->Auth->logout());
}
}
可能重复尝试使用那里的代码。。它仍然给我512的错误。我不知道这是否与核心php密码有关。我在安装时是否更改了密码?因为事实证明,我的问题不是我的代码,甚至不是我的密码。。。。这与我的数据库将哈希密码设置为非常短的限制而缩短有关。。。。。算计
public function beforeSave($options = array()) {
if (isset($this->data[$this->alias]['password'])) {
$passwordHasher = new BlowfishPasswordHasher();
$this->data[$this->alias]['password'] = $passwordHasher->hash(
$this->data[$this->alias]['password']
);
}
return true;
}
}
public function beforeFilter() {
parent::beforeFilter();
// Allow users to register and logout.
$this->Auth->allow('add', 'logout');
}
public function login() {
if ($this->request->is('post')) {
if ($this->Auth->login()) {
return $this->redirect($this->Auth->redirect());
}
$this->Session->setFlash(__('Invalid username or password, try again'));
}
}
public function logout() {
return $this->redirect($this->Auth->logout());
}
}