$tpl->assign('scope_range_2_err', $scope_range_2_err, NULL, NULL);
             $tpl->assign('bootp_filename_err', $val->ValidateXSS($bootp_filename_err), NULL, NULL);
             $tpl->assign('bootp_server_err', $val->ValidateXSS($bootp_server_err), NULL, NULL);
             $tpl->assign('enable_forwarding_err', $enable_forwarding_err, NULL, NULL);
             $tpl->assign('allow_deny_err', $allow_deny_err, NULL, NULL);
             $tpl->assign('broadcast_address_err', $broadcast_address_err, NULL, NULL);
             $tpl->assign('netbios_servers_err', $netbios_servers_err, NULL, NULL);
             $tpl->assign('ntp_servers_err', $ntp_servers_err, NULL, NULL);
             $tpl->assign('default_lease_err', $default_lease_err, NULL, NULL);
             $tpl->assign('max_lease_err', $max_lease_err, NULL, NULL);
             $tpl->assign('min_lease_err', $min_lease_err, NULL, NULL);
             $tpl->assign('pools_err', $pools_err, NULL, NULL);
             $tpl->assign('list_err', $list_err, NULL, NULL);
             $tpl->assign('select_groups_err', $select_groups_err, NULL, NULL);
             // Do some cleaning before leaving
             $misc->CleanUpVars($_POST, NULL);
             // Perform analyze, repair and optimize on used tables
             $db->dbFixTable("conf_pools", $dbconn);
             $db->dbFixTable("auth_groups_perms", $dbconn);
             // Free db handle and close connection(s)
             $db->dbFreeData($dbconn);
             $db->dbCloseConn($dbconn);
         } else {
             // page view restricted by access level
             $ERROR = $err->GenerateErrorLink("help/help.html", "#undef", $defined['error'], $errors['level'], NULL, NULL);
         }
     } else {
         // general authentication error
         $ERROR = $err->GenerateErrorLink("help/help.html", "#undef", $defined['error'], $errors['auth_n'], NULL, NULL);
     }
 } else {
                 $e = "Error opening/creating file. You may need to check the permissions on the folder for write access as the web server user.";
             }
             if ($return === -2) {
                 $e = "Not a valid path for writing. Invalid directory, please check configuration options.";
             }
             if ($return === -1) {
                 $e = "Empty data for processing. An empty data block was found when attempting to write file.";
             }
         }
         $error = $err->GenerateErrorLink("help/help.html", "#build_config", $img, $e, NULL, NULL);
     }
     $tpl->assign('error', $error, NULL, NULL);
     $tpl->assign('disable', $disable, NULL, NULL);
     $tpl->assign('configdata_html', $configdata_html, NULL, NULL);
     // Do some cleaning before leaving
     $misc->CleanUpVars($_POST, NULL);
     $misc->CleanUpVars($sql, NULL);
     $misc->CleanUpVars($results, NULL);
     // Perform analyze, repair and optimize on used tables
     $db->dbFixTable("conf_global_opts", $dbconn);
     $db->dbFixTable("conf_dns_opts", $dbconn);
     $db->dbFixTable("conf_dnssec_opts", $dbconn);
     $db->dbFixTable("conf_subnets", $dbconn);
     $db->dbFixTable("conf_pxe_groups", $dbconn);
     $db->dbFixTable("conf_hosts", $dbconn);
     // Free db handle and close connection(s)
     $db->dbFreeData($dbconn);
     $db->dbCloseConn($dbconn);
 } else {
     // page view restricted by access level
     $ERROR = $err->GenerateErrorLink("help/help.html", "#undef", $defined['error'], $errors['level'], NULL, NULL);