Plugin Directory

Changeset 178532


Ignore:
Timestamp:
12/01/2009 06:44:52 PM (16 years ago)
Author:
onykage
Message:

fixed several precurser parse and instant errors.
added some security fixes
added some statitical resorce information to help with debugging.

Location:
wp-vent-spy/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • wp-vent-spy/trunk/includes/buildTable.php

    r160724 r178532  
    22//buildtable
    33//require_once('logtimer.php');
    4 function buildTable( &$stat, $name, $cid ,$base, $chcolor, $adcolor, $phcolor, $uscolor, $fancy) {
     4function buildTable( &$stat, $name, $cid ,$base) {
    55    $tab1 = "\t";
    66    $tab2 = "\t\t";
     
    1010    $nl = "\n";
    1111   
    12     $addchan = "<table border='0' cellpadding='0' cellspacing='0' style='height: 14px;'><tr><td style='height: 14px;'>";
    13     $closechan = "</font></td></tr></table>";
    14     $closeimg = "</td><td style='height: 14px;' <font size='2' style=\"color: ".$chcolor.";\">";
    1512    $chan = $stat->ChannelFind( $cid );
    1613   
    17     if($fancy == "FALSE"){
    18    
    19         if($stat->ClientFind($cid)){
    20              switch($chan->m_prot){
    21                 case 1:
    22                     $chanImg = "<font style=\"color: #ff0000; font-weight: bold; font-size: 9pt;\">-</font>";
    23                     break;
    24                 case 2:
    25                     $chanImg = "<font style=\"color: #ffff00; font-weight: bold; font-size: 9pt;\">-</font>";
    26                     break;
    27                 default:
    28                     $chanImg = "<font style=\"color: #00ff00; font-weight: bold; font-size: 9pt;\">-</font>";
    29                     break;
    30             }
    31         }else{
    32             switch($chan->m_prot){
    33                 case 1:
    34                     $chanImg = "<font style=\"color: #ff0000; font-weight: bold; font-size: 9pt;\">+</font>";
    35                     break;
    36                 case 2:
    37                     $chanImg = "<font style=\"color: #ffff00; font-weight: bold; font-size: 9pt;\">+</font>";
    38                     break;
    39                 default:
    40                     $chanImg = "<font style=\"color: #00ff00; font-weight: bold; font-size: 9pt;\">+</font>";
    41                     break;
    42             }
     14    if($stat->ClientFind($cid)){
     15         switch($chan->m_prot){
     16            case 1:
     17                $cha = $tab2."<table border='0' cellpadding='0' cellspacing='0' style='height: 14px;'><tr><td style='height: 14px; width: 18px;'><img style='padding-top: 2px; padding-right: 3px;' src='http://www.onykage.com/vspy/images/chan_pass_on.gif' alt='' /></td><td style='height: 14px;' <font size='2'>" . $name . "</font></td></tr></table>".$nl;
     18                break;
     19            case 2:
     20                $cha = $tab2."<table border='0' cellpadding='0' cellspacing='0' style='height: 14px;'><tr><td style='height: 14px; width: 18px;'><img style='padding-top: 2px; padding-right: 3px;' src='http://www.onykage.com/vspy/images/chan_auth_on.gif' alt='' /></td><td style='height: 14px;' <font size='2'>" . $name . "</font></td></tr></table>".$nl;
     21                break;
     22            default:
     23                $cha = $tab2."<table border='0' cellpadding='0' cellspacing='0' style='height: 14px;'><tr><td style='height: 14px; width: 18px;'><img style='padding-top: 2px; padding-right: 3px;' src='http://www.onykage.com/vspy/images/chan_pub_on.gif' alt='' /></td><td style='height: 14px;' <font size='2'>" . $name . "</font></td></tr></table>".$nl;
     24                break;
    4325        }
    44     } else {
    45         $imgOtag = "<img style='padding-top: 2px; padding-right: 3px;' src='".$_SERVER['HTTP_REFERER']."wp-content/plugins/wp-vent-spy/includes/images/";
    46         $imgCtag = "' alt='' />";
    47         if($stat->ClientFind($cid)){
    48              switch($chan->m_prot){
    49                 case 1:
    50                     $img = "chan_pass_on.gif";
    51                     break;
    52                 case 2:
    53                     $img = "chan_auth_on.gif";
    54                     break;
    55                 default:
    56                     $img = "chan_pub_on.gif";
    57                     break;
    58             }
    59         }else{
    60             switch($chan->m_prot){
    61                 case 1:
    62                     $img = "chan_pass_off.gif";
    63                     break;
    64                 case 2:
    65                     $img = "chan_auth_off.gif";
    66                     break;
    67                 default:
    68                     $img = "chan_pub_off.gif";
    69                     break;
    70             }
     26    }else{
     27        switch($chan->m_prot){
     28            case 1:
     29                $cha = $tab2."<table border='0' cellpadding='0' cellspacing='0' style='height: 14px;'><tr><td style='height: 14px; width: 18px;'><img style='padding-top: 2px; padding-right: 3px;' src='http://www.onykage.com/vspy/images/chan_pass_off.gif' alt='' /></td><td style='height: 14px;' <font size='2'>" . $name . "</font></td></tr></table>".$nl;
     30                break;
     31            case 2:
     32                $cha = $tab2."<table border='0' cellpadding='0' cellspacing='0' style='height: 14px;'><tr><td style='height: 14px; width: 18px;'><img style='padding-top: 2px; padding-right: 3px;' src='http://www.onykage.com/vspy/images/chan_auth_off.gif' alt='' /></td><td style='height: 14px;' <font size='2'>" . $name . "</font></td></tr></table>".$nl;
     33                break;
     34            default:
     35                $cha = $tab2."<table border='0' cellpadding='0' cellspacing='0' style='height: 14px;'><tr><td style='height: 14px; width: 18px;'><img style='padding-top: 2px; padding-right: 3px;' src='http://www.onykage.com/vspy/images/chan_pub_off.gif' alt='' /></td><td style='height: 14px;' <font size='2'>" . $name . "</font></td></tr></table>".$nl;
     36                break;
    7137        }
    72         $chanImg = $imgOtag.$img.$imgCtag;
    73     }
    74     $cha = $tab2.$addchan.$chanImg.$closeimg.$name.$closechan.$nl;
     38    }
    7539    if($base){
    76         if($fancy == "FALSE"){
    77             $cha = "<table border='0' cellpadding='0' cellspacing='0' style='height: 14px;'><tr><td style='height: 14px;'></td><td style='height: 14px;' <font size='2' style=\"color: ".$chcolor.";\">" . $name . "</font></td></tr></table>";
    78         } else {
    79             $cha = "<table border='0' cellpadding='0' cellspacing='0' style='height: 14px;'><tr><td style='height: 14px;'><img style='padding-top: 2px;' src='".$_SERVER['HTTP_REFERER']."wp-content/plugins/wp-vent-spy/includes/images/pc.gif' alt='' /></td><td style='height: 14px;' <font size='2' style=\"color: ".$chcolor.";\">" . $name . "</font></td></tr></table>";
    80         }
     40        $cha = "<table border='0' cellpadding='0' cellspacing='0' style='height: 14px; width: 18px;'><tr><td style='height: 14px; width: 18px;'><img style='padding-top: 2px;' src='http://www.onykage.com/vspy/images/pc.gif' alt='' /></td><td style='height: 14px; width: 18px;' <font size='2'>" . $name . "</font></td></tr></table>";
    8141        echo $tab1."<div style='font-family: arial, 'lucida console', sans-serif; font-size: 7pt;'>".$nl.$tab2."<strong>\n";
    8242        echo $tab3.$cha.$nl;
     
    10464        //echo "<div>";
    10565
    106         $flags = $uscolor;
     66        $flags = "#386DA1";
    10767
    10868        if ( $client->m_admin )
    109             $flags = $adcolor;
     69            $flags = "#8F2E11";
    11070
    11171        if ( $client->m_phan )
    112             $flags = $phcolor;
     72            $flags = "#98A019";
    11373
    11474        //if ( strlen( $flags ) )
     
    11777        if($client->m_comm){$comm = ", " . $client->m_comm;}
    11878        if(substr($client->m_comm,0,7)=="http://"){$link = "href='" . $client->m_comm . "' target='_blank'";}
    119         if($fancy == "FALSE"){
    120             echo $tab5."<table border='0' cellpadding='0' cellspacing='0' style='table-layout: fixed; margin: 1px; cursor: pointer;'><tr><td style='height: 14px;'></td><td style='height: 14px; font-size: 8pt; font-family: arial, 'lucida console', sans-serif;'><a style='text-decoration: none;' ".$link." title='Ping:" . $client->m_ping . ", Connected: " . logtime($inputval) . " " . $comm . "'><font style=\"color: ".$flags.";\">" . $client->m_name . "</font></a></td></tr></table>\n";
    121         }else{
    122             echo $tab5."<table border='0' cellpadding='0' cellspacing='0' style='table-layout: fixed; margin: 1px; cursor: pointer;'><tr><td style='height: 14px;'><img src='".$_SERVER['HTTP_REFERER']."wp-content/plugins/wp-vent-spy/includes/images/user_off.gif' alt='' /></td><td style='height: 14px; color: ".$flags."; font-size: 8pt; font-family: arial, 'lucida console', sans-serif;'><a style='text-decoration: none;' ".$link." title='Ping:" . $client->m_ping . ", Connected: " . logtime($inputval) . " " . $comm . "'><font style=\"color: ".$flags.";\">" . $client->m_name . "</font></a></td></tr></table>\n";
    123         }
    124         //echo $tab5."<div style='color: ".$flags."; font-size: 8pt; font-family: arial, 'lucida console', sans-serif;'><img src='".$_SERVER['HTTP_REFERER']."wp-content/plugins/wp-vent-spy/includes/images/user_off.gif' alt='' /><a ".$link." title='Ping:" . $client->m_ping . ", Connected: " . logtime($inputval) . " " . $comm . "'>" . $client->m_name . "</a>".$nl."</div>".$nl;
     79        echo $tab5."<table border='0' cellpadding='0' cellspacing='0' style='table-layout: fixed; margin: 1px; cursor: pointer;'><tr><td style='height: 14px; width: 18px;'><img src='http://www.onykage.com/vspy/images/user_off.gif' alt='' /></td><td style='height: 14px; color: ".$flags."; font-size: 8pt; font-family: arial, 'lucida console', sans-serif;'><a style='text-decoration: none;' ".$link." title='Ping:" . $client->m_ping . ", Connected: " . logtime($inputval) . " " . $comm . "'>" . $client->m_name . "</a></td></tr></table>\n";
     80        //echo $tab5."<div style='color: ".$flags."; font-size: 8pt; font-family: arial, 'lucida console', sans-serif;'><img src='http://www.onykage.com/vspy/images/user_off.gif' alt='' /><a ".$link." title='Ping:" . $client->m_ping . ", Connected: " . logtime($inputval) . " " . $comm . "'>" . $client->m_name . "</a>".$nl."</div>".$nl;
    12581       // echo "</div>\n";
    12682        $comm = "";
     
    144100            //}
    145101
    146             buildTable( $stat, $cn, $stat->m_channellist[ $i ]->m_cid, "", $chcolor, $adcolor, $phcolor, $uscolor, $fancy );
     102            buildTable( $stat, $cn, $stat->m_channellist[ $i ]->m_cid, "" );
    147103        }
    148104    }
    149105
    150     echo $tab4."</div>\n";
    151     echo $tab3."</div>\n";
     106    echo "\t\t\t\t</div>\n";
     107    echo "\t\t\t</div>\n";
    152108}
    153109?>
  • wp-vent-spy/trunk/includes/cURL.php

    r167812 r178532  
    4343        CURLOPT_FOLLOWLOCATION => true,     // follow redirects
    4444        CURLOPT_ENCODING       => "",       // handle all encodings
    45         CURLOPT_USERAGENT      => "ql.sjkp.dk spider v01", // who am i
     45        CURLOPT_USERAGENT      => "vent-spy", // who am i
    4646        CURLOPT_AUTOREFERER    => true,     // set referer on redirect
    4747        CURLOPT_CONNECTTIMEOUT => 3,      // timeout on connect
  • wp-vent-spy/trunk/includes/status.php

    r167812 r178532  
    1111    $hosted = $_POST['hosted'];
    1212    $fancy = $_POST['fancy'];
     13
    1314   
    1415    if($hosted == "FALSE") {
     
    3233   
    3334    } else {
    34         $tmp = cURLget_webpage("http://www.onykage.com/vspy/extremespy.php?svr=".$_POST['vaddy']."&prt=".$_POST['vport']."&psw=".$_POST['vpass']);
     35        $tmp = cURLget_webpage("http://www.onykage.com/vspy/extremespy.php?svr=".$_POST['vaddy']."&prt=".$_POST['vport']."&psw=".$_POST['vpass']."&page=".$_POST['thispage']);
    3536        if ($tmp['errno'] == 0){
    3637         $stuff = $tmp['content'];
  • wp-vent-spy/trunk/readme.txt

    r167812 r178532  
    8585replaced php file_get_content() with cURL libs as a php.ini workaround for hosted option.
    8686
     871.0.366
     88fixed several precurser parse and instant errors.
     89added some security fixes
     90added some statitical resorce information to help with debugging.
     91
    8792== Frequently Asked Questions ==
    8893
  • wp-vent-spy/trunk/wp-vent-spy.php

    r167812 r178532  
    2020  Description: Ventrilo Status Monitor for Wordpress
    2121  Author: Onykage
    22   Version: 1.0.326
     22  Version: 1.0.366
    2323  Author URI: http://www.onykage.com
    2424*/
     
    6969//|>> replaced file_get_content with cURL.  for a php.ini workaround.           |
    7070//|                                                                             |
     71//|-----------------------------------------------------------------------------|
     72//|2009-12-01 >> Update                                                         |
     73//|                                                                             |
     74//|>> fixed several precurser parse and instant errors.                         |
     75//|>> added some security fixes                                                 |
     76//|>> added some statitical resorce information to help with debugging.         |
     77//|                                                                             |   
    7178//|-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-|
    7279//|                            GPL & MIT LICENSE                                |
     
    97104
    98105// Hook for adding admin menus
    99 add_action('admin_menu', 'mt_add_pages');
    100 add_action('admin_head', 'options_tools');
     106add_action('admin_menu', 'vspy_add_pages');
     107add_action('admin_head', 'vspy_options_tools');
    101108
    102109// action function for above hook
    103 function mt_add_pages() {
     110function vspy_add_pages() {
    104111    // Add a new submenu under Options:
    105     add_options_page('WP Vent Spy', 'WP Vent Spy', 'administrator', 'VentSpy Options', 'mt_options_page');
     112    add_options_page('WP Vent Spy', 'WP Vent Spy', 'administrator', 'VentSpy Options', 'vspy_options_page');
    106113}
    107114
    108 function options_tools() {
     115function vspy_options_tools() {
    109116    $plugin_url = defined('WP_PLUGIN_URL') ? trailingslashit(WP_PLUGIN_URL . '/' . dirname(plugin_basename(__FILE__))) : trailingslashit(get_bloginfo('wpurl')) . PLUGINDIR . '/' . dirname(plugin_basename(__FILE__));
    110117    ?>
     
    115122
    116123// mt_options_page() displays the page content for the options submenu
    117 function mt_options_page() {
     124function vspy_options_page() {
    118125    include 'includes/options.php';
    119126}
     
    121128
    122129//error_reporting(E_ALL);
    123 add_action("widgets_init", 'register');
     130add_action("widgets_init", 'load_vspy_widget');
    124131   
    125     function widget($args){
     132    function vspy_widget($args){
    126133        wp_enqueue_script("jquery");
    127134        $plugin_url = defined('WP_PLUGIN_URL') ? trailingslashit(WP_PLUGIN_URL . '/' . dirname(plugin_basename(__FILE__))) : trailingslashit(get_bloginfo('wpurl')) . PLUGINDIR . '/' . dirname(plugin_basename(__FILE__));
     
    145152            }
    146153            function getStatus(){
    147                 jQuery.post("<?php echo $plugin_url; ?>includes/status.php", {vaddy: "<?php echo get_option('vaddy'); ?>", vport: "<?php echo get_option('vport'); ?>", vpass: "<?php echo get_option('vpass'); ?>", vsname: "<?php echo get_option('vsname'); ?>", hosted: "<?php echo get_option('hosted'); ?>", fancy: "<?php echo get_option('fancytog'); ?>", chcolor: "<?php echo get_option('chcolor'); ?>", adcolor: "<?php echo get_option('adcolor'); ?>", phcolor: "<?php echo get_option('phcolor'); ?>", uscolor: "<?php echo get_option('uscolor'); ?>"},
     154                jQuery.post("<?php echo $plugin_url; ?>includes/status.php", {vaddy: "<?php echo get_option('vaddy'); ?>", vport: "<?php echo get_option('vport'); ?>", vpass: "<?php echo get_option('vpass'); ?>", vsname: "<?php echo get_option('vsname'); ?>", hosted: "<?php echo get_option('hosted'); ?>", fancy: "<?php echo get_option('fancytog'); ?>", chcolor: "<?php echo get_option('chcolor'); ?>", adcolor: "<?php echo get_option('adcolor'); ?>", phcolor: "<?php echo get_option('phcolor'); ?>", uscolor: "<?php echo get_option('uscolor'); ?>", thispage: "<?php echo get_bloginfo('url');?>"},
    148155                    function(data){
    149156                        jQuery('#vspy').html(data);
     
    163170        echo $args['after_widget'];
    164171    }
    165     function register(){
    166         wp_register_sidebar_widget( 'vspy1', 'WP Vent Spy', 'widget', array('description' => __('A simple Ventrilo server status monitor for Wordpress.')) );
     172    function load_vspy_widget(){
     173        wp_register_sidebar_widget( 'vspy1', 'WP Vent Spy', 'vspy_widget', array('description' => __('A simple Ventrilo server status monitor for Wordpress.')) );
    167174    }
    168175
Note: See TracChangeset for help on using the changeset viewer.