Skip to content

Commit

Permalink
Merge pull request #192 from opennetadmin/develop
Browse files Browse the repository at this point in the history
fixing issue #104
Fixing issue #191
  • Loading branch information
mattpascoe authored Sep 22, 2024
2 parents 49cd54e + 81178ac commit 54446f2
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
6 changes: 2 additions & 4 deletions www/winc/app_device_model_edit.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ function ws_editor($window_name, $form='') {
// TODO: this needs to be made more efficent
list($status, $rows, $manufacturer) = db_get_records($onadb, 'manufacturers','id >= 1', 'name');
$manufacturer_list = '<option value="">&nbsp;</option>\n';
$manufacturer['name'] = htmlentities($manufacturer['name']);
foreach ($manufacturer as $entry) {
$selected = "";
// If this entry matches the record you are editing, set it to selected
Expand All @@ -63,9 +62,8 @@ function ws_editor($window_name, $form='') {


// Escape data for display in html
foreach(array_keys((array)$record) as $key) {
$record[$key] = htmlentities($record[$key], ENT_QUOTES, $conf['php_charset']);
}
foreach(array_keys((array)$record) as $key) {$record[$key] = htmlentities($record[$key], ENT_QUOTES, $conf['php_charset']);}
foreach(array_keys((array)$manufacturer_list) as $key) {$manufacturer_list[$key] = htmlentities($manufacturer_list[$key], ENT_QUOTES, $conf['php_charset']);}

// Load some html into $window['html']
$window['html'] .= <<<EOL
Expand Down
4 changes: 2 additions & 2 deletions www/winc/app_device_type_edit.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ function ws_editor($window_name, $form='') {
// Build model list
// TODO: this needs to be made more efficent
list($status, $rows, $model) = db_get_records($onadb, 'manufacturers b, models a','a.manufacturer_id = b.id and a.id >= 1', 'b.name, a.name');
$model['name'] = htmlentities($model['name']);
foreach ($model as $entry) {
$selected = "";
list($status, $rows, $manufacturer) = ona_get_manufacturer_record(array('id' => $entry['manufacturer_id']));
Expand All @@ -65,7 +64,6 @@ function ws_editor($window_name, $form='') {
// Build role list
// TODO: this needs to be made more efficent
list($status, $rows, $role) = db_get_records($onadb, 'roles','id >= 1', 'name');
$role['name'] = htmlentities($role['name']);
foreach ($role as $entry) {
$selected = "";
// If this entry matches the record you are editing, set it to selected
Expand All @@ -75,6 +73,8 @@ function ws_editor($window_name, $form='') {

// Escape data for display in html
foreach(array_keys((array)$record) as $key) {$record[$key] = htmlentities($record[$key], ENT_QUOTES, $conf['php_charset']);}
foreach(array_keys((array)$model_list) as $key) {$model_list[$key] = htmlentities($model_list[$key], ENT_QUOTES, $conf['php_charset']);}
foreach(array_keys((array)$role_list) as $key) {$role_list[$key] = htmlentities($role_list[$key], ENT_QUOTES, $conf['php_charset']);}

// Load some html into $window['html']
$window['html'] .= <<<EOL
Expand Down
1 change: 1 addition & 0 deletions www/winc/app_dhcp_option_edit.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ function ws_editor($window_name, $form='') {

// Escape data for display in html
foreach(array_keys((array)$record) as $key) {$record[$key] = htmlentities($record[$key], ENT_QUOTES, $conf['php_charset']);}
foreach(array_keys((array)$type_list) as $key) {$type_list[$key] = htmlentities($type_list[$key], ENT_QUOTES, $conf['php_charset']);}

// Load some html into $window['html']
$window['html'] .= <<<EOL
Expand Down
6 changes: 3 additions & 3 deletions www/winc/edit_subnet.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ function(ev) {
"tooltip=>qf_vlan," +
"id=>tt_qf_vlan_{$window_name}," +
"text_id=>vlan_text_{$window_name}," +
"campus_id=>set_campus_{$window_name}," +
"input_id=>set_vlan_{$window_name}');"
);
};
Expand Down Expand Up @@ -147,9 +148,9 @@ function(ev) {
value="{$vlan['number']}">
<input
type="hidden"
id="vlan_campus_{$window_name}"
id="set_campus_{$window_name}"
name="campus"
value="{$vlan['vlan_campus_id']}">
value="{$vlan['vlan_campus_name']}">
<span id="qf_vlan_{$window_name}">
<a id="vlan_text_{$window_name}"
Expand Down Expand Up @@ -334,7 +335,6 @@ function ws_save($window_name, $form='') {
// return $response;
// }


// Decide if we're editing or adding
$module = 'modify';
// If we're adding, re-map some the array names to match what the "add" module wants
Expand Down
2 changes: 1 addition & 1 deletion www/winc/search_results_qf.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ function ws_vlan($window_name, $form='') {
$html .= <<<EOL
<tr onMouseOver="this.className='row-highlight';"
onMouseOut="this.className='row-normal';"
onClick="el('{$form['input_id']}').value = '{$record['number']}'; el('{$form['text_id']}').innerHTML = '{$campus['name']} / {$record['name']}'; removeElement('{$form['id']}');">
onClick="el('{$form['input_id']}').value = '{$record['number']}'; el('{$form['campus_id']}').value = '{$campus['id']}'; el('{$form['text_id']}').innerHTML = '{$campus['name']} / {$record['name']}'; removeElement('{$form['id']}');">
<td style="font-size: 10px; padding: 0px 2px;">{$campus['name']} / [{$record['number']}] {$record['name']}</td>
</tr>
EOL;
Expand Down
1 change: 1 addition & 0 deletions www/winc/tooltips.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,7 @@ function quick_vlan_search($form) {
<input type="hidden" name="id" value="{$form['id']}">
<input type="hidden" name="input_id" value="{$form['input_id']}">
<input type="hidden" name="text_id" value="{$form['text_id']}">
<input type="hidden" name="campus_id" value="{$form['campus_id']}">
<input type="hidden" name="content_id" value="qf_vlan_results">
<table style="{$style['content_box']}" cellspacing="0" border="0" cellpadding="0">
Expand Down

0 comments on commit 54446f2

Please sign in to comment.