ona  18.1.1
About: OpenNetAdmin provides a database managed inventory of your IP network (with Web and CLI interface).
  Fossies Dox: ona-18.1.1.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

edit_host.inc.php
Go to the documentation of this file.
1 <?php
2 
3 
4 
6 // Function: ws_editor($window_name, $form)
7 //
8 // Description:
9 // Displays a form for creating/editing a host record.
10 //
11 // Input:
12 // $window_name the name of the "window" to use.
13 // $form A string-based-array or an array or a host ID.
14 // The string-based-array would usually look something like this:
15 // host_id=>123,js=>some('javascript');
16 // If $form is a valid record ID, it is used to display and edit
17 // that record. Otherwise the form will let you add a new record.
18 // The "Save" button calls the ws_save() function in this file.
19 // Notes:
20 // If there is a "js" field passed in that contains javascript it will be
21 // sent to the browser after the ws_save() function is called.
23 function ws_editor($window_name, $form='') {
24  global $conf, $self, $onadb;
26  $window = array();
27 
28  // Check permissions
29  if (! (auth('host_modify') or auth('host_add')) ) {
30  $response = new xajaxResponse();
31  $response->addScript("alert('Permission denied!');");
32  return($response->getXML());
33  }
34 
35  // If an array in a string was provided, build the array and store it in $form
36  $form = parse_options_string($form);
37 
38  // Load an existing host record (and associated info) if $form is a host_id
39  $host = array('fqdn' => '.','domain_fqdn' => $conf['dns_defaultdomain']);
40  $interface = array();
41  if (is_numeric($form['host_id'])) {
42  list($status, $rows, $host) = ona_get_host_record(array('id' => $form['host_id']));
43  if ($rows) {
44  // Load associated INTERFACE record(s)
45  list($status, $interfaces, $interface) = ona_get_interface_record(array('host_id' => $host['id']));
46  list($status, $rows, $subnet) = ona_get_subnet_record(array('id' => $interface['subnet_id']));
47  $interface['ip_addr'] = ip_mangle($interface['ip_addr'], 'dotted');
48  if ($interface['mac_addr'])
49  $interface['mac_addr'] = mac_mangle($interface['mac_addr'], 2); //FIXME: (PK) should not use numeric format specifier here!
50  }
51  }
52  // If there is no hostid in the form
53  else {
54  if (strlen($form['ip_addr']) > 1) $interface['ip_addr'] = $form['ip_addr'];
55  if (strlen($form['hostname']) > 1) $host['name'] = $form['hostname'];
56  }
57 
58  // Set the default security level if there isn't one
59  if (!array_key_exists('lvl', $host)) $host['lvl'] = $conf['ona_lvl'];
60 
61  // Load a subnet record if we got passed a subnet_id
62  if ($form['subnet_id'])
63  list($status, $rows, $subnet) = ona_get_subnet_record(array('id' => $form['subnet_id']));
64 
65  // Load a domain record if we got passed a domain_id
66  if ($form['domain_id']) {
67  list($status, $rows, $domain) = ona_get_domain_record(array('id' => $form['domain_id']));
68  $host['domain_fqdn'] = $domain['fqdn'];
69  }
70 
71  // If we dont have a domain_fqdn yet.. lets use the system default domain
72  if (!$host['domain_fqdn']) $host['domain_fqdn'] = $conf['dns_defaultdomain'];
73 
74  // Build a device_types list
75  list($status, $rows, $records) = db_get_records($onadb, 'device_types', 'id >= 1');
76  $device_types = array();
77  foreach ($records as $type) {
78  list($status, $rows, $model) = ona_get_model_record(array('id' => $type['model_id']));
79  list($status, $rows, $role) = ona_get_role_record(array('id' => $type['role_id']));
80  list($status, $rows, $manufacturer) = ona_get_manufacturer_record(array('id' => $model['manufacturer_id']));
81  $device_types[$type['id']] = "{$manufacturer['name']} {$model['name']} ({$role['name']})";
82  }
83  asort($device_types);
84 
85  list($status, $rows, $device) = ona_get_device_record(array('id' => $host['device_id']));
86  list($status, $rows, $location) = ona_get_location_record(array('id' => $device['location_id']));
87 
88  $host['location'] = $location['reference'];
89 
90  $device_model_list = "<option value=\"\"></option>\n";
91  foreach (array_keys((array)$device_types) as $id) {
92  $device_types[$id] = htmlentities($device_types[$id]);
93  $selected = '';
94 
95  if ($id == $device['device_type_id']) { $selected = 'SELECTED'; }
96  $device_model_list .= "<option value=\"{$id}\" {$selected}>{$device_types[$id]}</option>\n";
97  }
98  unset($device_types, $device, $manufacturer, $role, $model, $records);
99 
100  //Get the list of DNS views
101  if ($conf['dns_views']) {
102  list($status, $rows, $dnsviews) = db_get_records($onadb, 'dns_views','id >= 0', 'name');
103 
104  foreach ($dnsviews as $entry) {
105  $selected = '';
106  //$dnsviews['name'] = htmlentities($dnsviews['name']);
107 
108  // If this entry matches the record you are editing, set it to selected
109  if ($host['id'] and $entry['id'] == $host['dns_view_id']) {
110  $selected = "SELECTED=\"selected\"";
111  $dns_view_name = $entry['name'].'/';
112  } elseif (!$host['id'] and $entry['id'] == 0) {
113  // Otherwise use the default record if we are adding a new entry
114  $selected = "SELECTED=\"selected\"";
115  $dns_view_name = $entry['name'].'/';
116  }
117  $dns_view_list .= "<option {$selected} value=\"{$entry['id']}\">{$entry['name']}</option>\n";
118  }
119  }
120 
121  // Escape data for display in html
122  foreach(array_keys((array)$host) as $key) { $host[$key] = htmlentities($host[$key], ENT_QUOTES, $conf['php_charset']); }
123  foreach(array_keys((array)$subnet) as $key) { $subnet[$key] = htmlentities($subnet[$key], ENT_QUOTES, $conf['php_charset']); }
124  foreach(array_keys((array)$interface) as $key) { $interface[$key] = htmlentities($interface[$key], ENT_QUOTES, $conf['php_charset']); }
125 
126 
127  // Set the window title:
128  $window['title'] = "Add Host";
129  if ($host['id'])
130  $window['title'] = "Edit Host";
131  else
132  unset($dns_view_name);
133 
134  // Javascript to run after the window is built
135  $window['js'] = <<<EOL
136  /* Put a minimize icon in the title bar */
137  el('{$window_name}_title_r').innerHTML =
138  '&nbsp;<a onClick="toggle_window(\'{$window_name}\');" title="Minimize window" style="cursor: pointer;"><img src="{$images}/icon_minimize.gif" border="0" /></a>' +
139  el('{$window_name}_title_r').innerHTML;
140 
141  /* Put a help icon in the title bar */
142  el('{$window_name}_title_r').innerHTML =
143  '&nbsp;<a href="{$_ENV['help_url']}{$window_name}" target="null" title="Help" style="cursor: pointer;"><img src="{$images}/silk/help.png" border="0" /></a>' +
144  el('{$window_name}_title_r').innerHTML;
145 
146  suggest_setup('set_domain_{$window_name}', 'suggest_set_domain_{$window_name}');
147  suggest_setup('set_location_{$window_name}', 'suggest_set_location_{$window_name}');
148 
149  /* Setup the Quick Find location icon */
150 
151  var _button = el('qf_location_{$window_name}');
152  _button.style.cursor = 'pointer';
153  _button.onclick =
154  function(ev) {
155  if (!ev) ev = event;
156  /* Create the popup div */
157  wwTT(this, ev,
158  'id', 'tt_qf_location_{$window_name}',
159  'type', 'static',
160  'direction', 'south',
161  'delay', 0,
162  'styleClass', 'wwTT_qf',
163  'javascript',
164  "xajax_window_submit('tooltips', '" +
165  "tooltip=>qf_location," +
166  "id=>tt_qf_location_{$window_name}," +
167  "input_id=>set_location_{$window_name}');"
168  );
169  };
170 
171  el('set_host').focus();
172 EOL;
173 
174  // If we are modifying do not allow them to edit/change dns names. this should only be done when creating a new host
175  $hideit='';
176  if ($host['id']) $hideit='style="display: none;"';
177 
178  // Define the window's inner html
179  $window['html'] = <<<EOL
180 
181  <!-- Host Edit Form -->
182  <form id="{$window_name}_edit_form" onSubmit="return false;">
183  <input type="hidden" name="host" value="{$dns_view_name}{$host['fqdn']}">
184  <input type="hidden" name="interface" value="{$interface['id']}">
185  <input type="hidden" name="js" value="{$form['js']}">
186  <table cellspacing="0" border="0" cellpadding="0" style="background-color: {$color['window_content_bg']}; padding-left: 20px; padding-right: 20px; padding-top: 5px; padding-bottom: 5px;">
187 
188  <!-- HOST RECORD -->
189  <tr>
190  <td align="left" nowrap="true">
191  <b><u>Host Record</u></b>&nbsp;
192  </td>
193  <td class="padding" align="left" width="100%">
194  &nbsp;
195  </td>
196  </tr>
197 EOL;
198 
199  // Print a dns view selector
200  if ($conf['dns_views']) {
201  $window['html'] .= <<<EOL
202  <tr {$hideit}>
203  <td align="right" nowrap="true">
204  DNS View
205  </td>
206  <td class="padding" align="left" width="100%">
207  <select
208  id="dns_view_select"
209  name="set_view"
210  alt="DNS View"
211  class="edit"
212  >{$dns_view_list}</select>
213  </td>
214  </tr>
215 
216 EOL;
217  }
218 
219  $window['html'] .= <<<EOL
220  <tr {$hideit}>
221  <td class="input_required" align="right" nowrap="true">
222  DNS Name
223  </td>
224  <td class="padding" align="left" width="100%">
225  <input
226  id="set_host"
227  name="set_host"
228  alt="Hostname"
229  value="{$host['name']}"
230  class="edit"
231  type="text"
232  size="20" maxlength="64"
233  >
234  </td>
235  </tr>
236 
237  <tr {$hideit}>
238  <td class="input_required" align="right" nowrap="true">
239  Domain
240  </td>
241  <td class="padding" align="left" width="100%">
242  <input
243  id="set_domain_{$window_name}"
244  name="set_domain"
245  alt="Domain name"
246  value="{$host['domain_fqdn']}"
247  class="edit"
248  type="text"
249  size="25" maxlength="64"
250  >
251  <div id="suggest_set_domain_{$window_name}" class="suggest"></div>
252  </td>
253  </tr>
254 
255  <tr>
256  <td class="input_required" align="right" nowrap="true">
257  Device type
258  </td>
259  <td class="padding" align="left" width="100%">
260  <select
261  name="set_type"
262  alt="Device type"
263  class="edit"
264  >{$device_model_list}</select>
265  </td>
266  </tr>
267 
268  <tr>
269  <td align="right" nowrap="true">
270  Notes
271  </td>
272  <td class="padding" align="left" width="100%">
273  <textarea name="set_notes" class="edit" cols="40" rows="1">{$host['notes']}</textarea>
274  </td>
275  </tr>
276  <tr>
277  <td align="right" nowrap="true">
278  Location
279  </td>
280  <td class="padding" align="left" width="100%">
281  <input
282  id="set_location_{$window_name}"
283  name="set_location"
284  alt="Location"
285  value="{$host['location']}"
286  class="edit"
287  type="text"
288  size="7" maxlength="10"
289  >
290  <div id="suggest_set_location_{$window_name}" class="suggest"></div>
291  <span id="qf_location_{$window_name}" title="Location Quick Search"><img src="{$images}/silk/find.png" border="0"/></span>
292  </td>
293  </tr>
294 EOL;
295 
296  // Display an interface edit section if it's a new host or there were exactly one interface.
297  if (!$interfaces) {
298  $window['js'] .= <<<EOL
299 
300  /* Setup the Quick Find for available IPs */
301  var _button = el('qf_free_ip_{$window_name}');
302  _button.style.cursor = 'pointer';
303  _button.onclick =
304  function(ev) {
305  if (!ev) ev = event;
306  /* Create the popup div */
307  wwTT(this, ev,
308  'id', 'tt_qf_free_ip_{$window_name}',
309  'type', 'static',
310  'direction', 'south',
311  'delay', 0,
312  'styleClass', 'wwTT_qf',
313  'javascript',
314  "xajax_window_submit('tooltips', '" +
315  "tooltip=>qf_free_ip," +
316  "id=>tt_qf_free_ip_{$window_name}," +
317  "text_id=>associated_subnet_{$window_name}," +
318  "text_value=>" + el('associated_subnet_{$window_name}').innerHTML + "," +
319  "input_id=>set_ip_{$window_name}');"
320  );
321  };
322 
323 EOL;
324 
325  $window['html'] .= <<<EOL
326 
327  <!-- FIRST INTERFACE -->
328  <tr>
329  <td align="left" nowrap="true">
330  <b><u>Interface</u></b>&nbsp;
331  </td>
332  <td class="padding" align="left" width="100%">
333  &nbsp;
334  </td>
335  </tr>
336 
337  <tr>
338  <td align="right" nowrap="true">
339  Subnet
340  </td>
341  <td class="padding" align="left" width="100%" nowrap="true">
342  <span id="associated_subnet_{$window_name}"
343  >{$subnet['name']}</span>
344  </td>
345  </tr>
346 
347  <tr>
348  <td class="input_required" align="right" nowrap="true">
349  IP Address
350  </td>
351  <td class="padding" align="left" width="100%">
352  <input
353  id="set_ip_{$window_name}"
354  name="set_ip"
355  alt="IP Address"
356  value="{$interface['ip_addr']}"
357  class="edit"
358  type="text"
359  size="25" maxlength="64"
360  >
361  <span id="qf_free_ip_{$window_name}" title="Available IP Quick Search"><img src="{$images}/silk/find.png" border="0"/></span>
362  <div id="suggest_set_ip_{$window_name}" class="suggest"></div>
363  </td>
364  </tr>
365 
366  <tr>
367  <td align="right" nowrap="true">
368  MAC Address
369  </td>
370  <td class="padding" align="left" width="100%">
371  <input
372  name="set_mac"
373  alt="MAC Address"
374  value="{$interface['mac_addr']}"
375  class="edit"
376  type="text"
377  size="17" maxlength="17"
378  >
379  <a class="nav" onClick="this.style.display = 'none'; el('force_{$window_name}').style.display = browser.isIE ? 'block' : 'table-row';">More >></a>
380  </td>
381  </tr>
382 
383  <tr id="force_{$window_name}" style="display: none;">
384  <td align="right" nowrap="true">
385  &nbsp;
386  </td>
387  <td class="padding" align="left" width="100%">
388  <input
389  name="force"
390  alt="Allow duplicate MAC addresses"
391  type="checkbox"
392  > Allow duplicate MAC addresses
393  </td>
394  </tr>
395 
396  <tr>
397  <td align="right" nowrap="true">
398  Interface name
399  </td>
400  <td class="padding" align="left" width="100%">
401  <input
402  name="set_name"
403  alt="Interface name"
404  value="{$interface['name']}"
405  class="edit"
406  type="text"
407  size="17" maxlength="255"
408  >
409  </td>
410  </tr>
411 
412  <tr>
413  <td align="right" nowrap="true">
414  Interface description
415  </td>
416  <td class="padding" align="left" width="100%">
417  <input
418  name="set_description"
419  alt="Interface description"
420  value="{$interface['description']}"
421  class="edit"
422  type="text"
423  size="25" maxlength="255"
424  >
425  </td>
426  </tr>
427 EOL;
428  }
429 
430  if (!$host['id']) {
431  $window['html'] .= <<<EOL
432  <td align="right" nowrap="true">
433  Auto create PTR
434  </td>
435  <td class="padding" align="left" width="100%" nowrap>
436  <input
437  id="set_addptr"
438  name="set_addptr"
439  alt="Automaticaly create PTR record"
440  type="checkbox"
441  checked="1"
442  />
443  </td>
444  <tr>
445  <td align="right" nowrap="true">
446  &nbsp;
447  </td>
448  <td class="padding" align="left" width="100%">
449  <input
450  name="keepadding"
451  alt="Keep adding more hosts"
452  type="checkbox"
453  > Keep adding more hosts
454  </td>
455  </tr>
456 
457  <tr>
458  <td colspan="2" class="padding" align="center" width="100%">
459  <span id="statusinfo_{$window_name}" style="color: green;" ></span>
460  </td>
461  </tr>
462 
463 EOL;
464  }
465 
466  $window['html'] .= <<<EOL
467 
468  <tr>
469  <td align="right" valign="top" nowrap="true">
470  &nbsp;
471  </td>
472  <td class="padding" align="right" width="100%">
473  <input class="edit" type="button" name="cancel" value="Cancel" onClick="removeElement('{$window_name}');">
474  <input class="edit" type="button"
475  name="submit"
476  value="Save"
477  accesskey=" "
478  onClick="xajax_window_submit('{$window_name}', xajax.getFormValues('{$window_name}_edit_form'), 'save');"
479  >
480  </td>
481  </tr>
482 
483  </table>
484  </form>
485 EOL;
486 
487  return(window_open($window_name, $window));
488 }
489 
490 
491 
492 
493 
494 
495 
496 
498 // Function:
499 // Save Form
500 //
501 // Description:
502 // Creates/updates a host record.
504 function ws_save($window_name, $form='') {
505  global $include, $conf, $self, $onadb;
506 
507  // Check permissions
508  if (! (auth('host_modify') or auth('host_add')) ) {
509  $response = new xajaxResponse();
510  $response->addScript("alert('Permission denied!');");
511  return($response->getXML());
512  }
513 
514  // Instantiate the xajaxResponse object
515  $response = new xajaxResponse();
516  $js = '';
517  // Validate input
518  if ($form['set_type'] == '' or
519  /* Interface input: required only if adding a host */
520  ($form['host'] == '.' and $form['set_ip'] == '')
521  ) {
522  $response->addScript("alert('Please complete all fields to continue!');");
523  return($response->getXML());
524  }
525 
526  // Since we're adding two records (host and an interface)
527  // we need to do a little validation here to make sure things
528  // have a good chance of working!
529 
530  // Validate the "set_host" name is valid
531  $form['set_host'] = sanitize_hostname(trim($form['set_host']));
532  if (!$form['set_host']) {
533  $response->addScript("alert('Invalid hostname!');");
534  return($response->getXML());
535  }
536  // Validate domain is valid
537 // list($status, $rows, $domain) = ona_find_domain($form['set_domain'],0);
538 // if ($status or !$rows) {
539 // $response->addScript("alert('Invalid domain!');");
540 // return($response->getXML());
541 // }
542  // Make sure the IP address specified is valid
543  if ($form['host'] != '.' and $form['set_ip']) {
544  $form['set_ip'] = ip_mangle($form['set_ip'], 'dotted');
545  if ($form['set_ip'] == -1) {
546  $response->addScript("alert('{$self['error']}');");
547  return($response->getXML());
548  }
549  }
550 
551  if ($form['set_addptr'] == '') $form['set_addptr'] = 'N';
552 
553  // FIXME: If we're editing, validate the $form['host'] is valid
554  // FIXME: If we're editing, validate the $form['interface'] is valid
555  // FIXME: Verify that the device "type" ID is valid (not a big risk since they select from a drop-down)
556 
557  // If no location is passed, make sure the value is 0
558  // if (array_key_exists('set_location', $form)) $form['set_location'] = 0;
559 
560  // Decide if we're editing or adding
561  $module = 'modify';
562  // If we're adding, re-map some the array names to match what the "add" module wants
563  if ($form['host'] == '.') {
564  $module = 'add';
565 
566  if (!auth('host_add')) {
567  $response = new xajaxResponse();
568  $response->addScript("alert('Permission denied!');");
569  return($response->getXML());
570  }
571 
572  // Device options
573  $form['type'] = $form['set_type']; unset($form['set_type']);
574  $form['location'] = $form['set_location']; unset($form['set_location']);
575 
576  // Host options
577  $form['domain'] = $form['set_domain'];
578  $form['host'] = $form['set_host'] . '.' . $form['set_domain']; unset($form['set_host']); unset($form['set_domain']);
579  $form['notes'] = $form['set_notes']; unset($form['set_notes']);
580  $form['description'] = $form['set_description']; unset($form['set_description']);
581  $form['view'] = $form['set_view']; unset($form['set_view']);
582 
583  // Interface options
584  $form['ip'] = $form['set_ip']; unset($form['set_ip']);
585  $form['mac'] = $form['set_mac']; unset($form['set_mac']);
586  $form['name'] = $form['set_name']; unset($form['set_name']);
587  $form['addptr'] = $form['set_addptr']; unset($form['set_addptr']);
588  // If there's no "refresh" javascript, add a command to view the new host
589  if (!preg_match('/\w/', $form['js'])) $form['js'] = "xajax_window_submit('work_space', 'xajax_window_submit(\'display_host\', \'host=>{$form['host']}\', \'display\')');";
590  }
591  else {
592  $form['set_host'] .= '.' . $form['set_domain'];
593  }
594 
595  // Do a pre check of the ptr domain so we can prompt the user properly
596  if ($module == 'add') {
597  $ipflip = ip_mangle($form['ip'],'flip');
598  $octets = explode(".",$ipflip);
599  if (count($octets) > 4 ) {
600  $arpa = '.ip6.arpa';
601  $octcount = 31;
602  } else {
603  $arpa = '.in-addr.arpa';
604  $octcount = 3;
605  }
606  list($status, $rows, $ptrdomain) = ona_find_domain($ipflip.$arpa);
607  if (!$ptrdomain['id']) {
608  printmsg("ERROR => This operation tried to create a PTR record that is the first in this IP address space. You must first create at least the following DNS domain: {$octets[$octcount]}.in-addr.arpa",3);
609  $self['error'] = "ERROR => This operation tried to create a PTR record that is the first in this IP address space.<br>You must first create at least the following DNS domain: <b>{$octets[$octcount]}.in-addr.arpa</b>.<br>You could also create domains at deeper level reverse zones if desired.<br>We have opened the add domain dialog for you.";
610  $response->addScript("alert('{$self['error']}');xajax_window_submit('edit_domain', 'newptrdomainname=>{$octets[$octcount]}{$arpa}', 'editor');");
611  return($response->getXML());
612  }
613  }
614 
615  // Run the module to ADD the HOST AND INTERFACE, or MODIFY THE HOST.
616  list($status, $output) = run_module('host_'.$module, $form);
617 
618  // If the module returned an error code display a popup warning
619  if ($status)
620  $js .= "alert('Save failed.\\n". preg_replace('/[\s\']+/', ' ', $self['error']) . "');";
621  else {
622  // Run the module to MODIFY THE INTERFACE if we need to
623  if ($module == 'modify' and $form['set_ip']) {
624  list($status, $output) = run_module('interface_'.$module, $form);
625  }
626  // If the module returned an error code display a popup warning
627  if ($status and $module == 'modify' and $form['set_ip'])
628  $js .= "alert('Interface update failed.\\n". preg_replace('/[\s\']+/', ' ', $self['error']) . "');";
629  else {
630  // if they have checked the keep adding hosts box then dont remove the window
631  if (!$form['keepadding'])
632  $js .= "removeElement('{$window_name}');";
633  else {
634  $js .= "el('statusinfo_{$window_name}').innerHTML = 'Previously added:<br>{$form['host']} => {$form['ip']}';";
635  }
636 
637  if ($form['js']) $js .= $form['js'];
638  }
639  }
640 
641  // Insert the new table into the window
642  $response->addScript($js);
643  return($response->getXML());
644 }
645 
646 
647 
648 
649 
650 
651 
653 // Function:
654 // Delete Form
655 //
656 // Description:
657 // Deletes a host record. $form should be an array with a 'host_id'
658 // key defined and optionally a 'js' key with javascript to have the
659 // browser run after a successful delete.
661 function ws_delete($window_name, $form='') {
662  global $include, $conf, $self, $onadb;
663 
664  // Check permissions
665  if (!auth('host_del')) {
666  $response = new xajaxResponse();
667  $response->addScript("alert('Permission denied!');");
668  return($response->getXML());
669  }
670 
671  // If an array in a string was provided, build the array and store it in $form
672  $form = parse_options_string($form);
673 
674  // Instantiate the xajaxResponse object
675  $response = new xajaxResponse();
676  $js = '';
677 
678  // Run the module
679  list($status, $output) = run_module('host_del', array('host' => $form['host_id'], 'commit' => $form['commit']));
680 
681  // If commit was N, display the confirmation dialog box
682  if (!$form['commit']) {
683  $build_commit_html = 1;
684  $commit_function = 'delete';
685  include(window_find_include('module_results'));
686  return(window_open("{$window_name}_results", $window));
687  }
688 
689  // If the module returned an error code display a popup warning
690  if ($status)
691  $js .= "alert('Delete failed. " . preg_replace('/[\s\']+/', ' ', $output) . "');";
692  else if ($form['js'])
693  $js .= $form['js']; // usually js will refresh the window we got called from
694 
695  // Return an XML response
696  $response->addScript($js);
697  return($response->getXML());
698 }
699 
700 
701 
702 ?>
ona_get_host_record
ona_get_host_record($array='', $order='')
Definition: functions_db.inc.php:1106
ona_get_manufacturer_record
ona_get_manufacturer_record($array)
Definition: functions_db.inc.php:1210
ona_get_location_record
ona_get_location_record($array='', $order='')
Definition: functions_db.inc.php:1122
ona_find_domain
ona_find_domain($fqdn="", $returndefault=0)
Definition: functions_db.inc.php:1609
ona_get_device_record
ona_get_device_record($array)
Definition: functions_db.inc.php:1218
Name
Full Name
Definition: app_user_info.inc.php:101
ip_mangle
ip_mangle($ip="", $format="default")
Definition: functions_general.inc.php:308
ona_get_interface_record
ona_get_interface_record($array='', $order='')
Definition: functions_db.inc.php:1126
window_find_include
window_find_include($window_name)
Definition: webwin.inc.php:204
db_get_records
db_get_records($dbh=0, $table="", $where="", $order="", $rows=-1, $offset=-1)
Definition: functions_db.inc.php:891
$status
$status
Definition: install.php:12
$onadb
global $onadb
Definition: 2-to-3.php:15
mac_mangle
mac_mangle($input="", $format="default")
Definition: functions_general.inc.php:964
ona_get_role_record
ona_get_role_record($array)
Definition: functions_db.inc.php:1222
$window
$window['title']
Definition: install.php:26
ona_get_model_record
ona_get_model_record($array)
Definition: functions_db.inc.php:1197
printmsg
if(6<=$conf['debug']) printmsg($msg="", $debugLevel=0)
Definition: functions_general.inc.php:48
_button
_button
Definition: app_advanced_search.inc.php:48
ws_save
ws_save($window_name, $form='')
Definition: edit_host.inc.php:504
$include
$include
Definition: 2-to-3.php:10
window_open
window_open($window_name, $window=array())
Definition: webwin.inc.php:59
$type
$type
Definition: dcm.php:17
$host
$host
Definition: collate-convert.php:19
run_module
run_module($module='', $options='', $transaction=1)
Definition: functions_general.inc.php:1468
$images
$images
Definition: config.inc.php:26
EOL
< a style="text-decoration: none;" href="/">< input class='edit' type="button" value="I don't like free stuff?" onclick=""/></a ></center ></div > EOL
Definition: install.php:40
sanitize_hostname
sanitize_hostname($string="")
Definition: functions_general.inc.php:900
$conf
global $conf
Definition: 2-to-3.php:15
xajaxResponse
Definition: xajaxResponse.inc.php:68
$style
$style['font-family']
Definition: config.inc.php:158
nbsp
& nbsp
Definition: install.php:36
ona_get_domain_record
ona_get_domain_record($array='', $order='')
Definition: functions_db.inc.php:1134
$font_family
global $font_family
Definition: app_admin_tools.inc.php:4
$output
$output
Definition: dcm.php:16
$self
global $self
Definition: 2-to-3.php:15
ws_delete
ws_delete($window_name, $form='')
Definition: edit_host.inc.php:661
auth
auth($resource, $msg_level=1)
Definition: functions_general.inc.php:1330
ws_editor
ws_editor($window_name, $form='')
Definition: edit_host.inc.php:23
ona_get_subnet_record
ona_get_subnet_record($array)
Definition: functions_db.inc.php:1226
$color
if($_SERVER['SERVER_PORT']==443) $color['bg']
Definition: config.inc.php:119
parse_options_string
parse_options_string($input)
Definition: xajax_setup.inc.php:88