Example #1
0
/*
 *
 * Developed by Clayton Dukes <*****@*****.**>
 * Copyright (c) 2009 gdd.net
 * All rights reserved.
 *
 * Changelog:
 * 2009-12-13 - created
 *
 */

session_start();
$basePath = dirname( __FILE__ );
require_once ($basePath . "/../common_funcs.php");
require_once ($basePath . "/../jqNewChart.php");
require_once ($basePath . "/../ajax/ChartFunctions.php");
?>
<div id="chart_mph"></div>
<?php
if ((has_portlet_access($_SESSION['username'], 'Events Per Hour') == TRUE) || ($_SESSION['AUTHTYPE'] == "none")) { 
	mph(); 
} else { 
    ?>
<script type="text/javascript">
$('#portlet_Events_Per_Hour').remove()
$(document).ready(function(){
    error("Access Denied");
    });
</script>
<?php } ?>
 * Developed by Clayton Dukes <*****@*****.**>
 * Copyright (c) 2010 LogZilla, LLC
 * All rights reserved.
 * Last updated on 2010-06-15
 *
 * Changelog:
 * 2010-03-05 - created
 *
 */

session_start();
$basePath = dirname( __FILE__ );
require_once ($basePath . "/../common_funcs.php");
$dbLink = db_connect_syslog(DBADMIN, DBADMINPW);

