Beispiel #1
0
 public function do_validate()
 {
     if (!$this->agree) {
         $this->validation_errors['agree'] = 'You must agree to the terms to continue';
     }
     if (!empty($this->coords) && !preg_match('/^((h[l-z]|n[a-hj-z]|s[a-hj-z]|t[abfglmqrvw])[0-9]{6};?){2,5}$/i', $this->coords)) {
         $this->validation_errors['coords'] = 'Coordinated are not valid';
     }
     return parent::do_validate();
 }
Beispiel #2
0
 public function do_validate()
 {
     parent::do_validate();
     if (!isset($this->validation_errors['coords']) && !empty($this->coords) && !preg_match('/^((h[l-z]|n[a-hj-z]|s[a-hj-z]|t[abfglmqrvw])[0-9]{6};?){2,5}$/i', $this->coords)) {
         $this->validation_errors['coords'] = 'Coordinated are not valid';
     }
     if (!isset($this->validation_errors['kml']) && !isset($_FILES['kml']['tmp_name'])) {
         $this->validation_errors['kml'] = 'Your browser has not sent the correct data to the server. Please upgrade your browser!';
     }
     return count($this->validation_errors) == 0;
 }
Beispiel #3
0
 public function do_validate()
 {
     parent::do_validate();
     $user = new _cms_user();
     $user->do_retrieve([], ['where_equals' => ['title' => $this->username, 'password' => md5($this->password)]]);
     if ($user->get_primary_key()) {
         $user->last_login = time();
         $user->last_login_ip = ip;
     } else {
         $this->validation_errors['username'] = '******';
     }
     return !count($this->validation_errors);
 }
Beispiel #4
0
 public function do_validate()
 {
     if (!$this->agree) {
         $this->validation_errors['agree'] = 'You must agree to the terms to continue';
     }
     return parent::do_validate();
 }