private function check_email($email, $new = TRUE) { $return = ''; if ($email == '') { $return .= 'Email cannot be left blank.<br />'; } if (User::check_contains_spaces($email) == TRUE) { $return .= 'Email cannot contain spaces.<br />'; } if (User::check_contains_at($email) != TRUE) { $return .= 'Email must contain an @ symbol.<br />'; } if (User::check_email_available($email) != TRUE && $new == TRUE) { $return .= 'An account with that email address already exists in the system. ' . $this->get_link_to('Click here', 'sessions', 'add') . ' to login.<br />'; } return strlen($return) > 0 ? $return : TRUE; }