【发布时间】:2011-11-28 11:41:24
【问题描述】:
我的看法:
<tr>
<td>Username</td>
<td><?php echo $this->Form->input('User.username', array('label' => '')); ?></td>
</tr>
<tr>
<td>Password</td>
<td><?php echo $this->Form->password('User.password', array('label' => '', 'value'=>'')); ?></td>
</tr>
我的控制器:
function edit($id = null) {
$this->User->id = $id;
$data = $this->data;
# print_r($data);
if (empty($data)) {
$this->data = $this->User->read();
} else {
if ($this->User->save($data)) {
$this->Session->setFlash('The user details have been updated.');
$this->redirect(array('action' => 'index'));
}
}
}
当我使用空白密码提交表单时,数据库中的哈希值仍然会发生变化。如果已填写新密码,如何仅更新密码哈希。
谢谢。
编辑:$data['User']['password'] 总是一个哈希值,永远不会为空!
【问题讨论】:
-
散列出现在哪里?是蛋糕做的吗?
标签: php cakephp cakephp-1.3