+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 26 of 26
General Chat Thread, Student 'Tracking' in General; I wrote a system thats something along this line, including something that let me just browse computer rooms for users ...
  1. #16
    Friez's Avatar
    Join Date
    Dec 2006
    Posts
    839
    Thank Post
    22
    Thanked 22 Times in 21 Posts
    Rep Power
    23
    I wrote a system thats something along this line, including something that let me just browse computer rooms for users e.t.c. and tie it straight into various tools like VNC. Here's a screenie.

    The map is very handy!
    Attached Thumbnails Attached Thumbnails Student 'Tracking'-ultimatepower.jpg  

  2. #17

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,225
    Thank Post
    874
    Thanked 2,717 Times in 2,302 Posts
    Blog Entries
    11
    Rep Power
    780
    Quote Originally Posted by Friez View Post
    I wrote a system thats something along this line, including something that let me just browse computer rooms for users e.t.c. and tie it straight into various tools like VNC. Here's a screenie.

    The map is very handy!
    Now that looks very handy, would you be willing share the system with us?
    Last edited by SYNACK; 1st May 2008 at 10:06 PM.

  3. #18

    Edu-IT's Avatar
    Join Date
    Nov 2007
    Posts
    7,161
    Thank Post
    403
    Thanked 623 Times in 569 Posts
    Rep Power
    181
    Quote Originally Posted by SYNACK View Post
    Now that looks very hndy, would you be willing share the system with us?
    I agree. Looks very neat.

  4. #19
    Friez's Avatar
    Join Date
    Dec 2006
    Posts
    839
    Thank Post
    22
    Thanked 22 Times in 21 Posts
    Rep Power
    23
    Wouldn't be particularly easy to share, I built it specifically for this school and would require sending over mysql table structures, executables and a series of modified PHP pages (so they're not heavily tied into our intranet any more, this would take a lot of time to fix up).

    If I only had the time...

    Sorry guys

  5. #20

    JJonas's Avatar
    Join Date
    Jan 2008
    Location
    North Walsham, Norfolk
    Posts
    3,115
    Thank Post
    389
    Thanked 438 Times in 326 Posts
    Rep Power
    384
    Im interested in it.

    Couldnt you post what you have and let the rest of us Edugeekers pull it to pieces. I looks like it could be a good group project.

  6. #21
    richard.thomas's Avatar
    Join Date
    Sep 2007
    Posts
    491
    Thank Post
    5
    Thanked 11 Times in 10 Posts
    Rep Power
    17
    Friez, Your system is very close to what I'm hoping to achieve at the end of this. Looks very neat indeed #

    What happens if someone just turns the power off rather than log off?
    On login my script checks to see if that users is already marked as logged in. If they are it marks it as a 'Timeout' showing that it was an unclean logout. The script also checks to see if the current computer that someone is logging into is marked as someone being logged in. If it is it does the same as with the username.
    Last edited by richard.thomas; 2nd May 2008 at 10:33 AM.

  7. #22

    ZeroHour's Avatar
    Join Date
    Dec 2005
    Location
    Edinburgh, Scotland
    Posts
    5,748
    Thank Post
    917
    Thanked 1,335 Times in 815 Posts
    Blog Entries
    1
    Rep Power
    447
    I was in the process of dev'ing something before and I think we shall make this a project. I hope to get the initial project area created this weekend and I will post what I have done. I got a base in and we use it here but I did not get it fully sanitized for general use.
    Hopefully we can all work to make this a very useful tool

  8. #23

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,804
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224
    Logging 'failed' logins (bad passwords, too many concurrent logins, time/workstation restrictions) would be helpful too.

  9. #24
    Friez's Avatar
    Join Date
    Dec 2006
    Posts
    839
    Thank Post
    22
    Thanked 22 Times in 21 Posts
    Rep Power
    23
    If you wish to rip apart, here's the mapping bit, not going much into the whole database pushing and pulling malarky though (uses exe files).

    The map display itself is simple:

    Main Page:
    PHP Code:
    echo "<b>T1</b><br>";
    $comproom "T1";
    $roomtemplate "http://";
    $postroomtemplate ":5800\" target=\"_new\"";
    include 
    "compmap.php"
    compmap.php (this generates CSS hotspot clickable areas for the map):
    PHP Code:
    <style type="text/css" media="screen">
    img.image{ display: none; }

    <?php
        
    if($comproom == "T1")
            include 
    "map_t1.php";
        else if(
    $comproom == "T2")
            include 
    "map_t2.php";
        else if(
    $comproom == "T3")
            include 
    "map_t3.php";    
        else if(
    $comproom == "T4")
            include 
    "map_t4.php";
        else if(
    $comproom == "WRLR")
            include 
    "map_wrlr.php";
        else if(
    $comproom == "L5")
            include 
    "map_l5.php";
        else if(
    $comproom == "T5")
            include 
    "map_t5.php";                                    
        else
            return;
            
        
        
    $compXpos = array();
        
    $compYpos = array();
        
        
    $x=0;
        
    $y=35;    
        for(
    $i=0$i<$sideA$i++)
        {
            
    array_push($compXpos,$x);
            
    array_push($compYpos,$y);        
            
    $y += 35;        
        }
                    
        
    $x=35;
        
    $y=0;
        for(
    $i=0$i<$sideB$i++)
        {
            
    array_push($compXpos,$x);
            
    array_push($compYpos,$y);            
            
    $x+=35;            
        }    
        
        
    $x=(35*($spacew+$sideB+1));
        
    $y=35;    
        for(
    $i=0$i<$sideC$i++)
        {
            
    array_push($compXpos,$x);
            
    array_push($compYpos,$y);            
            
    $y += 35;        
        }
        
        for(
    $i=0;$i<count($extrasX);$i++)
        {
            
    $x $extrasX[$i];
            
    $y $extrasY[$i];
            
    array_push($compXpos,$x);
            
    array_push($compYpos,$y);                
        }    
        
        
    $uid md5(uniqid(rand(), true));
    ?>

    dl#overallMap<?php echo $comproom?>{
        margin: 0;
        padding: 0;
        background: transparent url(<?php echo "computermap.php?room=" $comproom "&amp;uid=" $uid?>) top left no-repeat;
        height: <?php echo $maxheight?>px;
        width: <?php echo $maxwidth?>px;
        position: relative;
    }

    dt{ margin: 0; padding: 0; position: absolute; font-size: 85%; display: none; }
    dd{ margin: 0; padding: 0; position: absolute;  font-size: 85%; }

    <?php

    for($i=0;$i<count($compnames);$i++)
    {
        
        echo 
    "dd#tg" $compnames[$i] . "{ top: " $compYpos[$i] . "px; left: " $compXpos[$i] . "px; }\n";
        echo 
    "dd#tg" $compnames[$i] . " a{ position: absolute; width: 35px; height: 35px; text-decoration: none; }\n";
        echo 
    "dd#tg" $compnames[$i] . " a span{ display: none; }\n";
        echo 
    "dd#tg" $compnames[$i] . " a:hover{ position: absolute; background: transparent url(computermap.php?room=" $comproom "&amp;uid=" $uid ") -" $compXpos[$i] . "px -" . ($compYpos[$i]+$maxheight) . "px no-repeat; }\n";

        echo 
    "dd#tg" $compnames[$i] . " a:hover span{\n";
        
    ?>
        display: block;
        text-indent: 0;
        vertical-align: top;
        color: #000;
        background-color: #F4F4F4;
        font-weight: bold;
        position: absolute;
        border: 1px solid #BCBCBC;
        bottom: 150%;
        margin: 0;
        padding: 5px;
        width: 150px;    
        }    
    <?php    
    }    

        
    ?>

    </style>


    <img src=<?php echo "\"computermap.php?room=" $comproom "\""?> height=<?php echo "\"" $maxheight "\""?> width=<?php echo "\"" $maxwidth "\""?> class="image" alt="Room Map" />

    <dl id="overallMap<?php echo $comproom?>">
    <?php    
    $numrooms 
    count($compnames);

    if(!isset(
    $link))
    {
        include 
    "dblogin.php"// login to the database    
    }

    for(
    $i=0;$i<$numrooms;$i++)
    {
        
    $query3 'SELECT * FROM netadmin_loggedinusers WHERE Machine = \'' $compnames[$i] . '\'';
        
    $result3 mysql_query($query3);
        
    $line3 mysql_fetch_array($result3MYSQL_ASSOC);    
        
        
    $uloggedname "";
        if(
    $line3['Machine'] != "")
        {
            if(
    $line3['InTime'] == $line3['OutTime']) // currently logged in
            
    {
                
    $uloggedname $line3['User'];        
            }
        }
        
        echo 
    "<dd id=\"tg" $compnames[$i] . "\"><a href=\"" $roomtemplate $compnames[$i] . $postroomtemplate "\"><span>" $compnames[$i] . "<br>" $uloggedname "</span></a></dd>";    
    }

    ?>

    </dl>

  10. #25
    Friez's Avatar
    Join Date
    Dec 2006
    Posts
    839
    Thank Post
    22
    Thanked 22 Times in 21 Posts
    Rep Power
    23
    computermap.php (This generates the actual map image via PHP):
    PHP Code:
    <?php



    if(isset($_GET['room']))
    {
        if(
    $_GET['room'] == "T1")
            include 
    "map_t1.php";
        else if(
    $_GET['room'] == "T2")
            include 
    "map_t2.php";
        else if(
    $_GET['room'] == "T3")
            include 
    "map_t3.php";    
        else if(
    $_GET['room'] == "T4")
            include 
    "map_t4.php";
        else if(
    $_GET['room'] == "WRLR")
            include 
    "map_wrlr.php";        
        else if(
    $_GET['room'] == "L5")
            include 
    "map_l5.php";    
        else if(
    $_GET['room'] == "T5")
            include 
    "map_t5.php";                                
        else
            return;

        
    $killlink false;        
        if(!isset(
    $link)) // no SQL link
        
    {
        include 
    "dblogin.php"// login to the database    
            
    $killlink true;        
        }        
                    
        
    $im imagecreatetruecolor($maxwidth$maxheight*2);
        
        
    $whi imagecolorallocate($im255255,255);
        
    imagefill($im00$whi);
        
        
    $color imagecolorallocate($im000);
        
        
    $x=0;
        
    $y=35;
        
        
    $c=0;

        
        for(
    $i=0$i<$sideA$i++)
        {
            
    $size 32;
            
    $comp = array(
                
    $x,$y,
                
    $x+$size,$y,
                
    $x+$size,$y+$size,
                
    $x,$y+$size
                
    );
            
            
    $comp2 = array(
                
    $x,$y+$maxheight,
                
    $x+$size,$y+$maxheight,
                
    $x+$size,$y+$size+$maxheight,
                
    $x,$y+$size+$maxheight
                
    );            
                    
                
            
    $query 'SELECT * FROM    netadmin_loggedinusers WHERE Machine = \'' $compnames[$c] . '\'';
            
    $result mysql_query($query);
            
    $line mysql_fetch_array($resultMYSQL_ASSOC);
            
            
    $color imagecolorallocate($im000);
            
    $col2 imagecolorallocate($im00192);
            if(
    $line['Machine'] != "")
            {
                if(
    $line['InTime'] == $line['OutTime']) // currently logged in
                
    {
                    
    $color imagecolorallocate($im1987272);
                    
    $col2 imagecolorallocate($im128128255);                    
                }    
            }    
            
    mysql_free_result($result);        
            
            
    imagefilledpolygon($im$comp4$color);        
            
    imagestring($im1$x$y,  $compnames[$c], $whi);    

            
    imagefilledpolygon($im$comp24$col2);        
            
    imagestring($im1$x$y+$maxheight,  $compnames[$c], $whi);    
                    
            
    $y += 35;
            
    $c++;
        }
        
        
    $x=35;
        
    $y=0;
        for(
    $i=0$i<$sideB$i++)
        {
            
    $size 32;
            
    $comp = array(
                
    $x,$y,
                
    $x+$size,$y,
                
    $x+$size,$y+$size,
                
    $x,$y+$size
                
    );
            
    $comp2 = array(
                
    $x,$y+$maxheight,
                
    $x+$size,$y+$maxheight,
                
    $x+$size,$y+$size+$maxheight,
                
    $x,$y+$size+$maxheight
                
    );                
                
            
    $query 'SELECT * FROM    netadmin_loggedinusers WHERE Machine = \'' $compnames[$c] . '\'';
            
    $result mysql_query($query);
            
    $line mysql_fetch_array($resultMYSQL_ASSOC);
            
            
    $color imagecolorallocate($im000);
            
    $col2 imagecolorallocate($im00192);
            if(
    $line['Machine'] != "")
            {
                if(
    $line['InTime'] == $line['OutTime']) // currently logged in
                
    {
                    
    $color imagecolorallocate($im1987272);
                    
    $col2 imagecolorallocate($im128128255);                    
                }    
            }        
            
    mysql_free_result($result);                
                
            
    imagefilledpolygon($im$comp4$color);    
            
    imagestring($im1$x$y,  $compnames[$c], $whi);    
            
            
    imagefilledpolygon($im$comp24$col2);        
            
    imagestring($im1$x$y+$maxheight,  $compnames[$c], $whi);                
            
            
    $x+=35;    
            
    $c++;
        }
            
        
    $x=(35*($spacew+$sideB+1));
        
    $y=35;
        
        for(
    $i=0$i<$sideC$i++)
        {
            
    $size 32;
            
    $comp = array(
                
    $x,$y,
                
    $x+$size,$y,
                
    $x+$size,$y+$size,
                
    $x,$y+$size
                
    );
            
    $comp2 = array(
                
    $x,$y+$maxheight,
                
    $x+$size,$y+$maxheight,
                
    $x+$size,$y+$size+$maxheight,
                
    $x,$y+$size+$maxheight
                
    );                
                
            
    $query 'SELECT * FROM    netadmin_loggedinusers WHERE Machine = \'' $compnames[$c] . '\'';
            
    $result mysql_query($query);
            
    $line mysql_fetch_array($resultMYSQL_ASSOC);
            
            
    $color imagecolorallocate($im000);
            
    $col2 imagecolorallocate($im00192);
            if(
    $line['Machine'] != "")
            {
                if(
    $line['InTime'] == $line['OutTime']) // currently logged in
                
    {
                    
    $color imagecolorallocate($im1987272);
                    
    $col2 imagecolorallocate($im128128255);                    
                }    
            }    
            
    mysql_free_result($result);                
                
            
    imagefilledpolygon($im$comp4$color);
            
    imagestring($im1$x$y,  $compnames[$c], $whi);        
            
            
    imagefilledpolygon($im$comp24$col2);        
            
    imagestring($im1$x$y+$maxheight,  $compnames[$c], $whi);            

            
                        
            
    $y += 35;
            
    $c++;
        }
        
        
        for(
    $i=0;$i<count($extrasX);$i++)
        {
            
    $x $extrasX[$i];
            
    $y $extrasY[$i];
            
    $size 32;
            
    $comp = array(
                
    $x,$y,
                
    $x+$size,$y,
                
    $x+$size,$y+$size,
                
    $x,$y+$size
                
    );
            
    $comp2 = array(
                
    $x,$y+$maxheight,
                
    $x+$size,$y+$maxheight,
                
    $x+$size,$y+$size+$maxheight,
                
    $x,$y+$size+$maxheight
                
    );                
                
            
    $query 'SELECT * FROM    netadmin_loggedinusers WHERE Machine = \'' $compnames[$c] . '\'';
            
    $result mysql_query($query);
            
    $line mysql_fetch_array($resultMYSQL_ASSOC);
            
            
    $color imagecolorallocate($im000);
            
    $col2 imagecolorallocate($im00192);
            if(
    $line['Machine'] != "")
            {
                if(
    $line['InTime'] == $line['OutTime']) // currently logged in
                
    {
                    
    $color imagecolorallocate($im1987272);
                    
    $col2 imagecolorallocate($im128128255);                    
                }    
            }    
            
    mysql_free_result($result);                
                
            
    imagefilledpolygon($im$comp4$color);    
            
    imagestring($im1$x$y,  $compnames[$c], $whi);        
            
            
    imagefilledpolygon($im$comp24$col2);        
            
    imagestring($im1$x$y+$maxheight,  $compnames[$c], $whi);            
                        
            
    $c++;
        }
            
        
    header('Content-type: image/png');
        
    imagepng($im);
        
    imagedestroy($im);
        
        if(
    $killlink)
        {
            
    mysql_close($link);    
        }
    }
    ?>


    Example Map File (map_t1.php):
    PHP Code:
    <?php
    $sideA 
    6;
    $sideB 5;
    $sideC 0;
    $extrasX = array(
        
    210,
        
    210,
        
    175,
        
    140,
        
    105,
        
    70,
        
    70,
        
    105,
        
    140,
        
    175,
        
    210,
        
    210,
        
    175,
        
    140,
        
    105,
        
    70,
        
    122,
    );
    $extrasY = array(
        
    35,
        
    70,
        
    105,
        
    105,
        
    105,
        
    105,
        
    140,
        
    140,
        
    140,
        
    140,
        
    175,
        
    210,
        
    245,
        
    245,
        
    245,
        
    245,
        
    280,
    );

    $maxheight = (35 9);
    $maxwidth = (35 * ($sideB+2));

    $spacew=0;

    $compnames = array(
    "T1-06",
    "T1-05",
    "T1-04",
    "T1-03",
    "T1-02",
    "T1-01",
    "T1-07",
    "T1-08",
    "T1-09",
    "T1-10",
    "T1-11",
    "T1-12",
    "T1-13",
    "T1-14",
    "T1-15",
    "T1-16",
    "T1-17",
    "T1-18",
    "T1-19",
    "T1-20",
    "T1-21",
    "T1-22",
    "T1-23",
    "T1-24",
    "T1-25",
    "T1-26",
    "T1-27",
    "T1-28",
    );

    ?>
    Note: The order machines are put in is particularly important. Due to the way our rooms are structured we generally have two/three sides of the rooms with computers on (hence the number of pcs listed for each side) and then any extras we tack on specific coordinates for. The sides are looped through, and then the extra machines, therefore the namelist is in specific order.

    This could be MUCH cleaner, but I lack the time :P
    Good luck finding your way around this code! >_<
    I hope its of some use though.

  11. Thanks to Friez from:

    SYNACK (2nd May 2008)

  12. #26

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,225
    Thank Post
    874
    Thanked 2,717 Times in 2,302 Posts
    Blog Entries
    11
    Rep Power
    780
    Quote Originally Posted by Geoff View Post
    Logging 'failed' logins (bad passwords, too many concurrent logins, time/workstation restrictions) would be helpful too.
    To implement this the easiest way would be to use a chunk of WMI code that stripped out the relevant events from the event logs on each of the domain controllers and chuckes them in a database.

    It may actually be a nice clean way to handle that part of it as the event should give you username, station name and time at least.

    This little chunk of code will actually monitor the event log in real time which should provide the functionality:
    http://www.microsoft.com/technet/scr...7/hey0226.mspx
    Last edited by SYNACK; 2nd May 2008 at 01:28 PM. Reason: Code example

SHARE:
+ Post New Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Tracking BTECs
    By stevenwitthers in forum How do you do....it?
    Replies: 0
    Last Post: 13th March 2008, 01:14 PM
  2. Asset Tracking
    By manick in forum Hardware
    Replies: 3
    Last Post: 19th September 2007, 10:16 AM
  3. Tracking Bittorent
    By binky in forum Wireless Networks
    Replies: 1
    Last Post: 7th September 2007, 12:40 AM
  4. Asset Tracking/Marking
    By dave.81 in forum How do you do....it?
    Replies: 3
    Last Post: 20th June 2007, 08:24 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •