Changes between Version 3 and Version 4 of doc/developer/MACBlacklisting

Show
Ignore:
Timestamp:
10/13/08 15:49:11 (12 years ago)
Author:
Robin Jones
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • doc/developer/MACBlacklisting

    v3 v4  
    1 Contributors: Robin Jones, Benoit Grégoire, Last update: 2008-01-12 Feel free to contribute and/or format better.  
     1Contributors: Robin Jones, Benoit Grégoire, Last update: 2008-10-13 Feel free to contribute and/or format better.  
    22 
    33== Blacklisting a MAC address from your network == 
    44 
     5Here is what I would think should happen for the authentication... how far off am I? ;) ______________________________________________________________________________________________ 
    56 
    6 The changes needed for basic functionnality in  the auth server are: 
     7 
     8{{{ 
     9$db = AbstractDb::getObject(); 
     10 
     11$currentMac = $_REQUEST['mac']; 
     12 
     13$db->execSqlUniqueRes("SELECT * FROM mac_blacklist WHERE mac = $currentMac", $info, false); 
     14 
     15if ($info != null) 
     16{  
     17        if ((DATE() > $info['banned_date'] && < $info['restoration_date']) || (DATE() > $info['banned_date'] && $info['restoration_date'] = null)) 
     18        { 
     19                // Access Denied 
     20                // display reason message from $info['ban_reason'] 
     21        } 
     22        else 
     23        { 
     24                $macId = $info['mac_id']; 
     25                $db->execSqlUniqueRes("DELETE * FROM mac_blacklist WHERE mac_id = $macId", $info, false); 
     26         
     27                // Account privilages have been restored. 
     28        } 
     29 
     30}}} 
     31 
     32=== The Following has been implemented in the networkfusion branch === 
     33To install this branch try:  
     34{{{ 
     35svn checkout https://dev.wifidog.org/svn/branches/networkfusion/wifidog-auth 
     36}}} 
     37 
     38 
     39The changes needed for basic functionality in  the auth server are: 
    740 
    841 * Add a network_had_blacklist and blacklist table in the db.  The latter would (for now) only have a guid, MAC address, and a ban reason field.