X-Git-Url: http://git.onelab.eu/?p=www-register-wizard.git;a=blobdiff_plain;f=application%2Fcontrollers%2Fregister.php;h=847eefe3caf5d05da9f00d308ac7c90d7c334951;hp=f7f330d98209e1b3499fbaf38b87d413e67ec29f;hb=8fd1bf7b6562424a96b42bf9ad50ce851acd7cab;hpb=36cffec73e06a4ba8e9d0b4eb6e3026dc6ac637e diff --git a/application/controllers/register.php b/application/controllers/register.php index f7f330d..847eefe 100644 --- a/application/controllers/register.php +++ b/application/controllers/register.php @@ -36,6 +36,7 @@ class Register extends Controller { $this->validation->set_error_delimiters('', ''); + $rules['model'] = "trim|required"; $rules['hostname'] = "trim|required"; $rules['ip'] = "trim|required|valid_ip"; $rules['username'] = "trim"; @@ -43,6 +44,7 @@ class Register extends Controller { $rules['notes'] = "trim"; $this->validation->set_rules($rules); + $fields['model'] = "Model"; $fields['hostname'] = "Hostname"; $fields['ip'] = "IP Address"; $fields['username'] = "Username"; @@ -53,8 +55,11 @@ class Register extends Controller { $data = array(); if ($this->validation->run() == TRUE) { - /* b/c the submit is valid, it doesn't matter if pcu_register is set */ - $this->pcu_id = $this->add_pcu($data); + if ($this->validation->model != "none-selected" ) + { + /* b/c the submit is valid, it doesn't matter if pcu_register is set */ + $this->pcu_id = $this->add_pcu($data); + } } $data = $this->get_stage1_data($person, $data); $data['stage'] = 1;