mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-27 01:24:16 +00:00
Merge pull request #2193 from int2001/mail_checker
Check mail for dupes b4 editing it
This commit is contained in:
@@ -157,6 +157,8 @@ class User extends CI_Controller {
|
||||
$this->form_validation->set_rules('user_callsign', 'Callsign', 'required');
|
||||
$this->form_validation->set_rules('user_locator', 'Locator', 'required');
|
||||
$this->form_validation->set_rules('user_locator', 'Locator', 'callback_check_locator');
|
||||
$this->form_validation->set_rules('user_email', 'EMail', 'required|callback_check_email');
|
||||
$this->form_validation->set_rules('user_email', 'EMail', 'required|valid_email');
|
||||
$this->form_validation->set_rules('user_timezone', 'Timezone', 'required');
|
||||
|
||||
$data['user_add'] = true;
|
||||
@@ -380,6 +382,8 @@ class User extends CI_Controller {
|
||||
$this->form_validation->set_rules('user_lastname', 'Last name', 'required|xss_clean');
|
||||
$this->form_validation->set_rules('user_callsign', 'Callsign', 'trim|required|xss_clean');
|
||||
$this->form_validation->set_rules('user_locator', 'Locator', 'callback_check_locator');
|
||||
$this->form_validation->set_rules('user_email', 'EMail', 'required|callback_check_email');
|
||||
$this->form_validation->set_rules('user_email', 'EMail', 'required|valid_email');
|
||||
$this->form_validation->set_rules('user_timezone', 'Timezone', 'required');
|
||||
|
||||
$data['user_form_action'] = site_url('user/edit')."/".$this->uri->segment(3);
|
||||
@@ -1258,6 +1262,7 @@ class User extends CI_Controller {
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('email', 'Email', 'required');
|
||||
$this->form_validation->set_rules('email', 'Email', 'required|valid_email');
|
||||
|
||||
if ($this->form_validation->run() == FALSE)
|
||||
{
|
||||
@@ -1441,6 +1446,15 @@ class User extends CI_Controller {
|
||||
}
|
||||
}
|
||||
|
||||
function check_email($mail) {
|
||||
if (($this->session->userdata('user_email') != $mail) && ($this->user_model->exists_by_email($mail) > 0)) {
|
||||
$this->form_validation->set_message('check_email', sprintf(__("Couldn't set account to this email. Please try another address than \"%s\"."), $mail));
|
||||
return FALSE;
|
||||
} else {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
function check_locator($grid = '') {
|
||||
if (empty($grid)) {
|
||||
$grid = $this->input->post('locator', TRUE);
|
||||
|
||||
@@ -61,7 +61,7 @@ class User_Model extends CI_Model {
|
||||
|
||||
$clean_email = $this->security->xss_clean($email);
|
||||
|
||||
$this->db->where('user_email', $clean_email);
|
||||
$this->db->where('upper(user_email)', strtoupper($clean_email));
|
||||
$r = $this->db->get($this->config->item('auth_table'));
|
||||
return $r;
|
||||
}
|
||||
@@ -524,6 +524,7 @@ class User_Model extends CI_Model {
|
||||
$userdata = array(
|
||||
'user_id' => $u->row()->user_id,
|
||||
'user_name' => $u->row()->user_name,
|
||||
'user_email' => $u->row()->user_email,
|
||||
'user_type' => $u->row()->user_type,
|
||||
'user_callsign' => $u->row()->user_callsign,
|
||||
'operator_callsign' => ((($this->session->userdata('operator_callsign') ?? '') == '') ? $u->row()->user_callsign : $this->session->userdata('operator_callsign')),
|
||||
|
||||
Reference in New Issue
Block a user