disable password change for demo users

This commit is contained in:
github-actions
2024-08-05 21:39:39 +02:00
parent 6eb0758b01
commit 32c4e96cbf

View File

@@ -305,11 +305,14 @@ class User_Model extends CI_Model {
// Hash password
if($fields['user_password'] != NULL)
{
if ($fields['user_password'] !== $pwd_placeholder) {
$decoded_password = htmlspecialchars_decode($fields['user_password']);
$data['user_password'] = $this->_hash($decoded_password);
if($data['user_password'] == EPASSWORDINVALID) {
return EPASSWORDINVALID;
if (!file_exists('.demo') || (file_exists('.demo') && $this->session->userdata('user_type') == 99)) {
if ($fields['user_password'] !== $pwd_placeholder) {
$decoded_password = htmlspecialchars_decode($fields['user_password']);
$data['user_password'] = $this->_hash($decoded_password);
if($data['user_password'] == EPASSWORDINVALID) {
return EPASSWORDINVALID;
}
}
}
}