if ((has_portlet_access($_SESSION['username'], 'Change Password') == TRUE) || ($_SESSION['AUTHTYPE'] == "none")) { 
?>
<table border="0" width="100%">
<thead>
  <tr>
    <th></th>
    <th></th>
    <th></th>
  <tr>
</thead>

<tbody>
    <tr>
        <td colspan="2">
            <?php
            if (getgroup($_SESSION['username']) == "admins") {
<?php

/*
 *
 * Developed by Clayton Dukes <*****@*****.**>
 * Copyright (c) 2009 gdd.net
 * All rights reserved.
 *
 * Changelog:
 * 2009-12-13 - created
 *
 */

session_start();
$basePath = dirname( __FILE__ );
require_once ($basePath . "/../common_funcs.php");
if ((has_portlet_access($_SESSION['username'], 'Messages Per Month') == TRUE) || ($_SESSION['AUTHTYPE'] == "none")) { 
?>
<div id="chart_mmo"></div>
<?php } else { ?>
<script type="text/javascript">
$('#portlet_Messages_Per_Month').remove()
</script>
<?php } ?>
* Changelog:
* 2010-02-28 - created
*
*/

$basePath = dirname( __FILE__ );
require_once ($basePath . "/../common_funcs.php");
$dbLink = db_connect_syslog(DBADMIN, DBADMINPW);

//---------------------------------------------------
// The get_input statements below are used to get
// POST, GET, COOKIE or SESSION variables.
// Note that PLURAL words below are arrays.
//---------------------------------------------------

if ((has_portlet_access($_SESSION['username'], 'Server Settings') == TRUE) || ($_SESSION['AUTHTYPE'] == "none")) { 
?>

<script>
    $(function() {
        $( "#div_admin_accordian" ).accordion({
            navigation: true,
            collapsible: true
        });
    });
</script>

<h3 class="docs">Changing some of these settings will render your server unusable, proceed with CAUTION!!!</h3>

<div id="div_adminMenu" style="padding:2px; width:20%; height:600px;" class="ui-widget-content">
<?php
/*
 * portlet-triggers.php
 *
 * Developed by Clayton Dukes <*****@*****.**>
 * Copyright (c) 2010 LogZilla, LLC
 * All rights reserved.
 *
 * 2010-12-10 - created
 *
 */

$basePath = dirname( __FILE__ );
require_once ($basePath . "/../common_funcs.php");
if ((has_portlet_access($_SESSION['username'], 'Email Alerts') == TRUE) || ($_SESSION['AUTHTYPE'] == "none")) { 
?>

<div id="email_alerts_wrapper">
    <?php require ($basePath . "/../grid/email_alerts.php");?> 
</div>

<script type="text/javascript">
$("#portlet-header_Email_Alerts").prepend('<div id="btn"></div><span class="ui-icon ui-icon-disk"></span>');

//---------------------------------------------------------------
// BEGIN: Save URL function
//---------------------------------------------------------------
// [[ticket:328]] Added doc ready
$(document).ready(function(){
$(".portlet-header .ui-icon-disk").click(function() {
    $("#syslog_hup").dialog({
/*
 *
 * Developed by Clayton Dukes <*****@*****.**>
 * Copyright (c) 2010 LogZilla, LLC
 * All rights reserved.
 * Last updated on 2010-06-15
 *
 * Changelog:
 * 2009-12-13 - created
 *
 */

session_start();
$basePath = dirname( __FILE__ );
require_once ($basePath . "/../common_funcs.php");
if ((has_portlet_access($_SESSION['username'], 'Mnemonics') == TRUE) || ($_SESSION['AUTHTYPE'] == "none")) {
$dbLink = db_connect_syslog(DBADMIN, DBADMINPW);
// -------------------------
// Get Mnemonics
// -------------------------
$sql = "SELECT COUNT(*) FROM (SELECT crc FROM mne where hidden='false') AS result";
$result = perform_query($sql, $dbLink, $_REQUEST['pageId']);
$total = mysql_fetch_row($result);
$count = $total[0];
if( $count >0 ) { 
?>
<script type="text/javascript">
var limit = <?php echo ($_SESSION['PORTLET_MNE_LIMIT'])?>;
var cnt = <?php echo $count?>;
if (cnt < 11) {
    $('#portlet-header_Mnemonics').text("Last " + cnt + " Cisco Mnemonics");
</thead>
  <tbody>
        <?php
	    $query = "SELECT header, group_access FROM ui_layout GROUP BY header ORDER BY header ASC";
	    $result = perform_query($query, $dbLink, $_SERVER['PHP_SELF']);
	    while($row = fetch_array($result)) {
            $header = $row['header'];
            $group_access = $row['group_access'];
            $option_selected = $row['group_access'];
            $sheader = str_replace(" ", "_", $header);
            ?>
    <tr>
        <td>
        </td>
        <td>
        <?php if (has_portlet_access($_SESSION['username'], $header) == TRUE) { ?>
            <input checked="yes" class="checkbox" type='checkbox' id='chk_portlet_user_perms' name="<?php echo $sheader?>" value='<?php echo $header?>'>
                <?php } else { ?>
            <input class="checkbox" type='checkbox' id='chk_portlet_user_perms' name="<?php echo $sheader?>" value='<?php echo $header?>'>
                <?php } ?>
            <?php 
            if ($group_access == 'admins') { 
                echo "<font color=\"red\">$header</font>";
            } else {
                echo $header;
            }
            ?>
        </td>
    </tr>
        <?php } // END while loop ?>
    <tr>
/*
 *
 * Developed by Clayton Dukes <*****@*****.**>
 * Copyright (c) 2010 LogZilla, LLC
 * All rights reserved.
 * Last updated on 2010-06-15
 *
 * Changelog:
 * 2009-12-13 - created
 *
 */

session_start();
$basePath = dirname( __FILE__ );
require_once ($basePath . "/../common_funcs.php");
if ((has_portlet_access($_SESSION['username'], 'Date and Time') == trUE) || ($_SESSION['AUTHTYPE'] == "none")) { 
?>
<table width="100%" border="0">
        <?php if ($_SESSION['DEDUP'] == "1") { ?>
    <tr id="fotr">
        <td width="10%">
            <input type="checkbox" name="fo_checkbox" id="fo_checkbox">
            <b>FO</b>
        </td>
        <td width="90%" COLSPAN="2">
            <div id="fo_date_wrapper">
                <input type="text" size="25" value="<?php echo date("Y-m-d")?>" name="fo_date" id="fo_date">
            </div>
            <!--The fo_time_wrapper div is referenced in jquery.timePicker.js -->
            <div id="fo_time_wrapper"> 
                <input type="text" class="rounded_textbox watermark ui-widget ui-corner-all" name="fo_time_start" id="fo_time_start" size="10" value="00:00:00" /> 
 * Developed by Clayton Dukes <*****@*****.**>
 * Copyright (c) 2010 LogZilla, LLC
 * All rights reserved.
 * Last updated on 2010-06-15
 *
 * Changelog:
 * 2010-03-05 - created
 *
 */

session_start();
$basePath = dirname( __FILE__ );
require_once ($basePath . "/../common_funcs.php");
$dbLink = db_connect_syslog(DBADMIN, DBADMINPW);

if ((has_portlet_access($_SESSION['username'], 'Delete User') == TRUE) || ($_SESSION['AUTHTYPE'] == "none")) {
?>

<table border="0" width="100%">
    <tr>
        <td width="70%">
        <select class="chzn-select" style="width:99%" id="sel_deluser">
        <?php
	    $query = "SELECT * FROM ".$_SESSION['TBL_AUTH'] ." WHERE username !='local_noauth' AND username !='$_SESSION[username]'";
	    $result = perform_query($query, $dbLink, $_SERVER['PHP_SELF']);
	    while($row = fetch_array($result)) {
            $del_user = $row['username'];
		    echo "<option name=\"del_user\ value=\"$del_user\">".htmlentities($del_user)."</option>\n";
	    }
        ?>
        </select>
 * Last updated on 2010-06-15
 *
 * Pagination and table formatting created using 
 * http://www.frequency-decoder.com/2007/10/19/client-side-table-pagination-script/
 * Changelog:
 * 2010-02-28 - created
 *
 */

// session_start();
$basePath = dirname( __FILE__ );
require_once ($basePath . "/../common_funcs.php");
require_once ($basePath . "/../jqNewChart.php");
require_once ($basePath . "/portlet_header.php");

if ((has_portlet_access($_SESSION['username'], 'Graph Results') == TRUE) || ($_SESSION['AUTHTYPE'] == "none")) { 
    $dbLink = db_connect_syslog(DBADMIN, DBADMINPW);


    if (!$error) {
        //------------------------------------------------------------
        // Run the search query to get results from Sphinx
        //------------------------------------------------------------

        // #425: Moved below to portlet_header
        // $json_o = search_graph(json_encode($searchArr), $spx_max, "distributed", $spx_ip, $spx_port);


        //------------------------------------------------------------
        // If something goes wrong, search() will return an error
        //------------------------------------------------------------
/*
 *
 * Developed by Clayton Dukes <*****@*****.**>
 * Copyright (c) 2009 gdd.net
 * All rights reserved.
 *
 * Changelog:
 * 2009-12-13 - created
 *
 */

session_start();
$basePath = dirname( __FILE__ );
require_once ($basePath . "/../common_funcs.php");
if ((has_portlet_access($_SESSION['username'], 'Search Options') == TRUE) || ($_SESSION['AUTHTYPE'] == "none")) {
    $dbLink = db_connect_syslog(DBADMIN, DBADMINPW);
    // -------------------------
    // Get Message count and duplicate calculation
    // -------------------------
    if ($_SESSION['SHOWCOUNTS'] == "1") {
        if ($_SESSION['DEDUP'] == "1") {
            $sql = "SELECT (SELECT value FROM cache WHERE name='msg_sum') as count_all, (SELECT TABLE_ROWS FROM information_schema.tables WHERE table_schema = DATABASE() AND TABLE_NAME='".$_SESSION["TBL_MAIN"]."') as count";
            $result = perform_query($sql, $dbLink, $_REQUEST['pageId']);
            $line = fetch_array($result);
            $sumcnt = $line['count_all'];
            $count = $line['count'];
            if ($count > 0) {
                $r = ( $sumcnt - $count );
                $percent = ($r/$sumcnt) * 100;
            }
Example #12
0
<?php
/*
 *
 * Developed by Clayton Dukes <*****@*****.**>
 * Copyright (c) 2010 gdd.net
 * All rights reserved.
 *
 * Changelog:
 * 2010-03-05 - created
 *
 */

session_start();
$basePath = dirname( __FILE__ );
require_once ($basePath . "/../common_funcs.php");
if ((has_portlet_access($_SESSION['username'], 'Portlet User Permissions') == TRUE) || ($_SESSION['AUTHTYPE'] == "none")) {
    $dbLink = db_connect_syslog(DBADMIN, DBADMINPW);
//    $sql = "SELECT COUNT(*) FROM (SELECT host FROM hosts where rbac(".$_SESSION['rbac'].", rbac_key) and hidden='false') AS result";
    $sql = "SELECT COUNT(*) FROM hosts AS result";
    $result = perform_query($sql, $dbLink, $_REQUEST['pageId']);
    $total = mysql_fetch_row($result);
    $count = $total[0];
    ?>

    <table border="0" width="100%" id="tbl_rbac">
        <thead>
            <tr>
                <th width="33%" style="text-align: left;"></th>
                <th width="33%" style="text-align: left;"></th>
                <th width="33%" style="text-align: left;"></th>
            </tr>
             } else {
                 $sql = "DELETE FROM ui_layout WHERE group_access='{$group}' AND header='{$header}' and userid=(SELECT id FROM users WHERE username='******')";
                 // echo "Removed $header access for $user<br>";
                 $result = perform_query($sql, $dbLink, $_SERVER['PHP_SELF']);
             }
         }
     }
     echo "Updated Portlet Access for {$user}<br>";
     break;
 case "portlet_user_perm_getperm":
     $user = get_input('user');
     $headers = get_input('headers');
     $pieces = explode(",", $headers);
     foreach ($pieces as $header) {
         $header = str_replace("_", " ", $header);
         if (has_portlet_access($user, $header) == TRUE) {
             $header = str_replace(" ", "_", $header);
             $data->{$header} = "true";
         } else {
             // Note: didn't really need to return false below, just did it so
             // the ajax wouldn't throw a null when the user had no access.
             $header = str_replace(" ", "_", $header);
             $data->{$header} = "false";
         }
     }
     echo json_encode($data);
     break;
 case "group_assignments_getgroup":
     $users = get_input('users');
     $pieces = explode(",", $users);
     foreach ($pieces as $user) {
/*
 *
 * Developed by Clayton Dukes <*****@*****.**>
 * Copyright (c) 2009 gdd.net
 * All rights reserved.
 *
 * Changelog:
 * 2009-12-13 - created
 *
 */

session_start();
$basePath = dirname( __FILE__ );
require_once ($basePath . "/../common_funcs.php");
if ((has_portlet_access($_SESSION['username'], 'Facilities') == TRUE) || ($_SESSION['AUTHTYPE'] == "none")) { 
$dbLink = db_connect_syslog(DBADMIN, DBADMINPW);

?>
<table border="0" width="100%">
    <thead>
        <tr>
            <th width="100%"></th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>
                <select name="facilities[]" id="facilities" multiple size=5>
                    <?php
                    $sql = "SELECT * FROM facilities ORDER BY code DESC";
<?php
/*
 * portlet-triggers.php
 *
 * Developed by Clayton Dukes <*****@*****.**>
 * Copyright (c) 2010 LogZilla, LLC
 * All rights reserved.
 *
 * 2010-12-10 - created
 *
 */

$basePath = dirname( __FILE__ );
require_once ($basePath . "/../common_funcs.php");
if ((has_portlet_access($_SESSION['username'], 'Edit Favorites') == TRUE) || ($_SESSION['AUTHTYPE'] == "none")) { 
?>

<div id="favorites_wrapper">
    <?php require ($basePath . "/../grid/favorites.php");?> 
</div>

<?php } else { ?>
<script type="text/javascript">
$('#portlet_Edit_Favorites').remove()
</script>
<?php } ?>
/*
 *
 * Developed by Clayton Dukes <*****@*****.**>
 * Copyright (c) 2010 LogZilla, LLC
 * All rights reserved.
 * Last updated on 2010-06-15
 *
 * Changelog:
 * 2009-12-13 - created
 *
 */

session_start();
$basePath = dirname( __FILE__ );
require_once ($basePath . "/../common_funcs.php");
if ((has_portlet_access($_SESSION['username'], 'Snare EventId') == TRUE) || ($_SESSION['AUTHTYPE'] == "none")) {
$dbLink = db_connect_syslog(DBADMIN, DBADMINPW);
// -------------------------
// Get EventId
// -------------------------
$sql = "SELECT COUNT(*) FROM (SELECT eid FROM snare_eid where eid>0 and hidden='false') AS result";
$result = perform_query($sql, $dbLink, $_REQUEST['pageId']);
$total = mysql_fetch_row($result);
$count = $total[0];
if( $count >0 ) { 
?>
<script type="text/javascript">
var limit = <?php echo ($_SESSION['PORTLET_EID_LIMIT'])?>;
var cnt = <?php echo $count?>;
if (cnt < 11) {
    $('#portlet-header_Snare_EventId').text("Last " + cnt + " Windows Event ID's");