19 printmsg(
"DEBUG => Displaying tooltip: {$form['tooltip']}", 4);
21 switch ($form[
'tooltip']) {
31 list ($html, $js) = get_start_menu_html();
35 list ($html, $js) = get_local_menu_html();
39 $record[
'location_id'] = $form[
'location_id'];
40 $extravars[
'tipstyle'] =
'style="color: #FFFFFF;background-color: #4c4c4c;border: none;"';
65 case 'qf_pool_server':
69 case 'quick_interface_menu':
73 case 'quick_interface_move':
77 case 'quick_interface_nat':
81 case 'quick_interface_share':
89 case 'host_interface_list':
97 case 'interface_cluster_list':
101 case 'switchport_template_select':
114 $response->addScript(
"el('{$form['id']}').style.visibility = 'hidden';");
115 $response->addAssign($form[
'id'],
"innerHTML", $html);
116 $response->addScript(
"wwTT_position('{$form['id']}'); el('{$form['id']}').style.visibility = 'visible';");
117 if ($js) { $response->addScript($js); }
118 return($response->getXML());
127 return strcmp($a[
"name"], $b[
"name"]);
148 usort($tags,
'tagsort');
149 foreach ( $tags as $tag ) {
151 <span
id=
"tagname_{$tag['name']}{$tag['id']}" 156 if (
auth(
'host_del') or
auth(
'subnet_del')) {
158 onmouseover=
"el('tagdel_{$tag['name']}{$tag['id']}').style.display='';" 159 onmouseout=
"el('tagdel_{$tag['name']}{$tag['id']}').style.display='none';" 164 >{$tag[
'name']}<span
id=
"tagdel_{$tag['name']}{$tag['id']}" 167 onClick=
"xajax_window_submit('edit_tag', 'id => {$tag['id']}', 'delete');el('tagname_{$tag['name']}{$tag['id']}').style.display='none';">x</span></span>
172 if ( $c > 5 ) { $html .=
"<br>"; $c=1; }
176 $response->addAssign($form[
'updateid'],
"innerHTML", $html);
178 $response->addScript(
"tagTdWidth=el('tagname_{$tag['name']}{$tag['id']}').parentNode.parentNode.offsetWidth+8;el('tagname_{$tag['name']}{$tag['id']}').parentNode.parentNode.setAttribute('style','width:'+tagTdWidth+'px');");
179 return($response->getXML());
203 return(array($html, $js));
206 <div style=
"overflow: auto;max-height: 100px;">
207 <table style=
"cursor: pointer;" width=
"100%" cellspacing=
"0" border=
"0" cellpadding=
"0">
208 <tbody style=
"max-height: 100px;overflow: auto;overflow-x: hidden;">
211 foreach ($messages as
$record) {
213 if (strtotime(
$record[
'expiration']) < time()) {
225 $priorityimg =
"<img src=\"{$images}/silk/bullet_blue.png\" border=\"0\" />";
228 $priorityimg =
"<img src=\"{$images}/silk/bullet_red.png\" border=\"0\" />";
231 $priorityimg =
"<img src=\"{$images}/silk/bullet_yellow.png\" border=\"0\" />";
234 $priorityimg =
"<img src=\"{$images}/silk/bullet_green.png\" border=\"0\" />";
242 $cleandate = date(
"m/d-h:i a",strtotime(
$record[
'mtime']));
243 $expire = strtotime(
$record[
'expiration']) .
"/" . time() .
"=". $test;
246 <tr style=
"height: 10px;" 247 onMouseOver=
"this.className='row-highlight';" 248 onMouseOut=
"this.className='row-normal';" 250 <td nowrap=
"true" title=
"{$record['mtime']} - Priority level: {$record['priority']} - Expires: {$record['expiration']}" valign=
"top" style=
"font-size: 10px; pad 251 ding: 0px 3px;">{$cleandate} {$priorityimg}</td>
252 <td nowrap=
"true" valign=
"top" align=
"right" style=
"font-size: 10px; padding: 0px 0px;">{
$record[
'username']} =></td>
253 <td width=
"200" style=
"font-size: 10px; padding: 0px 2px;padding-right: 20px;">{
$record[
'message_text']}</td>
258 if ($expire_count > 0 ) {
260 <tr
class=
"row-highlight" >
261 <td colspan=3 align=
"center" nowrap=
"true" valign=
"top" style=
"font-size: 10px; padding: 0px 3px;">There are {$expire_count} expired records not displayed</td>
267 </tbody></table></div>
270 return(array($html, $js));
311 <!-- SYS MESSAGES -->
312 <form
id=
"sys_alert_form" onSubmit=
"return(false);">
313 <input type=
"hidden" name=
"id" value=
"{$form['id']}">
314 <input type=
"hidden" name=
"input_id" value=
"{$form['input_id']}">
315 <input type=
"hidden" name=
"text_id" value=
"{$form['text_id']}">
316 <table style=
"{$style['content_box']}" cellspacing=
"0" border=
"0" cellpadding=
"0">
318 <tr><td colspan=
"2" align=
"center" class=
"qf-search-line" style=
"{$style['label_box']}; padding-top: 0px;" onMouseDown=
"dragStart(event, '{$form['id']}', 'savePosition' 324 <td colspan=
"2" align=
"left" class=
"qf-search-line">
328 background-color: #FFFFFF; 342 <td align=
"right" class=
"qf-search-line">
345 <td align=
"right" class=
"qf-search-line">
346 <input
class=
"button" type=
"button" name=
"close" value=
"Close" onClick=
"removeElement('{$form['id']}');">
355 return(array($html, $js));
377 printmsg(
"INFO => Switching to context: {$form['context_select']}",0);
378 setcookie(
"ona_context_name", $form[
'context_select']);
379 $js =
"window.location='{$baseURL}';";
383 printmsg(
"DEBUG => There was an error switching to context: {$form['context_select']}",1);
384 $js =
"alert('The context \'{$form['context_select']}\' is not valid.');";
388 $response->addScript($js);
389 return($response->getXML());
424 <!-- LOGIN PROMPT -->
425 <form
id=
"loginform_form" onSubmit=
"return false;">
426 <input
id=
"onapassword" type=
"hidden" name=
"onapassword">
427 <table style=
"{$style['content_box']}" cellspacing=
"0" border=
"0">
430 <td nowrap=
"true" align=
"right">
434 <input
id=
"onausername" class=
"edit" autocomplete=
"off" name=
"onausername" type=
"edit" size=
"12" onkeypress=
"if (event.keyCode == 13) { el('getpass').focus(); }">
438 <td nowrap=
"true" align=
"right">
439 <b>Password</b>&
nbsp;
442 <input
id=
"getpass" class=
"edit" autocomplete=
"off" name=
"getpass" type=
"password" size=
"12" onkeypress=
"if (event.keyCode == 13) { el('loginbutton').click(); }">
447 <input
class=
"button" 451 onClick=
"removeElement('{$form['id']}');" 453 <input
class=
"button" 458 onClick=
"el('onapassword').value = el('getpass').value; 459 xajax_window_submit('tooltips', xajax.getFormValues('loginform_form'), 'logingo');" 464 <td colspan=
"2" align=
"center">
465 <span
id=
"loginmsg" style=
"color: red;font-size: x-small;"></span>
473 $js =
"el('onausername').focus();";
476 return(array($html, $js));
495 if ($form[
'standalone'])
$type=
'Standalone';
497 printmsg(
"INFO => [{$type}] Attempting login as " . $form[
'onausername'], 4);
503 if ($form[
'standalone'] ==
'standalone') $js .=
"window.location='{$http}{$baseURL}/';";
504 $js .=
"el('loggedin_user').innerHTML = '{$_SESSION['ona']['auth']['user']['username']}';";
505 printmsg(
"INFO => [{$type}] {$_SESSION['ona']['auth']['user']['username']} has logged in via authtype: {$conf['authtype']}",0);
509 $response->addScript($js);
510 return($response->getXML());
534 $font_color =
'#FFFFFF';
539 background-color: #FFFFFF;
546 border: solid 1px {
$color[
'border']};
547 background-color: {
$color[
'window_content_bg']};
560 if (!is_ipv4($subnet_ip)) {
562 $subnet_ip_end = gmp_sub(gmp_init($subnets[0][
'ip_addr']), 1);
563 $size = gmp_add(gmp_sub($subnet_ip_end, $subnet_ip), 1);
564 if (gmp_mod($size,2) == 1) gmp_sub($size,1);
566 for ($mask=65;$mask > 48;$mask--) {
567 if (gmp_cmp($size,gmp_pow(
"2",$mask)) > 0) {
572 $subnet[
'ip_addr'] =
ip_mangle(gmp_strval($subnet_ip),
'dotted');
573 $subnet[
'ip_addr_end'] =
ip_mangle(gmp_strval($subnet_ip_end),
'dotted');
574 $str_subnet_ip = gmp_strval($subnet_ip);
575 $size=gmp_strval($size);
584 $subnet_ip_end = $subnets[0][
'ip_addr'] - 1;
585 $size = $subnet_ip_end - $subnet_ip + 1;
586 if (($size % 2) == 1) $size--;
587 $mask = ceil(32 - (log($size) / log(2)));
588 $subnet[
'ip_addr'] =
ip_mangle($subnet_ip,
'dotted');
589 $subnet[
'ip_addr_end'] =
ip_mangle($subnet_ip_end,
'dotted');
590 $str_subnet_ip = $subnet_ip;
599 <table cellspacing=
"0" border=
"0" cellpadding=
"0">
602 <tr><td width=100% colspan=
"2" nowrap=
"true" style=
"{$style['label_box']}">
603 <a title=
"Add a new subnet here" 605 onClick=
"xajax_window_submit('edit_subnet', 'ip_addr=>{$str_subnet_ip}', 'editor');" 606 >Add a subnet here</a>
610 <td align=
"right" nowrap=
"true" style=
"color: {$font_color};"><b>IP Range</b>&
nbsp;</td>
611 <td
class=
"padding" nowrap=
"true" align=
"left" style=
"color: {$font_color};">{$subnet[
'ip_addr']}&
nbsp;-&
nbsp;{$subnet[
'ip_addr_end']}&
nbsp({$size} addresses)</td>
615 $largest_subnet = array(0, 0, 0);
617 if (is_ipv4($subnet_ip)) {
619 while (
$ip < $subnet_ip_end) {
624 while ($mymask <= 30) {
626 $ip2 = str_pad(substr($ip1, 0, $mymask), 32,
'0');
627 $mysize = pow(2, 32-$mymask);
628 $myhosts = $mysize - 2;
632 if ( $ip1 == $ip2 and ((
$ip + $mysize - 1) <= $subnet_ip_end) ) {
637 if ($mymask == 31)
break;
638 if ($mysize > $largest_subnet[2]) $largest_subnet = array(
ip_mangle(
$ip,
'dotted'), $mymask, $mysize);
644 <td align=
"right" nowrap=
"true" style=
"color: {$font_color};">&
nbsp;</td>
645 <td
class=
"padding" align=
"left" style=
"color: {$font_color};">{$myip} /{$mymask}&
nbsp;({$myhosts} hosts)</td>
656 $largest_subnet[2] = $largest_subnet[2] - 2;
661 $ip = gmp_init($subnet_ip);
665 if (gmp_cmp(gmp_sub($subnet_ip_end,
$ip),gmp_mul(
"18446744073709551616",
"5")) > 0) {
669 <td align=
"right" nowrap=
"true" style=
"color: {$font_color};">&
nbsp;</td>
670 <td align=
"right" nowrap=
"true" style=
"color: {$font_color};">Next Subnet too far away</td>
673 return(array($html, $js));
676 while (gmp_cmp(
$ip, $subnet_ip_end) < 0) {
681 while ($mymask <= 64) {
683 $ip2 = str_pad(substr($ip1, 0, $mymask), 128,
'0');
684 $mysize = gmp_pow(
"2", 128-$mymask);
685 $myhosts = gmp_strval(gmp_sub($mysize,2));
689 if ((strcmp($ip1, $ip2) == 0) and (gmp_cmp(gmp_sub(gmp_add(
$ip, $mysize),1), $subnet_ip_end) <= 0 )) {
694 if ($mymask == 90)
break;
695 if (gmp_cmp($mysize,$largest_subnet[2]) > 0) $largest_subnet = array(
ip_mangle(gmp_strval(
$ip),
'dotted'), $mymask, $mysize);
700 <td align=
"right" nowrap=
"true" style=
"color: {$font_color};">&
nbsp;</td>
701 <td
class=
"padding" align=
"left" style=
"color: {$font_color};">{$mask} {$myip} /{$mymask}&
nbsp;({$myhosts} hosts)td>
707 $ip = gmp_add(
$ip,$mysize);
710 $largest_subnet[2] = gmp_strval($largest_subnet[2]);
717 <td align=
"right" nowrap=
"true" style=
"color: {$font_color};"><b>Largest block</b>&
nbsp;</td>
718 <td
class=
"padding" nowrap=
"true" align=
"left" style=
"color: {$font_color};">{$largest_subnet[0]} /{$largest_subnet[1]}&
nbsp;({$largest_subnet[2]} usable hosts)</td>
723 return(array($html, $js));
731 $subnet[
'ip_addr'] =
ip_mangle($subnet[
'ip_addr'],
'dotted');
732 $subnet[
'ip_mask'] =
ip_mangle($subnet[
'ip_mask'],
'dotted');
733 $subnet[
'ip_mask_cidr'] =
ip_mangle($subnet[
'ip_mask'],
'cidr');
736 $subnet[
'type'] =
$type[
'display_name'];
742 foreach(array_keys((array)$subnet) as $key) { $subnet[$key] = htmlentities($subnet[$key], ENT_QUOTES,
$conf[
'php_charset']); }
743 foreach(array_keys((array)$location) as $key) { $location[$key] = htmlentities($location[$key], ENT_QUOTES,
$conf[
'php_charset']); }
747 <!-- SUBNET INFORMATION -->
748 <table cellspacing=
"0" border=
"0" cellpadding=
"0">
751 <tr><td width=100% colspan=
"2" nowrap=
"true" style=
"{$style['label_box']}">
752 <a title=
"View subnet. ID: {$subnet['id']}" 754 onClick=
"xajax_window_submit('work_space', 'xajax_window_submit(\'display_subnet\', \'subnet_id=>{$subnet['id']}\', \'display\')');" 755 >{$subnet[
'name']}</a>
759 <td align=
"right" nowrap=
"true" style=
"color: {$font_color};"><b>IP Address</b>&
nbsp;</td>
760 <td
class=
"padding" align=
"left" style=
"color: {$font_color};">{$subnet[
'ip_addr']}&
nbsp;/{$subnet[
'ip_mask_cidr']}</td>
764 <td align=
"right" nowrap=
"true" style=
"color: {$font_color};"><b>Usage</b>&
nbsp;</td>
765 <td
class=
"padding" align=
"left" style=
"color: {$font_color};">{
$usage_html}</td>
769 if ($subnet[
'type']) {
772 <td align=
"right" nowrap=
"true" style=
"color: {$font_color};"><b>Type</b>&
nbsp;</td>
773 <td
class=
"padding" align=
"left" style=
"color: {$font_color};">{$subnet[
'type']}&
nbsp;</td>
783 return(array($html, $js));
805 $font_color =
'#FFFFFF';
811 foreach ($records as
$record) {
812 $subnet_type_list .=
"<option value=\"{$record['id']}\">{$record['name']}</option>\n";
816 suggest_setup(
'ip_subnet_qf',
'suggest_ip_subnet_qf');
817 suggest_setup(
'ip_subnet_thru_qf',
'suggest_ip_subnet_thru_qf');
818 suggest_setup(
'subnet_qf',
'suggest_subnet_qf');
835 <!-- SUBNET QUICK SEARCH -->
836 <form
id=
"quick_subnet_search_form" onSubmit=
"return(false);">
837 <input type=
"hidden" name=
"id" value=
"{$form['id']}">
838 <input type=
"hidden" name=
"input_id" value=
"{$form['input_id']}">
839 <input type=
"hidden" name=
"content_id" value=
"qf_subnet_results">
840 <table
id=
"subnet_search" style=
"{$style['content_box']}" cellspacing=
"0" border=
"0" cellpadding=
"0">
843 <td colspan=
"2" align=
"center" class=
"qf-search-line" style=
"{$style['label_box']}; padding-top: 0px;" onMouseDown=
"dragStart(event, '{$form['id']}', 'savePosition', 0);">
849 <td align=
"right" class=
"qf-search-line">
852 <td align=
"left" class=
"qf-search-line">
853 <select
id=
"nettype" name=
"nettype" class=
"edit" accesskey=
"u" accesskey=
"t" >
860 <td align=
"right" class=
"qf-search-line">
863 <td align=
"left" class=
"qf-search-line">
864 <input
id=
"subnet_qf" name=
"netdesc" type=
"text" class=
"edit" size=
"32" accesskey=
"d" />
865 <div
id=
"suggest_subnet_qf" class=
"suggest"></div>
870 <td align=
"right" class=
"qf-search-line">
873 <td align=
"left" class=
"qf-search-line" nowrap=
"true">
874 <input
id=
"ip_subnet_qf" name=
"ip_subnet" class=
"edit" type=
"text" size=
"15" accesskey=
"i" />
875 <div
id=
"suggest_ip_subnet_qf" class=
"suggest"></div>
877 <input
id=
"ip_subnet_thru_qf" name=
"ip_subnet_thru" class=
"edit" type=
"text" size=
"15">
878 <div
id=
"suggest_ip_subnet_thru_qf" class=
"suggest"></div>
883 <td align=
"right" class=
"qf-search-line">
886 <td align=
"right" class=
"qf-search-line">
887 <input
class=
"button" type=
"button" name=
"cancel" value=
"Cancel" onClick=
"removeElement('{$form['id']}');">
888 <input
class=
"button" type=
"button" name=
"search" value=
"Search" accesskey=
"s" onClick=
"xajax_window_submit('search_results_qf', xajax.getFormValues('quick_subnet_search_form'), 'subnet');">
893 <td colspan=
"2" align=
"left" class=
"qf-search-line">
895 id=
"qf_subnet_results" 898 background-color: #FFFFFF; 909 return(array($html, $js));
935 $font_color =
'#FFFFFF';
955 <!-- LOCATION QUICK SEARCH -->
956 <form
id=
"quick_location_search_form" onSubmit=
"return(false);">
957 <input type=
"hidden" name=
"id" value=
"{$form['id']}">
958 <input type=
"hidden" name=
"input_id" value=
"{$form['input_id']}">
959 <input type=
"hidden" name=
"content_id" value=
"qf_location_results">
960 <table
id=
"location_search" style=
"{$style['content_box']}" cellspacing=
"0" border=
"0" cellpadding=
"0">
963 <td colspan=
"2" align=
"center" class=
"qf-search-line" style=
"{$style['label_box']}; padding-top: 0px;" onMouseDown=
"dragStart(event, '{$form['id']}', 'savePosition', 0);">
964 Location Quick Search
969 <td align=
"right" class=
"qf-search-line">
972 <td align=
"left" class=
"qf-search-line">
973 <input name=
"reference" type=
"text" class=
"edit" size=
"32" accesskey=
"r" />
978 <td align=
"right" class=
"qf-search-line">
981 <td align=
"left" class=
"qf-search-line">
982 <input name=
"name" type=
"text" class=
"edit" size=
"32" accesskey=
"n" />
987 <td align=
"right" class=
"qf-search-line">
990 <td align=
"left" class=
"qf-search-line">
991 <input name=
"address" type=
"text" class=
"edit" size=
"32" accesskey=
"a" />
996 <td align=
"right" class=
"qf-search-line">
999 <td align=
"left" class=
"qf-search-line" nowrap=
"true">
1000 <input name=
"city" class=
"edit" type=
"text" size=
"20" accesskey=
"c" />&
nbsp;
1001 State: <input name=
"state" class=
"edit" type=
"text" size=
"2" maxlength=
"2" />
1006 <td align=
"right" class=
"qf-search-line">
1009 <td align=
"left" class=
"qf-search-line" nowrap=
"true">
1010 <input name=
"zip" class=
"edit" type=
"text" size=
"10" maxlength=
"10" accesskey=
"z" />
1015 <td align=
"right" class=
"qf-search-line">
1018 <td align=
"right" class=
"qf-search-line">
1019 <input
class=
"button" type=
"button" name=
"cancel" value=
"Cancel" onClick=
"removeElement('{$form['id']}');">
1020 <input
class=
"button" type=
"button" name=
"search" value=
"Search" accesskey=
"s" onClick=
"xajax_window_submit('search_results_qf', xajax.getFormValues('quick_location_search_form'), 'location');">
1025 <td colspan=
"2" align=
"left" class=
"qf-search-line">
1027 id=
"qf_location_results" 1030 background-color: #FFFFFF; 1041 return(array($html, $js));
1061 $font_color =
'#FFFFFF';
1065 vertical-align: top;
1077 <!-- QUICK TAG ADD -->
1078 <form
id=
"quick_tag_add_form" onSubmit=
"return(false);">
1079 <input type=
"hidden" name=
"type" value=
"{$form['type']}">
1080 <input type=
"hidden" name=
"reference" value=
"{$form['reference']}">
1081 <input type=
"hidden" name=
"updateid" value=
"{$form['updateid']}">
1082 <table style=
"{$style['content_box']}" cellspacing=
"0" border=
"0" cellpadding=
"0">
1084 <tr><td align=
"center" class=
"qf-search-line" style=
"{$style['label_box']}; padding-top: 0px;" onMouseDown=
"dragStart(event, '{$form['id']}', 'savePosition', 0);">
1085 Add {$form[
'type']} tag
1089 <td align=
"left" class=
"qf-search-line">
1090 <input
id=
"tag_qf" name=
"name" type=
"text" class=
"edit" size=
"25" maxlength=
"127"ccesskey=
"t" onClick=
"el('qf_tag_results').style.display = 'none';" onkeypress=
"if (event.keyCode == 13) { el('tagaddbutton').click();clearInterval(inter_exec); }" />
1091 <div
id=
"suggest_tag_qf" class=
"suggest"></div>
1097 <td align=
"right" class=
"qf-search-line">
1098 <input
class=
"button" type=
"button" name=
"cancel" value=
"Cancel" onClick=
"removeElement('{$form['id']}');">
1099 <input
id=
"tagaddbutton" 1105 onClick=
"xajax_window_submit('edit_tag', xajax.getFormValues('quick_tag_add_form'), 'save');removeElement('{$form['id']}');">
1115 suggest_setup(
'tag_qf',
'suggest_tag_qf');
1116 el(
'tag_qf').focus();
1119 return(array($html, $js));
1136 $font_color =
'#FFFFFF';
1140 vertical-align: top;
1152 <!-- VLAN QUICK SEARCH -->
1153 <form
id=
"quick_vlan_search_form" onSubmit=
"return(false);">
1154 <input type=
"hidden" name=
"id" value=
"{$form['id']}">
1155 <input type=
"hidden" name=
"input_id" value=
"{$form['input_id']}">
1156 <input type=
"hidden" name=
"text_id" value=
"{$form['text_id']}">
1157 <input type=
"hidden" name=
"content_id" value=
"qf_vlan_results">
1158 <table style=
"{$style['content_box']}" cellspacing=
"0" border=
"0" cellpadding=
"0">
1160 <tr><td colspan=
"2" align=
"center" class=
"qf-search-line" style=
"{$style['label_box']}; padding-top: 0px;" onMouseDown=
"dragStart(event, '{$form['id']}', 'savePosition', 0);">
1165 <td align=
"right" class=
"qf-search-line">
1168 <td align=
"left" class=
"qf-search-line">
1169 <input
id=
"vlan_campus_qf" name=
"campus" type=
"text" class=
"edit" size=
"24" accesskey=
"c" onClick=
"el('qf_vlan_results').style.display = 'none';" />
1170 <div
id=
"suggest_vlan_campus_qf" class=
"suggest"></div>
1175 <td align=
"right" class=
"qf-search-line">
1178 <td align=
"right" class=
"qf-search-line">
1179 <input
class=
"button" type=
"button" name=
"cancel" value=
"Cancel" onClick=
"removeElement('{$form['id']}');">
1180 <input
class=
"button" type=
"button" name=
"search" value=
"Search" accesskey=
"s" onClick=
"xajax_window_submit('search_results_qf', xajax.getFormValues('quick_vlan_search_form'), 'vlan');">
1185 <td colspan=
"2" align=
"left" class=
"qf-search-line">
1187 id=
"qf_vlan_results" 1190 background-color: #FFFFFF; 1203 suggest_setup(
'vlan_campus_qf',
'suggest_vlan_campus_qf');
1206 return(array($html, $js));
1228 $font_color =
'#FFFFFF';
1234 foreach ($records as
$record) {
1235 $subnet_type_list .=
"<option value=\"{$record['id']}\">{$record['display_name']}</option>\n";
1239 suggest_setup(
'ip_subnet_qf',
'suggest_ip_subnet_qf');
1240 suggest_setup(
'ip_subnet_thru_qf',
'suggest_ip_subnet_thru_qf');
1241 suggest_setup(
'subnet_qf',
'suggest_subnet_qf');
1246 vertical-align: top;
1256 foreach(array_keys((array)$form) as $key) { $form[$key] = htmlentities($form[$key], ENT_QUOTES,
$conf[
'php_charset']); }
1259 <!-- FREE IP QUICK SEARCH -->
1260 <form
id=
"quick_free_ip_search_form" onSubmit=
"return(false);">
1261 <input type=
"hidden" name=
"id" value=
"{$form['id']}">
1262 <input type=
"hidden" name=
"input_id" value=
"{$form['input_id']}">
1263 <input type=
"hidden" name=
"text_id" value=
"{$form['text_id']}">
1264 <input type=
"hidden" name=
"content_id" value=
"qf_free_ip_results">
1265 <input type=
"hidden" name=
"next_action" value=
"free_ip">
1266 <input type=
"hidden" name=
"form_id" value=
"quick_free_ip_search_form">
1267 <!-- The subnet_id field gets filled by clicking on a subnet result later -->
1268 <input type=
"hidden" id=
"qf_free_ip_subnet_id" name=
"subnet_id" value=
"">
1269 <table style=
"{$style['content_box']}" cellspacing=
"0" border=
"0" cellpadding=
"0">
1271 <tr><td colspan=
"2" align=
"center" class=
"qf-search-line" style=
"{$style['label_box']}; padding-top: 0px;" onMouseDown=
"dragStart(event, '{$form['id']}', 'savePosition', 0);">
1272 Available IP Quick Search
1276 <td align=
"right" class=
"qf-search-line">
1279 <td align=
"left" class=
"qf-search-line">
1280 <select
id=
"nettype" name=
"nettype" class=
"edit" accesskey=
"u" accesskey=
"t" >
1287 <td align=
"right" class=
"qf-search-line">
1290 <td align=
"left" class=
"qf-search-line">
1291 <input
id=
"subnet_qf" name=
"netdesc" type=
"text" class=
"edit" size=
"32" accesskey=
"d" value=
"{$form['text_value']}" />
1292 <div
id=
"suggest_subnet_qf" class=
"suggest"></div>
1297 <td align=
"right" class=
"qf-search-line">
1300 <td align=
"left" class=
"qf-search-line" nowrap=
"true">
1301 <input
id=
"ip_subnet_qf" name=
"ip_subnet" class=
"edit" type=
"text" size=
"15" accesskey=
"i" />
1302 <div
id=
"suggest_ip_subnet_qf" class=
"suggest"></div>
1304 <input
id=
"ip_subnet_thru_qf" name=
"ip_subnet_thru" class=
"edit" type=
"text" size=
"15">
1305 <div
id=
"suggest_ip_subnet_thru_qf" class=
"suggest"></div>
1310 <td align=
"right" class=
"qf-search-line">
1313 <td align=
"right" class=
"qf-search-line">
1314 <input
class=
"button" type=
"reset" name=
"reset" value=
"Reset">
1315 <input
class=
"button" type=
"button" name=
"cancel" value=
"Cancel" onClick=
"removeElement('{$form['id']}');">
1316 <input
class=
"button" type=
"button" name=
"search" value=
"Search" accesskey=
"s" onClick=
"xajax_window_submit('search_results_qf', xajax.getFormValues('quick_free_ip_search_form'), 'subnet');">
1321 <td colspan=
"2" align=
"left" class=
"qf-search-line">
1323 id=
"qf_free_ip_results" 1326 background-color: #FFFFFF; 1337 if ($form[
'text_value'] !=
"") {
1338 $js .=
"xajax_window_submit('search_results_qf', xajax.getFormValues('quick_free_ip_search_form'), 'subnet');";
1340 return(array($html, $js));
1361 $font_color =
'#FFFFFF';
1366 $fg_list =
'<option value="0">None</option>\n';
1373 if (
$record[
'id'] == $form[
'failover_group_id']) { $selected =
"SELECTED=\"selected\""; }
1375 $fg_list .=
"<option {$selected} value=\"{$record['id']}\">{$fail_host1['fqdn']}/{$fail_host2['fqdn']}</option>\n";
1380 suggest_setup(
'pool_server_qf',
'suggest_pool_server_qf');
1386 vertical-align: top;
1398 <!-- POOL SERVER QUICK SEARCH -->
1399 <form
id=
"quick_pool_server_search_form" onSubmit=
"return(false);">
1400 <input type=
"hidden" name=
"id" value=
"{$form['id']}">
1401 <input type=
"hidden" name=
"input_id" value=
"{$form['input_id']}">
1402 <input type=
"hidden" name=
"content_id" value=
"qf_pool_server_results">
1403 <table
id=
"pool_server_search" style=
"{$style['content_box']}" cellspacing=
"0" border=
"0" cellpadding=
"0">
1406 <td colspan=
"2" align=
"center" class=
"qf-search-line" style=
"{$style['label_box']}; padding-top: 0px;" onMouseDown=
"dragStart(event, '{$form['id']}', 'savePosition', 0);">
1407 DHCP Pool Failover Server Quick Select
1412 <td align=
"right" class=
"qf-search-line" nowrap=
"true">
1415 <td align=
"left" class=
"qf-search-line">
1416 <select
id=
"failover_group_qf" name=
"failover_group" class=
"edit" accesskey=
"f" onClick=
"el('pool_server_qf').value = '';">
1423 <td align=
"right" class=
"qf-search-line">
1426 <td align=
"right" class=
"qf-search-line">
1427 <input
class=
"button" type=
"button" name=
"cancel" value=
"Cancel" onClick=
"removeElement('{$form['id']}');">
1428 <input
class=
"button" type=
"button" name=
"select" value=
"Select" accesskey=
"s" onClick=
"el('{$form['failover_group']}').value = failover_group_qf.options[failover_group_qf.selectedIndex].value; if (failover_group_qf.options[failover_group_qf.selectedIndex].value) el('{$form['text_id']}').innerHTML = failover_group_qf.options[failover_group_qf.selectedIndex].innerHTML; removeElement('{$form['id']}');">
1437 return(array($html, $js));
1460 list(
$status, $introws, $interfaces) =
db_get_records(
$onadb,
'interfaces',
"host_id = {$form['host_id']} or id in (select interface_id from interface_clusters where host_id ={$form['host_id']})",
'ip_addr ASC');
1462 if ($introws == 0 or
$status)
return(array(
'',
''));
1469 border: solid 1px {
$color[
'border']};
1470 background-color: {
$color[
'window_content_bg']};
1474 <!-- INTERFACE INFORMATION -->
1475 <table cellspacing=
"0" border=
"0" cellpadding=
"0">
1479 <td colspan=5 style=
"{$style['label_box']}">{$introws} interface(s)</td>
1485 foreach($interfaces as $interface) {
1487 foreach(array_keys((array)$interface) as $key) { $interface[$key] = htmlentities($interface[$key], ENT_QUOTES,
$conf[
'php_charset']); }
1488 foreach(array_keys((array)$subnet) as $key) { $subnet[$key] = htmlentities($subnet[$key], ENT_QUOTES,
$conf[
'php_charset']); }
1492 list(
$status, $clustrows, $clustrecord) =
ona_get_record(array(
'interface_id' => $interface[
'id']),
'interface_clusters');
1493 if ($interface[
'host_id'] != $form[
'host_id'] or $clustrows>0) $clusticon =
"<img title=\"This interface is shared with another host.\" src=\"{$images}/silk/sitemap.png\" border=\"0\">";
1497 <td align=
"left" style=
"color: #FFFFFF;" nowrap=
"true">{$clusticon}&
nbsp;</td>
1498 <td align=
"left" class=
"padding" style=
"color: #FFFFFF;" nowrap=
"true">{
$ip}</td>
1499 <td align=
"left" class=
"padding" style=
"color: #FFFFFF;" nowrap=
"true">
1500 <a title=
"View subnet. ID: {$subnet['id']}" 1501 style=
"color: #6CB3FF;" 1503 onClick=
"xajax_window_submit('work_space', 'xajax_window_submit(\'display_subnet\', \'subnet_id=>{$subnet['id']}\', \'display\')'); removeElement('{$form['id']}');" 1504 >{$subnet[
'name']}</a>&
nbsp;</td>
1515 <td align=
"center" class=
"padding" style=
"color: #FFFFFF;" nowrap=
"true" colspan=2>
1516 Only displaying first 15 interfaces on host.&
nbsp;&
nbsp;
1517 <a title=
"View host. ID: {$interface['host_id']}" 1518 style=
"color: #6CB3FF;" 1520 onClick=
"xajax_window_submit('work_space', 'xajax_window_submit(\'display_host\', \'host_id=>{$interface['host_id']}\', \'display\')'); removeElement('{$form['id']}');" 1521 >View Host</a>&
nbsp;</td>
1532 return(array($html, $js));
1558 if ($introws == 0 or
$status)
return(array(
'',
''));
1564 $priip =
ip_mangle($priint[
'ip_addr'], dotted);
1567 $introws=$introws+1;
1573 border: solid 1px {
$color[
'border']};
1574 background-color: {
$color[
'window_content_bg']};
1578 <!-- INTERFACE CLUSTER INFORMATION -->
1579 <table cellspacing=
"0" border=
"0" cellpadding=
"0">
1583 <td colspan=3 style=
"{$style['label_box']}">{$introws} hosts share IP:<br>{$priip}</td>
1586 <td align=
"left" class=
"padding" style=
"color: #FFFFFF;" nowrap=
"true">
1587 <a title=
"View host. ID: {$prihost['id']}" 1588 style=
"color: #6CB3FF;" 1590 onClick=
"xajax_window_submit('work_space', 'xajax_window_submit(\'display_host\', \'host_id=>{$prihost['id']}\', \'display\')'); removeElement('{$form['id']}');" 1591 >{$prihost[
'fqdn']}</a>&
nbsp;</td>
1592 <td align=
"left" class=
"padding" style=
"color: #FFFFFF;" nowrap=
"true">{$priint[
'name']}</td>
1598 foreach($interfaces as $interface) {
1600 foreach(array_keys((array)$interface) as $key) { $interface[$key] = htmlentities($interface[$key], ENT_QUOTES,
$conf[
'php_charset']); }
1601 foreach(array_keys((array)
$host) as $key) {
$host[$key] = htmlentities(
$host[$key], ENT_QUOTES,
$conf[
'php_charset']); }
1604 if (!$interface[
'name'])
1605 $interface[
'name'] = $priint[
'name'];
1609 <td align=
"left" class=
"padding" style=
"color: #FFFFFF;" nowrap=
"true">
1610 <form
id=
"quick_interface_share_del_form" onSubmit=
"return(false);">
1611 <input type=
"hidden" name=
"ip" value=
"{$interface['interface_id']}">
1612 <input type=
"hidden" name=
"host" value=
"{$host['id']}">
1614 <a title=
"View host. ID: {$host['id']}" 1615 style=
"color: #6CB3FF;" 1617 onClick=
"xajax_window_submit('work_space', 'xajax_window_submit(\'display_host\', \'host_id=>{$host['id']}\', \'display\')'); removeElement('{$form['id']}');" 1619 <td align=
"left" class=
"padding" style=
"color: #FFFFFF;" nowrap=
"true">{$interface[
'name']}</td>
1620 <td align=
"left" class=
"padding" style=
"color: #FFFFFF;" nowrap=
"true">
1621 <img src=
"{$images}/silk/delete.png" 1622 title=
"Remove interface share with {$host['fqdn']}" 1624 onClick=
"xajax_window_submit('tooltips', xajax.getFormValues('quick_interface_share_del_form'), 'interface_share_del');removeElement('{$form['id']}');" 1637 <td align=
"center" class=
"padding" style=
"color: #FFFFFF;" nowrap=
"true" colspan=2>
1638 Only displaying first 15 hosts in cluster.&
nbsp;&
nbsp;
1639 <a title=
"View host. ID: {$interface['host_id']}" 1640 style=
"color: #6CB3FF;" 1642 onClick=
"xajax_window_submit('work_space', 'xajax_window_submit(\'display_host\', \'host_id=>{$interface['host_id']}\', \'display\')'); removeElement('{$form['id']}');" 1643 >View Primary Host</a>&
nbsp;</td>
1654 return(array($html, $js));
1677 $font_color =
'#FFFFFF';
1681 vertical-align: top;
1691 $refresh =
"xajax_window_submit('list_interfaces', xajax.getFormValues('list_interfaces_filter_form'), 'display_list');";
1695 <!-- QUICK INTERFACE SHARE -->
1696 <form
id=
"quick_interface_share_form" onSubmit=
"return(false);">
1697 <input type=
"hidden" name=
"id" value=
"{$form['id']}">
1698 <input type=
"hidden" name=
"js" value=
"{$form['js']}">
1699 <input type=
"hidden" name=
"ip" value=
"{$form['interface_id']}">
1700 <table style=
"{$style['content_box']}" cellspacing=
"0" border=
"0" cellpadding=
"0">
1702 <tr><td colspan=
"2" align=
"center" class=
"qf-search-line" style=
"{$style['label_box']}; padding-top: 0px;" onMouseDown=
"dragStart(event, '{$form['id']}', 'savePosition', 0);">
1703 Quick
interface share
1707 <td align=
"right" class=
"qf-search-line">
1710 <td align=
"left" class=
"qf-search-line">
1717 <td align=
"right" class=
"qf-search-line">
1720 <td align=
"left" class=
"qf-search-line">
1721 <input
id=
"share_hostname" name=
"host" type=
"text" class=
"edit" size=
"24" accesskey=
"h" autocomplete=
"off"/>
1722 <div
id=
"suggest_share_hostname" class=
"suggest"></div>
1727 <td align=
"right" class=
"qf-search-line">
1730 <td align=
"left" class=
"qf-search-line">
1731 <input name=
"name" type=
"text" class=
"edit" size=
"24" accesskey=
"n" />
1736 <td align=
"right" class=
"qf-search-line">
1739 <td align=
"right" class=
"qf-search-line">
1740 <input
class=
"button" type=
"button" name=
"cancel" value=
"Cancel" onClick=
"removeElement('{$form['id']}');">
1741 <input
class=
"button" type=
"button" name=
"share" value=
"Share" accesskey=
"s" onClick=
"xajax_window_submit('tooltips', xajax.getFormValues('quick_interface_share_form'), 'interface_share_save');removeElement('{$form['id']}');{$refresh};">
1751 el(
'share_hostname').focus();
1752 suggest_setup(
'share_hostname',
'suggest_share_hostname');
1755 return(array($html, $js));
1773 if (! (
auth(
'interface_del')) ) {
1775 $response->addScript(
"alert('Permission denied!');");
1776 return($response->getXML());
1784 if (!$form[
'host'] and !$form[
'ip']) {
1785 $response->addScript(
"alert('Please complete all fields to continue!');");
1786 return($response->getXML());
1790 $module =
'interface_share';
1797 $js .=
"alert('Save failed. ". preg_replace(
'/[\s\']+/',
' ',
$self[
'error']) .
"');";
1799 $js .=
"removeElement('{$window_name}');";
1800 if ($form[
'js']) $js .= $form[
'js'];
1804 $response->addScript($js);
1805 return($response->getXML());
1824 if (! (
auth(
'interface_del')) ) {
1826 $response->addScript(
"alert('Permission denied!');");
1827 return($response->getXML());
1835 if (!$form[
'host'] and !$form[
'ip']) {
1836 $response->addScript(
"alert('Please complete all fields to continue!');");
1837 return($response->getXML());
1841 $module =
'interface_share_del';
1848 $js .=
"alert('Delete failed. ". preg_replace(
'/[\s\']+/',
' ',
$self[
'error']) .
"');";
1850 $js .=
"removeElement('{$window_name}');";
1851 if ($form[
'js']) $js .= $form[
'js'];
1855 $response->addScript($js);
1856 return($response->getXML());
1879 $html .=
"<div style=\"text-align: center;color: black;padding-bottom:4px;font-weight: bold;\">Interface Actions<br/> [{$form['ip_addr']}]</div>";
1882 if (
auth(
'interface_modify') and !$form[
'natip']) {
1885 onMouseOver=
"this.className='hovered';" 1886 onMouseOut=
"this.className='row';" 1887 title=
"Add an external NAT IP" 1889 onClick=
"wwTT(this, event, 1890 'id', 'tt_quick_interface_nat_{$form['interface_id']}', 1893 'styleClass', 'wwTT_qf', 1894 'direction', 'southwest', 1895 'javascript', 'xajax_window_submit(\'tooltips\', \'tooltip=>quick_interface_nat,id=>tt_quick_interface_nat_{$form['interface_id']},interface_id=>{$form['interface_id']},ip_addr=>{$form['ip_addr']}\');' 1897 ><img src=
"{$images}/silk/world_link.png" border=
"0">&
nbsp; Add NAT IP</div>
1901 if (
auth(
'interface_modify') and $form[
'natip']) {
1904 onMouseOver=
"this.className='hovered';" 1905 onMouseOut=
"this.className='row';" 1906 title=
"Delete the external NAT IP" 1908 onClick=
"var doit=confirm('Are you sure you want to delete this NAT address?\\nIt will remove any DNS names associated with the external IP.'); 1910 xajax_window_submit('tooltips', 'ip=>{$form['interface_id']},natip=>{$form['natip']},nataction=>delete,commit=>yes', 'interface_nat_save');" 1911 ><img src=
"{$images}/silk/world_delete.png" border=
"0">&
nbsp; Delete NAT IP</div>
1916 if (
auth(
'interface_modify')) {
1919 onMouseOver=
"this.className='hovered';" 1920 onMouseOut=
"this.className='row';" 1921 title=
"Move IP to another host" 1923 onClick=
"wwTT(this, event, 1924 'id', 'tt_quick_interface_move_{$form['interface_id']}', 1927 'styleClass', 'wwTT_qf', 1928 'direction', 'southwest', 1929 'javascript', 'xajax_window_submit(\'tooltips\', \'tooltip=>quick_interface_move,id=>tt_quick_interface_move_{$form['interface_id']},interface_id=>{$form['interface_id']},ip_addr=>{$form['ip_addr']},orig_host=>{$form['orig_host']}\');' 1931 ><img src=
"{$images}/silk/lorry_flatbed.png" border=
"0">&
nbsp; Move IP</div>
1935 if (
auth(
'interface_modify')) {
1938 onMouseOver=
"this.className='hovered';" 1939 onMouseOut=
"this.className='row';" 1940 title=
"Share IP with another host (hsrp,carp,vrrp)" 1942 onClick=
"wwTT(this, event, 1943 'id', 'tt_quick_interface_share_{$form['interface_id']}', 1946 'styleClass', 'wwTT_qf', 1947 'direction', 'southwest', 1948 'javascript', 'xajax_window_submit(\'tooltips\', \'tooltip=>quick_interface_share,id=>tt_quick_interface_share_{$form['interface_id']},interface_id=>{$form['interface_id']},ip_addr=>{$form['ip_addr']}\');' 1950 ><img src=
"{$images}/silk/sitemap.png" border=
"0">&
nbsp; Share IP</div>
1954 if (
auth(
'interface_modify')) {
1957 onMouseOver=
"this.className='hovered';" 1958 onMouseOut=
"this.className='row';" 1959 title=
"Add DNS record to this interface" 1961 onClick=
"xajax_window_submit('edit_record', xajax.getFormValues('{$form['form_id']}'), 'editor');setTimeout('toggleBox(\'edit_record\');',500);" 1962 ><img src=
"{$images}/silk/font_add.png" border=
"0">&
nbsp; Add DNS</div>
1968 return(array($html, $js));
1986 $font_color =
'#FFFFFF';
1990 vertical-align: top;
2004 <!-- QUICK INTERFACE NAT -->
2005 <form
id=
"quick_interface_nat_form" onSubmit=
"return(false);">
2006 <input type=
"hidden" name=
"id" value=
"{$form['id']}">
2007 <input type=
"hidden" name=
"js" value=
"{$form['js']}">
2008 <input type=
"hidden" name=
"nataction" value=
"add">
2009 <input type=
"hidden" name=
"ip" value=
"{$form['interface_id']}">
2010 <table style=
"{$style['content_box']}" cellspacing=
"0" border=
"0" cellpadding=
"0">
2012 <tr><td colspan=
"2" align=
"center" class=
"qf-search-line" style=
"{$style['label_box']}; padding-top: 0px;" onMouseDown=
"dragStart(event, '{$form['id']}', 'savePosition', 0);">
2017 <td align=
"right" class=
"qf-search-line">
2020 <td align=
"left" class=
"qf-search-line">
2027 <td align=
"right" class=
"qf-search-line">
2028 <u>E</u>xternal NAT IP
2030 <td align=
"left" class=
"qf-search-line">
2031 <input
id=
"natip" name=
"natip" type=
"text" class=
"edit" size=
"24" accesskey=
"e" value=
"{$form['natip']}" />
2036 <td align=
"right" class=
"qf-search-line">
2039 <td align=
"right" class=
"qf-search-line">
2040 <input
class=
"button" type=
"button" name=
"cancel" value=
"Cancel" onClick=
"removeElement('{$form['id']}');">
2041 <input
class=
"button" type=
"button" name=
"save" value=
"Save" accesskey=
"m" onClick=
"xajax_window_submit('tooltips', xajax.getFormValues('quick_interface_nat_form'), 'interface_nat_save');removeElement('{$form['id']}');">
2051 el(
'natip').focus();
2054 return(array($html, $js));
2072 if (! (
auth(
'interface_modify')) ) {
2074 $response->addScript(
"alert('Permission denied!');");
2075 return($response->getXML());
2084 $refresh =
"xajax_window_submit('list_interfaces', xajax.getFormValues('list_interfaces_filter_form'), 'display_list');";
2087 if (!$form[
'ip'] and !$form[
'natip']) {
2088 $response->addScript(
"alert('Please complete all fields to continue!');");
2089 return($response->getXML());
2093 $module =
'nat_add';
2094 if ($form[
'nataction'] ==
"delete") { $module =
'nat_del'; }
2097 if ($module ==
'nat_add') {
2098 $ipflip =
ip_mangle($form[
'natip'],
'flip');
2099 $octets = explode(
".",$ipflip);
2101 if (!$ptrdomain[
'id']) {
2102 printmsg(
"ERROR => This operation tried to create a PTR record that is the first in the {$octets[3]}.0.0.0 class A range. You must first create at least the following DNS domain: {$octets[3]}.in-addr.arpa",3);
2103 $self[
'error'] =
"ERROR => This operation tried to create a PTR record that is the first in the {$octets[3]}.0.0.0 class A range. You must first create at least the following DNS domain: {$octets[3]}.in-addr.arpa. You could also create domains for class B or class C level reverse zones. Click OK to open add domain dialog";
2104 $response->addScript(
"alert('{$self['error']}');xajax_window_submit('edit_domain', 'newptrdomainname=>{$octets[3]}.in-addr.arpa', 'editor');");
2105 return($response->getXML());
2114 $js .=
"alert('Save failed. ". preg_replace(
'/[\s\']+/',
' ',
$self[
'error']) .
"');";
2116 $js .=
"removeElement('{$window_name}');{$refresh}";
2117 if ($form[
'js']) $js .= $form[
'js'];
2122 $response->addScript($js);
2123 return($response->getXML());
2141 $font_color =
'#FFFFFF';
2145 vertical-align: top;
2159 if ($total_interfaces == 1) {
2160 $lastint_js =
"var doit=confirm('This is the last interface on this host, the host will also be deleted once the interface is moved?'); if (doit == true) ";
2166 <!-- QUICK INTERFACE MOVE -->
2167 <form
id=
"quick_interface_move_form" onSubmit=
"return(false);">
2168 <input type=
"hidden" name=
"id" value=
"{$form['id']}">
2169 <input type=
"hidden" name=
"js" value=
"{$form['js']}">
2170 <input type=
"hidden" name=
"ip" value=
"{$form['interface_id']}">
2171 <input type=
"hidden" name=
"orig_host" value=
"{$form['orig_host']}">
2172 <table style=
"{$style['content_box']}" cellspacing=
"0" border=
"0" cellpadding=
"0">
2174 <tr><td colspan=
"2" align=
"center" class=
"qf-search-line" style=
"{$style['label_box']}; padding-top: 0px;" onMouseDown=
"dragStart(event, '{$form['id']}', 'savePosition', 0);">
2175 Quick
interface move
2179 <td align=
"right" class=
"qf-search-line">
2182 <td align=
"left" class=
"qf-search-line">
2189 <td align=
"right" class=
"qf-search-line">
2192 <td align=
"left" class=
"qf-search-line">
2193 <input
id=
"move_hostname" name=
"host" type=
"text" class=
"edit" size=
"24" accesskey=
"h" autocomplete=
"off" />
2194 <div
id=
"suggest_move_hostname" class=
"suggest"></div>
2199 <td align=
"right" class=
"qf-search-line">
2202 <td align=
"right" class=
"qf-search-line">
2203 <input
class=
"button" type=
"button" name=
"cancel" value=
"Cancel" onClick=
"removeElement('{$form['id']}');">
2204 <input
class=
"button" type=
"button" name=
"move" value=
"Move" accesskey=
"m" onClick=
"{$lastint_js} xajax_window_submit('tooltips', xajax.getFormValues('quick_interface_move_form'), 'interface_move_save');removeElement('{$form['id']}');">
2214 el(
'move_hostname').focus();
2215 suggest_setup(
'move_hostname',
'suggest_move_hostname');
2218 return(array($html, $js));
2236 if (! (
auth(
'advanced')) ) {
2238 $response->addScript(
"alert('Permission denied!');");
2239 return($response->getXML());
2246 $refresh =
"xajax_window_submit('list_interfaces', xajax.getFormValues('list_interfaces_filter_form'), 'display_list');";
2249 if (!$form[
'host'] and !$form[
'ip']) {
2250 $response->addScript(
"alert('Please complete all fields to continue!');");
2251 return($response->getXML());
2257 $module =
'interface_move_host';
2264 $js .=
"alert('Save failed. ". preg_replace(
'/[\s\']+/',
' ',
$self[
'error']) .
"');";
2267 if ($total_interfaces == 0) {
2272 list(
$status,
$output) =
run_module(
'interface_move_host', array(
'host' => $form[
'orig_host'],
'ip' => $form[
'ip']));
2273 $js .=
"alert('Host delete failed. ". preg_replace(
'/[\s\']+/',
' ',
$self[
'error']) .
"');";
2276 $js .=
"removeElement('{$window_name}');{$refresh}";
2277 if ($form[
'js']) $js .= $form[
'js'];
2281 $js .=
"removeElement('{$window_name}');{$refresh}";
2282 if ($form[
'js']) $js .= $form[
'js'];
2288 $response->addScript($js);
2289 return($response->getXML());
2311 if ($rows == 0 or
$status)
return(array(
'',
''));
2315 <!-- Custom Attribute Info -->
2316 <table cellspacing=
"0" border=
"0" cellpadding=
"0">
2319 <td align=
"left" nowrap=
"true" colspan=
"99"><b><u>Custom Attribute Info</u></b>&
nbsp;</td>
2323 <td align=
"right" nowrap=
"true" style=
"font-weight: bold;">
2326 <td
class=
"padding" align=
"left" >
2332 <td align=
"right" nowrap=
"true" style=
"font-weight: bold;">
2335 <td
class=
"padding" align=
"left" >
2341 <td align=
"right" nowrap=
"true" style=
"font-weight: bold;">
2344 <td
class=
"padding" align=
"left" >
2348 style=
"font-family: inherit;background-color: white;" 2352 >{$ca[
'value']}</textarea>
2362 return(array($html, $js));
2400 vertical-align: top;
2411 <!-- SWITCHPORT TEMPLATE SELECT -->
2412 <form
id=
"switchport_template_select_form" onSubmit=
"return(false);">
2413 <input type=
"hidden" name=
"host" value=
"{$form['host']}">
2414 <input type=
"hidden" name=
"input_id" value=
"{$form['input_id']}">
2415 <table
id=
"switchport_template_select" style=
"{$style['content_box']}" cellspacing=
"0" border=
"0" cellpadding=
"0">
2417 <td colspan=
"2" align=
"center" class=
"qf-search-line" style=
"{$style['label_box']}; padding-top: 0px;" onMouseDown=
"dragStart(event, '{$form['id']}', 'savePosition', 0);">
2418 Switchport Template Select
2422 <td align=
"right" class=
"qf-search-line">Switch:&
nbsp;</td>
2423 <td align=
"left" class=
"qf-search-line">{$form[
'host']}</td>
2426 <td align=
"right" class=
"qf-search-line">Interface:&
nbsp;</td>
2427 <td align=
"left" class=
"qf-search-line">{$form[
'if_name']}</td>
2430 <td align=
"right" class=
"qf-search-line">Current:&
nbsp;</td>
2431 <td align=
"left" class=
"qf-search-line">{$form[
'original_value']}</td>
2434 <td align=
"right" class=
"qf-search-line">Last Changed:&
nbsp;</td>
2435 <td align=
"left" class=
"qf-search-line">{$form[
'time']} by {$form[
'user']}</td>
2438 <td colspan=
"2" class=
"qf-search-line" align=
"left">
2439 <div
id=
"qf_template_list" style=
"overflow: auto; display: block; background-color: rgb(255, 255, 255); height: 150px;">
2440 <table style=
"cursor: pointer;" border=
"0" cellpadding=
"0" cellspacing=
"0" width=
"100%"><tbody>
2442 $templates=explode(
"|",$form[
'template_list']);
2443 foreach($templates as $template) {
2444 $orig_template =
"orig_".$template;
2447 <tr onmouseover=
"this.className='row-highlight';" 2448 onmouseout=
"this.className='row-normal';" 2449 onclick=
"var _el1 = el('{$form['if_name']}'); 2450 var _el2 = '{$form['original_value']}'; 2451 _el1.value = '$template'; 2452 _el1.style.backgroundColor = '#8ABBFF'; 2453 if(_el1.value == _el2) { _el1.style.backgroundColor = '#FFFFFF'; } 2454 removeElement('{$form['id']}');">
2455 <td style=
"padding: 0px 2px; font-size: 10px;">{$template}</td>
2460 </div></tbody></table>
2462 <td colspan=
"2"align=
"center" class=
"qf-search-line">
2463 <input
class=
"button" type=
"button" name=
"cancel" value=
"Cancel" onClick=
"removeElement('{$form['id']}');">
2469 return(array($html, $js));
2479 $output = shell_exec(
"ping -n -w 3 -c 3 {$form['ip']}");
2481 $window[
'title'] =
'Ping Results';
2482 $build_commit_html = 0;
2483 $commit_function =
'';
2505 $window_name = $form[
'name'];
2507 $output =
"<center>Working on the results, please wait<br><img src={$images}/loading.gif></center>";
2509 $window[
'title'] =
'Processing...';
2510 $window[
'js'] =
"el('{$window_name}_extras').innerHTML='<br>';";
2511 $build_commit_html = 0;
2512 $commit_function =
'';