我尝试通过表单添加新用户。我使用 myth-auth 进行身份验证,但似乎数据尚未添加,但视图返回到表用户中。这是我的保存方法:
public function save()
{
$this->_user_model->withGroup($this->request->getVar('role'))->insert([
'nama_lengkap' => $this->request->getVar('nama_lengkap'),
'email' => $this->request->getVar('email'),
// 'password_hash' => password_hash($this->request->getVar('password'), PASSWORD_BCRYPT),
'password_hash' => Password::hash("123456"),
'prodi' => $this->request->getVar('prodi'),
'no_hp' => $this->request->getVar('no_hp'),
]);
session()->setFlashdata('success', 'Berhasil Menambahkan User!');
return $this->response->redirect(site_url('manage_users'));
// return redirect()->to(site_url('manage_users'));
}
我希望用户有一些默认的密码,这样当用户登录时他们可以稍后更改密码。我查看了神话验证文档和一些教程。它说这会起作用,但事实并非如此。也许我错过了什么?谢谢你。
我尝试过其他方法,例如使用构建器插入它。但它也不起作用。我希望用户有一些默认的 psw,这样当用户登录时他们可以稍后更改 psw。我查看了神话验证文档和一些教程。说这个方法行得通,但其实行不通。也许我错过了什么?谢谢你。
根据您的需求,您可以设置阈值,以便更好、更清晰地调试代码;
CI 4x:
config('Config\\Logger')->threshold = 5;
CI 3x:
application/config/config.php
$config['log_threshold'] = 0;//0-4