Changeset 1388

Show
Ignore:
Timestamp:
10/13/08 15:38:01 (4 years ago)
Author:
networkfusion
Message:

* Added MAC Banning UI, Network Permission and SQL Schema Update.
The SQL for controlling access still needs to be written.
See http://dev.wifidog.org/wiki/doc/developer/MACBlacklisting for more details.

Location:
branches/networkfusion/wifidog-auth
Files:
3 added
7 modified

Legend:

Unmodified
Added
Removed
  • branches/networkfusion/wifidog-auth/CHANGELOG

    r1384 r1388  
    11# $Id$ 
     22008-10-02 Robin Jones 
     3        ----------------- Network Fusion Branch Update -------------------- 
     4        * Added MAC Banning UI, Network Permission and SQL Schema Update. 
     5        The SQL for controlling access still needs to be written. 
     6        See http://dev.wifidog.org/wiki/doc/developer/MACBlacklisting for more details. 
     7 
    282008-10-02 Robin Jones 
    39        * Support for redirecting to the users original URL instead of portal 
  • branches/networkfusion/wifidog-auth/wifidog/admin/generic_object_admin.php

    r1351 r1388  
    353353                        switch ($_REQUEST['object_class']) { 
    354354                            case "Network" : 
     355                            case "Mac" : 
    355356                            case "Server" : 
    356357                            case "User" : 
     
    370371                                break; 
    371372                            case "Network" : 
     373                            case "Mac" : 
    372374                            case "Node" : 
    373375                            case "Server" : 
  • branches/networkfusion/wifidog-auth/wifidog/classes/Network.php

    r1384 r1388  
    21312131            ); 
    21322132        } 
     2133if($networks = Security::getObjectsWithPermission(Permission::P('NETWORK_PERM_EDIT_ANY_MAC'))){ 
     2134            $items[] = array('path' => 'network/Mac_Blacklist', 
     2135                'title' => sprintf(_("Ban MAC Addresses from a network")), 
     2136                'url' => BASE_URL_PATH.htmlspecialchars("admin/mac_ui.php") 
     2137            ); 
     2138        } 
    21332139        $items[] = array('path' => 'network', 
    21342140                'title' => _('Network administration'), 
  • branches/networkfusion/wifidog-auth/wifidog/classes/Permission.php

    r1355 r1388  
    9191            $PERMISSIONS['NETWORK_PERM_ADD_NODE'] = array(_("User is allowed to create a new Node on this network"), StakeholderType::Network, true); 
    9292            $PERMISSIONS['NETWORK_PERM_EDIT_DYNAMIC_ABUSE_CONTROL'] = array(_("User is allowed to set dynamic abuse control options for the network"), StakeholderType::Network, false); 
     93$PERMISSIONS['NETWORK_PERM_EDIT_ANY_MAC'] = array(_("User is allowed to blacklist MAC Addresses on the network"), StakeholderType::Network, false); 
    9394 
    9495            $PERMISSIONS['SERVER_PERM_EDIT_ROLES'] = array(_("User is allowed to edit user role definitions"), StakeholderType::Server, true); 
  • branches/networkfusion/wifidog-auth/wifidog/config.php

    r1351 r1388  
    7878 
    7979// Password for database access. 
    80 define('CONF_DATABASE_PASSWORD', 'wifidogtest'); 
     80define('CONF_DATABASE_PASSWORD', 'wifidog'); 
    8181 
    8282// Name of database used by WiFiDOG auth server. 
     
    148148 * subcode may differ, and should be set to your country subcode) 
    149149 */ 
    150 define('DEFAULT_LANG', 'fr_CA'); 
     150define('DEFAULT_LANG', en_US); 
    151151 
    152152/********************************************************************\ 
  • branches/networkfusion/wifidog-auth/wifidog/include/schema_validate.php

    r1384 r1388  
    4848 * Define current database schema version 
    4949 */ 
    50 define('REQUIRED_SCHEMA_VERSION', 63); 
     50define('REQUIRED_SCHEMA_VERSION', 64); 
    5151/** Used to test a new shecma version before modyfying the database */ 
    5252define('SCHEMA_UPDATE_TEST_MODE', false); 
     
    14271427        $sql .= "ALTER TABLE nodes ALTER COLUMN allow_original_URL_redirect SET DEFAULT FALSE;\n"; 
    14281428    } 
     1429     $new_schema_version = 64; 
     1430     if ($schema_version < $new_schema_version && $new_schema_version <= $targetSchema) { 
     1431     printUpdateVersion($new_schema_version); 
     1432     $sql .= "\n\nUPDATE schema_info SET value='$new_schema_version' WHERE tag='schema_version';\n"; 
     1433     $sql .= "CREATE TABLE mac_blacklist (\n"; 
     1434     $sql .= "mac_id integer DEFAULT nextval(('mac_blacklist_mac_id_seq'::text)::regclass) NOT NULL,\n"; 
     1435     $sql .= "mac macaddr NOT NULL,\n"; 
     1436     $sql .= "network_id text,\n"; 
     1437     $sql .= "banned_date date,\n"; 
     1438     $sql .= "restoration_date date,\n"; 
     1439     $sql .= "ban_reason text\n"; 
     1440     $sql .= ");\n\n"; 
     1441     $sql .= "ALTER TABLE ONLY mac_blacklist\n"; 
     1442     $sql .= "ADD CONSTRAINT mac_blacklist_pkey PRIMARY KEY (mac_id);\n"; 
     1443     $sql .= "CREATE SEQUENCE mac_blacklist_mac_id_seq\n"; 
     1444     $sql .= "INCREMENT 1\n"; 
     1445     $sql .= "MINVALUE 1\n"; 
     1446     $sql .= "MAXVALUE 99999\n"; 
     1447     $sql .= "START 1\n"; 
     1448     $sql .= "CACHE 1;\n"; 
     1449     } 
    14291450    /* 
    14301451     $new_schema_version = ; 
  • branches/networkfusion/wifidog-auth/wifidog/portal/index.php

    r1384 r1388  
    114114$session_original_url = $session->get(SESS_ORIGINAL_URL_VAR); 
    115115 
    116 if ($node->getPortalOriginalUrlAllowed() && $network->getPortalOriginalUrlAllowed() && !empty ($session_original_url)) 
     116if ($node->getPortalOriginalUrlAllowed() && $network->getPortalOriginalUrlAllowed() && !empty ($session_original_url)) { 
    117117    /** 
    118118     * If the database doesn't get cleaned up by a cron job, we'll do now (normally this is done in ManiUI, but for custom URLs, MainUI may never be instanciated