Example #1
0
     break;
 case "email_auto":
     $error = false;
     $data = array_map_recursive('urldecode', UrlParse($_REQUEST['data']));
     if (!$id) {
         $error = true;
     } else {
         $email = $base->SelectOne('auto_autos', array("email"), array("id" => $id));
     }
     if (empty($email['email'])) {
         $error = true;
     }
     include_once DLE_CLASSES . 'mail.class.php';
     $mail = new dle_mail($config);
     if (!$is_logged) {
         if (!auto_check_email($data['from_email'])) {
             $error = true;
         }
         if (!$data['from_name']) {
             $error = true;
         }
         $mail->from = $data['from_email'];
     } else {
         $mail->from = $member_id['email'];
     }
     if (strlen($data['text']) < 10 || strlen($data['subj']) < 5) {
         $error = true;
     }
     if ($error) {
         die("Error");
     }
Example #2
0
 protected function CheckError()
 {
     if ($this->use_country && !intval($this->values['country_id'])) {
         $this->Errors[] = $this->lang['auto_error_country'];
     }
     if ($this->use_region && !intval($this->values['region_id'])) {
         $this->Errors[] = $this->lang['auto_error_region'];
     }
     if (!intval($this->values['city_id']) && !$this->values['city_other']) {
         $this->Errors[] = $this->lang['auto_error_city'];
     }
     if (!intval($this->values['mark_id'])) {
         $this->Errors[] = $this->lang['auto_error_marka'];
     }
     if (!intval($this->values['model_id']) && !$this->values['model_other']) {
         $this->Errors[] = $this->lang['auto_error_model'];
     }
     if (!$this->values['contact_person'] && !empty($this->config['need_field']['contact_person'])) {
         $this->Errors[] = $this->lang['auto_error_contact_person'];
     }
     Licencing::check();
     if (!$this->values['year'] && !empty($this->config['need_field']['year'])) {
         $this->Errors[] = $this->lang['auto_error_year'];
     }
     if ((!$this->values['email'] || !auto_check_email($this->values['email'])) && !empty($this->config['need_field']['email'])) {
         $this->Errors[] = $this->lang['auto_error_email'];
     }
     if ((!$this->values['phone'] || !preg_match('#^[\\d- +\\(\\);:]+$#i', $this->values['phone'])) && !empty($this->config['need_field']['phone'])) {
         $this->Errors[] = $this->lang['auto_error_phone'];
     }
     if ($this->values['exp_date'] && strtotime($this->values['exp_date']) === -1) {
         $this->Errors[] = $this->lang['auto_error_exp_date'];
     }
     if ($this->values['allow_block'] && $this->values['block_date'] && strtotime($this->values['block_date']) === -1) {
         $this->Errors[] = $this->lang['auto_error_block_date'];
     }
     if ($this->values['race'] === '' && !empty($this->config['need_field']['race'])) {
         $this->Errors[] = $this->lang['auto_error_race'];
     }
     if (!$this->values['power'] && !empty($this->config['need_field']['power'])) {
         $this->Errors[] = $this->lang['auto_error_power'];
     }
     if ($this->values['model_other']) {
         $this->values['model_id'] = 0;
     }
     if (!empty($_FILES['photo']['name'][0])) {
         $this->CheckUploadError();
     }
 }