Tagging module www-register-wizard - www-register-wizard-4.2-2
[www-register-wizard.git] / application / controllers / register.php
index f7f330d..a6d3350 100644 (file)
@@ -36,6 +36,7 @@ class Register extends Controller {
                
                $this->validation->set_error_delimiters('<span class="error">', '</span>');
 
+               $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;
@@ -318,7 +323,6 @@ class Register extends Controller {
        function add_node(&$data)
        {
                global $api, $plc;
-               print "Adding Node\n<br>";
                $hostname = trim($_REQUEST['hostname']);
                $model= trim($_REQUEST['model']);
                $method = trim($_REQUEST['method']);
@@ -685,7 +689,6 @@ class Register extends Controller {
                }
                $data['node'] = $this->getnode($data['node_id']);
                $data['site'] = $this->getsite($data['site_id']);
-               /*print "SITENAME: " . $data['site']['login_base'] . "<BR>";*/
                return $data;
        }