if (ossim_error()) { die(ossim_error()); } $prev = ""; $fnd = array(); if (preg_match("/(.*=)(.*\\|)(.*)/", $str, $fnd)) { $prev = $fnd[2]; $str = $fnd[1] . $fnd[3]; } $data = array(); $top = 10; $tag_typing = 0; if (trim($str) != "") { list($sensors, $hosts) = Host::get_ips_and_hostname($conn); $nets = Net::get_list($conn); $plugins = GetPlugins($conn); $sourcetypes = GetSourceTypes($conn); $plugingroups = Plugingroup::get_list($conn); $ports = Port::get_list($conn); $categories = GetPluginCategories($conn); $subcategories = GetPluginSubCategories($conn, $categories); // Typing a tag if (preg_match("/^(sensor|src|dst|plugin|datasource|plugingroup|dsgroup|src_port|dst_port|product_type|event_category|category|data)(\\!?\\=)(.*)/i", $str, $found)) { $tag_typing = 1; $str = $found[3]; $op = $found[2]; if ($str == "") { $str = "."; } $qstr = $str; if ($found[1] == "sensor") {
function ParseInput() { global $TabList; global $BookmarkVars; global $GraphTabs; global $Refresh; // Preset refresh value. Any Input pasring routing may reset refresh to 0, to disable refresh $_SESSION['refresh'] = $Refresh; /* * user input may come from forms or links (POST or GET data) due to normal * form processing. If a bookmark is specified in the URL, this overwrites other * input data. To simplify data input checks, the bookmark is handled as any other post request */ ReportLog("ParseInput:"); if (isset($_GET['bookmark'])) { // process bookmarkstring $_bookmark = Util::htmlentities(base64_decode(urldecode($_GET['bookmark']))); ReportLog("Bookmark: '{$_bookmark}'"); $_vars = explode('|', $_bookmark); if (count($BookmarkVars) == count($_vars)) { for ($i = 0; $i < count($BookmarkVars); $i++) { if ($_vars[$i] != '-') { $_varpath = explode('/', $BookmarkVars[$i]); $_varname = count($_varpath) == 2 ? $_varpath[1] : $_varpath[0]; ReportLog("Bookmark: Set {$_varname}"); $_POST[$_varname] = $_vars[$i]; } } } else { SetMessage('warning', "Bookmark processing error"); } } // process tab if (!array_key_exists('tab', $_SESSION)) { // first time in this session // initialize some more vars in the SESSION var InitSession(count($BookmarkVars)); } else { $_tab = $_SESSION['tab']; } // click on tab list if (array_key_exists('tab', $_GET)) { $_tab = $_GET['tab']; } // tab from bookmark overwrites other entries if (array_key_exists('tab', $_POST)) { $_tab = $_POST['tab']; } $tab_changed = 0; if ($_tab != $_SESSION['tab'] || $_SESSION['tab'] == NULL) { // _tab changed since last cycle if (array_key_exists('tablock', $_SESSION)) { // must not change tab right now SetMessage('error', $_SESSION['tablock']); } else { // Verify new tab if (!is_numeric($_tab) || ($_tab > count($TabList) || $_tab < 0)) { SetMessage('warning', "Requested Tab not available. Set default tab to " . $TabList[0]); $_tab = 0; } $_tab = (int) $_tab; $_SESSION['tab'] = $_tab; if (!isset($_GET['bookmark'])) { $tab_changed = 1; } ReportLog("Tab: Set tab to {$_tab}: " . $TabList[$_tab]); } } // rebuild profile list if ($tab_changed && $_SESSION['tab'] == 4) { unset($_SESSION['ProfileList']); unset($_SESSION['PluginList']); $profiles = GetProfiles(); GetPlugins(); } // process sub tab $_tab = -1; if (array_key_exists('sub_tab', $_GET)) { $_tab = strip_tags($_GET['sub_tab']); } if (array_key_exists('sub_tab', $_POST)) { $_tab = strip_tags($_POST['sub_tab']); } if ($_tab >= 0) { if (!is_numeric($_tab) || $_tab < 0) { $_tab = 0; } $_SESSION['sub_tab'] = $_tab; ReportLog("Subtab: Set tab to {$_tab}: " . $GraphTabs[$_tab]); } // process profileswitch if (!array_key_exists('profileswitch', $_SESSION)) { // this is fishy - InitSession should have set this SetMessage('error', "Missing session parameter 'profileswitch'"); $_SESSION['refresh'] = 0; return array(FALSE, 0, 0); } else { $_profileswitch = $_SESSION['profileswitch']; } if (array_key_exists('profileswitch', $_POST)) { $_profileswitch = Util::htmlentities($_POST['profileswitch']); } // the alerting module only accepts profile live for now if ($_SESSION['tab'] == 3) { $_profileswitch = './live'; } $profile_changed = 0; if ($_profileswitch != $_SESSION['profileswitch']) { if ($_profileswitch == "New Profile ...") { // make sure the profile admin page gets this request; $_SESSION['tab'] = 4; $_SESSION['new_profile'] = TRUE; $_SESSION['refresh'] = 0; } else { // process new profileswitch if (preg_match("/^(.+)\\/(.+)/", $_profileswitch, $matches)) { $_profilegroup = $matches[1]; $_profilename = $matches[2]; // Check if profilegroup/profilename exists $_found = FALSE; foreach ($_SESSION['ProfileList'] as $p) { if ($p == $_profileswitch) { $_found = TRUE; } } if (!$_found) { SetMessage('error', "Profile '{$_profilename}' does not exists in profile group '{$_profilegroup}'"); SetMessage('warning', "Fall back to profile live"); $_profilegroup = '.'; $_profilename = 'live'; } } else { SetMessage('error', "Can not parse profileswitch"); SetMessage('warning', "Fall back to profile live"); $_profilegroup = '.'; $_profilename = 'live'; } $profile_changed = 1; $_SESSION['profile'] = $_profilename; $_SESSION['profilegroup'] = $_profilegroup; $_SESSION['profileswitch'] = $_profileswitch; } } $profileinfo = ReadProfile($_SESSION['profileswitch']); if ($profileinfo == FALSE) { SetMessage('warning', "Fall back to profile live"); unset($_SESSION['ProfileList']); $profiles = GetProfiles(); $_SESSION['profileswitch'] = './live'; $_SESSION['profile'] = 'live'; $_SESSION['profilegroup'] = '.'; $profileinfo = ReadProfile('./live'); if ($profileinfo == FALSE) { // double failure SetMessage('error', "Can't read profile 'live'"); $_SESSION['refresh'] = 0; return array(FALSE, 0, 0); } } if ($profileinfo['status'] == 'new') { $_SESSION['tab'] = 4; $_SESSION['refresh'] = 0; $_SESSION['tablock'] = "A new profile needs to be completed first."; } else { unset($_SESSION['tablock']); } $_SESSION['profileinfo'] = $profileinfo; // no refresh for history profiles if (($profileinfo['type'] & 3) == 1) { $_SESSION['refresh'] = 0; } return array(TRUE, $tab_changed, $profile_changed); }
function getHAP4NfSenId() { $plugins = GetPlugins(); for ($i = 0; $i < count($plugins); $i++) { $plugin = $plugins[$i]; if ($plugin == "HAP4NfSen") { return $i; } } return -1; }
</div> </div> <div class='siem_form_column'> <!-- Data Sources --> <div class='siem_form_title'><?php echo _("Data Sources"); ?> </div> <div> <select name="plugin" class="selectp" onchange="$('input[name=sourcetype],#category,#subcategory').val('');this.form.bsf.click()"><option value=''></option> <?php // Get Plugins $snortsensors = GetPlugins($db); uksort($snortsensors, "strnatcasecmp"); // Get selected $plugins_selected = array(); if (preg_match('/\\,/', $_SESSION['plugin'])) { $plugins_selected = explode(',', $_SESSION['plugin']); } elseif (preg_match('/(\\d+)\\-(\\d+)/', $_SESSION['plugin'], $found) && $found[1] < $found[2]) { for ($i = $found[1]; $i <= $found[2]; $i++) { $plugins_selected[] = $i; } } else { $plugins_selected[] = $_SESSION['plugin']; } // Print select box foreach ($snortsensors as $plugin_name => $pids) { $pid = implode(",", $pids);
function navigator() { global $self; global $TabList; global $GraphTabs; $numtabs = count($TabList); $plugins = GetPlugins(); $profiles = GetProfiles(); $profileswitch = $_SESSION['profileswitch']; switch ($_SESSION['profileinfo']['type'] & 3) { case 0: $profile_type = 'live'; break; case 1: $profile_type = 'history'; break; case 2: $profile_type = 'continuous'; break; default: $type = 'unknown'; } $profile_type .= ($_SESSION['profileinfo']['type'] & 4) > 0 ? ' / shadow' : ''; global $conf; echo "<link rel='stylesheet' type='text/css' href='../style/style.css'/>"; include "../hmenu.php"; ?> <div style="position:absolute;right:95px;top:11px;vertical-align:bottom;width:450px;"> <table border=0 align="right" style="margin:0px;padding:0px;background-color:transparent;border:0px none"> <tr><td align="right" class="white" nowrap style="background-color:transparent;border:0px none"> <a class="white<?php echo $_SESSION['tab'] == 2 ? "n" : ""; ?> " href="index.php?tab=2&hmenu=Network&smenu=Network"><?php echo _("Details"); ?> </a> | <a class="white<?php echo $_SESSION['tab'] == 0 ? "n" : ""; ?> " href="index.php?tab=0&hmenu=Network&smenu=Network"><?php echo _("Overview"); ?> </a> | <a class="white<?php echo $_SESSION['tab'] == 1 ? "n" : ""; ?> " href="index.php?tab=1&hmenu=Network&smenu=Network"><?php echo _("Graphs"); ?> </a> </td> <td align="right" class="white" nowrap style="padding-left:40px;padding-right:20px;background-color:transparent;border:0px none"> <!--<?php echo $profile_type; ?> --> <?php echo _("Profile"); ?> : <a class="select_pullup" id="profilemenu" href="javascript:void(0);" onclick="openSelect(this);" onMouseover="openSelect(this);" onMouseout="selectMouseOut();"></a> | <a class="white<?php echo $_SESSION['tab'] == 3 ? "n" : ""; ?> " href="index.php?tab=3&hmenu=Network&smenu=Network"><?php echo _("Alerts"); ?> </a> | <a class="white<?php echo $_SESSION['tab'] == 4 ? "n" : ""; ?> " href="index.php?tab=4&hmenu=Network&smenu=Network"><?php echo _("Stats"); ?> </a> | <a class="white<?php echo $_SESSION['tab'] == 5 ? "n" : ""; ?> " href="index.php?tab=5&hmenu=Network&smenu=Network"><?php echo _("Plugins"); ?> </a> | <a class="white" href="../sensor/sensor.php?hmenu=SIEM+Components&smenu=SIEM+Components"><?php echo _("Sensors"); ?> </a> </td></tr> </table> </div> <form action="<?php echo $self; ?> " name='navi' method="POST"> <input type="hidden" id="profilemenu_field" name="profileswitch" value="<?php echo $profileswitch; ?> "> <div class="shadetabs" style="display:none"><br> <table border='0' cellpadding="0" cellspacing="0"> <tr> <td> <ul> <?php for ($i = 0; $i < $numtabs; $i++) { if ($i == $_SESSION['tab']) { print "<li class='selected'><a href='{$self}?tab={$i}'>" . $TabList[$i] . "</a></li>\n"; } else { print "<li><a href='{$self}?tab={$i}'>" . $TabList[$i] . "</a></li>\n"; } } ?> </ul> </td> <td class="navigator"> <?php echo $profile_type; ?> </td> <td class="navigator"> <?php print "<a href='{$self}?bookmark=" . $_SESSION['bookmark'] . "'>" . _("Bookmark URL") . "</a>\n"; ?> </td> <td class="navigator"><?php echo _("Profile"); ?> :</td> <td> <!-- <a class="select_pullup" id="profilemenu" href="javascript:void(0);" onclick="openSelect(this);" onMouseover="selectMouseOver();" onMouseout="selectMouseOut();"></a> --> </td> </tr> </table> </div> <?php $_tab = $_SESSION['tab']; if ($TabList[$_tab] == 'Graphs') { $_sub_tab = $_SESSION['sub_tab']; ?> <div class="shadetabs"> <table border='0' cellpadding="0" cellspacing="0" class="noborder" align="center"> <tr> <td class="noborder" style="padding-bottom:5px;text-align:center"> <?php for ($i = 0; $i < count($GraphTabs); $i++) { if ($i > 0) { echo " "; } if ($i == $_sub_tab) { print "<b>[ <a href='{$self}?sub_tab={$i}'>" . $GraphTabs[$i] . "</a> ]</b>\n"; } else { print "[ <a href='{$self}?sub_tab={$i}'>" . $GraphTabs[$i] . "</a> ]\n"; } } ?> </td> </tr> </table> </div> <?php } if ($TabList[$_tab] == 'Plugins') { if (count($plugins) == 0) { ?> <div class="shadetabs"><br> <h3 style='margin-left: 10px;margin-bottom: 2px;margin-top: 2px;'><?php echo _("No plugins available!"); ?> </h3> </div> <?php } else { ?> <div class="shadetabs"><br> <table border='0' cellpadding="0" cellspacing="0"> <tr> <td> <ul> <?php for ($i = 0; $i < count($plugins); $i++) { if ($i == $_SESSION['sub_tab']) { print "<li class='selected'><a href='{$self}?sub_tab={$i}'>" . $plugins[$i] . "</a></li>\n"; } else { print "<li><a href='{$self}?sub_tab={$i}'>" . $plugins[$i] . "</a></li>\n"; } } ?> </ul> </td> </tr> </table> </div> <?php } } print "</form>\n"; print "<script language='Javascript' type='text/javascript'>\n"; print "selectMenus['profilemenu'] = 0;\n"; $i = 0; $savegroup = ''; $groupid = 0; foreach ($profiles as $profileswitch) { if (preg_match("/^(.+)\\/(.+)/", $profileswitch, $matches)) { $profilegroup = $matches[1]; $profilename = $matches[2]; if ($profilegroup == '.') { print "selectOptions[selectOptions.length] = '0||{$profilename}||./{$profilename}'; \n"; } else { if ($profilegroup != $savegroup) { $savegroup = $profilegroup; print "selectOptions[selectOptions.length] = '0||{$profilegroup}||@@0.{$i}'; \n"; $groupid = $i; $i++; } print "selectOptions[selectOptions.length] = '0.{$groupid}||{$profilename}||{$profilegroup}/{$profilename}'; \n"; } } else { print "selectOptions[selectOptions.length] = '0||{$profileswitch}||{$profileswitch}'; \n"; } $i++; } print "selectRelateMenu('profilemenu', function() { document.navi.submit(); });\n"; // print "selectRelateMenu('profilemenu', false );\n"; print "</script>\n"; print "<noscript><h3 class='errstring'>" . _("Your browser does not support JavaScript! NfSen will not work properly!") . "</h3></noscript>\n"; $bk = base64_decode(urldecode($_SESSION['bookmark'])); }
function navigator() { global $self; global $TabList; global $GraphTabs; $numtabs = count($TabList); $plugins = GetPlugins(); $profiles = GetProfiles(); $profileswitch = $_SESSION['profileswitch']; switch ($_SESSION['profileinfo']['type'] & 3) { case 0: $profile_type = 'live'; break; case 1: $profile_type = 'history'; break; case 2: $profile_type = 'continuous'; break; default: $type = 'unknown'; } $profile_type .= ($_SESSION['profileinfo']['type'] & 4) > 0 ? ' / shadow' : ''; ?> <form action="<?php echo $self; ?> " name='navi' method="POST"> <div class="shadetabs"><br> <table border='0' cellpadding="0" cellspacing="0"> <tr> <td> <ul> <?php for ($i = 0; $i < $numtabs; $i++) { if ($i == $_SESSION['tab']) { print "<li class='selected'><a href='{$self}?tab={$i}'>" . $TabList[$i] . "</a></li>\n"; } else { print "<li><a href='{$self}?tab={$i}'>" . $TabList[$i] . "</a></li>\n"; } } ?> </ul> </td> <td class="navigator"> <?php echo $profile_type; ?> </td> <td class="navigator"> <?php print "<a href='{$self}?bookmark=" . $_SESSION['bookmark'] . "'>Bookmark URL</a>\n"; ?> </td> <td class="navigator">Profile:</td> <td> <a class="select_pullup" id="profilemenu" href="javascript:void(0);" onclick="openSelect(this);" onMouseover="selectMouseOver();" onMouseout="selectMouseOut();"></a> </td> </tr> </table> <input type="hidden" id="profilemenu_field" name="profileswitch" value="<?php echo $profileswitch; ?> "> </div> <?php $_tab = $_SESSION['tab']; if ($TabList[$_tab] == 'Graphs') { $_sub_tab = $_SESSION['sub_tab']; ?> <div class="shadetabs"><br> <table border='0' cellpadding="0" cellspacing="0"> <tr> <td> <ul> <?php for ($i = 0; $i < count($GraphTabs); $i++) { if ($i == $_sub_tab) { print "<li class='selected'><a href='{$self}?sub_tab={$i}'>" . $GraphTabs[$i] . "</a></li>\n"; } else { print "<li><a href='{$self}?sub_tab={$i}'>" . $GraphTabs[$i] . "</a></li>\n"; } } ?> </ul> </td> </tr> </table> </div> <?php } if ($TabList[$_tab] == 'Plugins') { if (count($plugins) == 0) { ?> <div class="shadetabs"><br> <h3 style='margin-left: 10px;margin-bottom: 2px;margin-top: 2px;'>No plugins available!</h3> </div> <?php } else { ?> <div class="shadetabs"><br> <table border='0' cellpadding="0" cellspacing="0"> <tr> <td> <ul> <?php for ($i = 0; $i < count($plugins); $i++) { if ($i == $_SESSION['sub_tab']) { print "<li class='selected'><a href='{$self}?sub_tab={$i}'>" . $plugins[$i] . "</a></li>\n"; } else { print "<li><a href='{$self}?sub_tab={$i}'>" . $plugins[$i] . "</a></li>\n"; } } ?> </ul> </td> </tr> </table> </div> <?php } } print "</form>\n"; print "<script language='Javascript' type='text/javascript'>\n"; print "selectMenus['profilemenu'] = 0;\n"; $i = 0; $savegroup = ''; $groupid = 0; foreach ($profiles as $profileswitch) { if (preg_match("/^(.+)\\/(.+)/", $profileswitch, $matches)) { $profilegroup = $matches[1]; $profilename = $matches[2]; if ($profilegroup == '.') { print "selectOptions[selectOptions.length] = '0||{$profilename}||./{$profilename}'; \n"; } else { if ($profilegroup != $savegroup) { $savegroup = $profilegroup; print "selectOptions[selectOptions.length] = '0||{$profilegroup}||@@0.{$i}'; \n"; $groupid = $i; $i++; } print "selectOptions[selectOptions.length] = '0.{$groupid}||{$profilename}||{$profilegroup}/{$profilename}'; \n"; } } else { print "selectOptions[selectOptions.length] = '0||{$profileswitch}||{$profileswitch}'; \n"; } $i++; } print "selectRelateMenu('profilemenu', function() { document.navi.submit(); });\n"; // print "selectRelateMenu('profilemenu', false );\n"; print "</script>\n"; print "<noscript><h3 class='errstring'>Your browser does not support JavaScript! NfSen will not work properly!</h3></noscript>\n"; $bk = base64_decode(urldecode($_SESSION['bookmark'])); }
function navigator() { global $self; global $TabList; global $GraphTabs; $numtabs = count($TabList); $plugins = GetPlugins(); $profiles = GetProfiles(); $profileswitch = $_SESSION['profileswitch']; switch ($_SESSION['profileinfo']['type'] & 3) { case 0: $profile_type = 'live'; break; case 1: $profile_type = 'history'; break; case 2: $profile_type = 'continuous'; break; default: $type = 'unknown'; } $profile_type .= ($_SESSION['profileinfo']['type'] & 4) > 0 ? ' / shadow' : ''; $perms = allowed_nfsen_section(); $disabled = ''; if (!$perms) { $disabled = 'font-style:italic;color: #aeaeae;text-decoration:none;cursor:default;'; } global $conf; ?> <!-- <div style="position:absolute;right:30px;top:15px;vertical-align:bottom;width:450px;"> <table border=0 align="right" style="margin:0px;padding:0px;background-color:transparent;border:0px none"> <tr> <td align="right" class="black" nowrap style="background-color:transparent;border:0px none"> <a class="white" <?php echo $_SESSION['tab'] == 2 ? "style='font-weight:bold !important'" : ""; ?> href="nfsen.php?tab=2"><?php echo _("Details"); ?> </a> </td> <td style='padding:0px 7px 0px 7px' class='separator'><img src='/ossim/pixmaps/1x1.png'/></td> <td> <a style="<?php echo $disabled; echo $_SESSION['tab'] == 0 ? ";font-weight:bold !important" : ""; ?> " class="white" href="<?php echo $perms ? "nfsen.php?tab=0" : "javascript:;"; ?> "><?php echo _("Overview"); ?> </a> </td> <td style='padding:0px 7px 0px 7px' class='separator'><img src='/ossim/pixmaps/1x1.png'/></td> <td> <a style="<?php echo $disabled; echo $_SESSION['tab'] == 1 ? ";font-weight:bold !important" : ""; ?> " class="white" href="<?php echo $perms ? "nfsen.php?tab=1" : "javascript:;"; ?> "><?php echo _("Graphs"); ?> </a> </td> </tr> </table> </div> --> <form action="<?php echo $self; ?> " name='navi' method="POST"> <div class="shadetabs" style="display:none"><br> <table border='0' cellpadding="0" cellspacing="0"> <tr> <td> <ul> <?php for ($i = 0; $i < $numtabs; $i++) { if ($i == $_SESSION['tab']) { echo "<li class='selected'><a href='{$self}?tab={$i}'>" . $TabList[$i] . "</a></li>\n"; } else { echo "<li><a href='{$self}?tab={$i}'>" . $TabList[$i] . "</a></li>\n"; } } ?> </ul> </td> <td class="navigator"> <?php echo $profile_type; ?> </td> <td class="navigator"><?php echo _("Profile"); ?> :</td> </tr> </table> <input type="hidden" id="profilemenu_field" name="profileswitch" value="<?php echo Util::htmlentities($profileswitch); ?> "> </div> <?php $_tab = $_SESSION['tab']; if ($TabList[$_tab] == 'Graphs') { $_sub_tab = $_SESSION['sub_tab']; $base_url = Menu::get_menu_url('/ossim/nfsen/nfsen.php?tab=1', 'environment', 'netflow', 'graph'); ?> <div class="shadetabs"> <br> <table border='0' cellpadding="0" cellspacing="0" class="noborder" align="center"> <tr> <td class="noborder" style="padding-bottom:5px;text-align:center"> <?php for ($i = 0; $i < count($GraphTabs); $i++) { $g_url = $base_url . '&sub_tab=' . $i; if ($i > 0) { echo "| "; } if ($i == $_sub_tab) { echo "<a href='{$g_url}'><strong>" . $GraphTabs[$i] . "</strong></a>\n"; } else { echo "<a href='{$g_url}'>" . $GraphTabs[$i] . "</a>\n"; } } ?> </td> </tr> </table> </div> <?php } if ($TabList[$_tab] == 'Plugins') { if (count($plugins) == 0) { ?> <div class="shadetabs"><br> <h3 style='margin-left: 10px;margin-bottom: 2px;margin-top: 2px;'>No plugins available!</h3> </div> <?php } else { ?> <div class="shadetabs"><br> <table border='0' cellpadding="0" cellspacing="0"> <tr> <td> <ul> <?php for ($i = 0; $i < count($plugins); $i++) { if ($i == $_SESSION['sub_tab']) { print "<li class='selected'><a href='{$self}?sub_tab={$i}'>" . Util::htmlentities($plugins[$i]) . "</a></li>\n"; } else { print "<li><a href='{$self}?sub_tab={$i}'>" . Util::htmlentities($plugins[$i]) . "</a></li>\n"; } } ?> </ul> </td> </tr> </table> </div> <?php } } print "</form>\n"; print "<script language='Javascript' type='text/javascript'>\n"; print "selectMenus['profilemenu'] = 0;\n"; /* $i = 0; $savegroup = ''; $groupid = 0; foreach ($profiles as $profileswitch) { if (preg_match("/^(.+)\/(.+)/", $profileswitch, $matches)) { $profilegroup = $matches[1]; $profilename = $matches[2]; $profilename = Util::htmlentities($profilename); $profilegroup = Util::htmlentities($profilegroup); $profileswitch = Util::htmlentities($profileswitch); if ($profilegroup == '.') { print "selectOptions[selectOptions.length] = '0||$profilename||./$profilename'; \n"; } else { if ($profilegroup != $savegroup) { $savegroup = $profilegroup; print "selectOptions[selectOptions.length] = '0||$profilegroup||@@0.$i'; \n"; $groupid = $i; $i++; } print "selectOptions[selectOptions.length] = '0.$groupid||$profilename||$profilegroup/$profilename'; \n"; } } else { print "selectOptions[selectOptions.length] = '0||".Util::htmlentities($profileswitch)."||".Util::htmlentities($profileswitch)."'; \n"; } $i++; } */ //print "selectRelateMenu('profilemenu', function() { document.navi.submit(); });\n"; // print "selectRelateMenu('profilemenu', false);\n"; print "</script>\n"; print "<noscript><h3 class='errstring'>" . _("Your browser does not support JavaScript! NfSen will not work properly!") . "</h3></noscript>\n"; $bk = base64_decode(urldecode($_SESSION['bookmark'])); }
</tr> </table> </form> <form method="post"> <input type="hidden" name="botversion" value="chinese" /> <table border="1" class="mainTable" width="750"> <tr id="header"> <td align="center"><b>Plugin</b></td> <td align="center"><b>Installed Version</b></td> <td align="center"><b>Available Version</b></td> <td align="center"><b>What's New</b></td> <td align="center"><b>Install/Update</b></td> <td align="center"><b>Repair</b></td> </tr> <?php $cplugs = GetPlugins('chinese'); foreach ($cplugs as $plug) { ?> <tr> <td><?php echo $plug['name']; ?> </td> <td align="center"><?php echo $plug['installver']; ?> </td> <td align="center"><?php echo $plug['serverver']; ?> </td>
<?php $base_path = getcwd(); $pos1 = strpos($base_path, '\\'); $pos2 = strpos($base_path, '\\', $pos1 + 1); $_SESSION['base_path'] = getcwd() . '\\'; echo $_SESSION['base_path']; GetPlugins(); GetParser(); CreatePluginManifest(); function GetPlugins() { $allplugs = unserialize(file_get_contents('plugins.manifest')); $dir = $_SESSION['base_path'] . 'plugins'; foreach ($allplugs as $aplugs) { if ($aplugs['name'] == 'fBSettings') { continue; } $x = getFileList($dir . '/' . $aplugs['name'], true); if (!empty($x)) { file_put_contents($aplugs['name'] . '.manifest', serialize($x)); } } } function GetParser() { $dir = $_SESSION['base_path'] . 'plugins'; $x = getFileList($dir . '/fBSettings', true); $x2 = getFileList('xulrunner', true); $x4 = getFileList('amfphp', true); $x3 = array_merge($x, $x4, $x2);