Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing issue #104 #192

Merged
merged 3 commits into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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