Assorted Security improvements

This commit is contained in:
Peter Goodhall
2019-10-05 19:35:55 +01:00
parent 7450c14836
commit a22c0cb149
6 changed files with 58 additions and 13 deletions

View File

@@ -236,21 +236,21 @@ class User extends CI_Controller {
switch($this->user_model->edit($this->input->post())) {
// Check for errors
case EUSERNAMEEXISTS:
$data['username_error'] = 'Username <b>'.$this->input->post('user_name').'</b> already in use!';
$data['username_error'] = 'Username <b>'.$this->input->post('user_name', true).'</b> already in use!';
break;
case EEMAILEXISTS:
$data['email_error'] = 'E-mail address <b>'.$this->input->post('user_email').'</b> already in use!';
$data['email_error'] = 'E-mail address <b>'.$this->input->post('user_email', true).'</b> already in use!';
break;
case EPASSWORDINVALID:
$data['password_error'] = 'Invalid password!';
break;
// All okay, return to user screen
case OK:
if($this->session->userdata('user_id') == $this->input->post('id')) {
$this->session->set_flashdata('notice', 'User '.$this->input->post('user_name').' edited');
if($this->session->userdata('user_id') == $this->input->post('id', true)) {
$this->session->set_flashdata('notice', 'User '.$this->input->post('user_name', true).' edited');
redirect('user/profile');
} else {
$this->session->set_flashdata('notice', 'User '.$this->input->post('user_name').' edited');
$this->session->set_flashdata('notice', 'User '.$this->input->post('user_name', true).' edited');
redirect('user');
}
return;