Changeset 242


Ignore:
Timestamp:
06/16/2011 01:30:41 AM (11 months ago)
Author:
sque
Message:

Merge branches/awmn 198:205

[awmn] Fix comment about greek language locale and update copyright notice
[awmn] Add 802.11n and Ethernet protocols
[awmn] Fix page links when searching DNS zones and IP ranges (closes #110)
[awmn] Make DNS zone name a required field when requesting a new zone
[awmn] Add zone name validation
[awmn] Fix a typo in language files
[awmn] Add zone name error handling

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/globals/functions.php

    r190 r242  
    44 * 
    55 * Copyright (C) 2005 Nikolaos Nikalexis <winner@cube.gr> 
     6 * Copyright (C) 2009 Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr> 
    67 *  
    78 * This program is free software; you can redistribute it and/or modify 
     
    312313} 
    313314 
     315function validate_zone($name) { 
     316        $name = str_replace("_", "-", $name); 
     317        $name = strtolower($name); 
     318        if (preg_match('/^((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\.)*([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])|)$/', $name) == 0) return NULL; 
     319        return $name; 
     320} 
     321 
    314322function validate_name_ns($name, $node) { 
    315323        global $db; 
  • trunk/globals/language/english.php

    r168 r242  
    44 * 
    55 * Copyright (C) 2005 Nikolaos Nikalexis <winner@cube.gr> 
     6 * Copyright (C) 2009 Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr> 
    67 *  
    78 * This program is free software; you can redistribute it and/or modify 
     
    495496                                'body' => 'The node you are looking for does not exist. Check that you supplied the correct data and try again. If you are sure that you submit the correct data, it is likely that the node has been deleted or that the user has not activated his/her account yet.' 
    496497                        ), 
     498                        'zone_invalid_name' => array( 
     499                                'title' => 'Invalid zone name', 
     500                                'body' => 'The name of the zone contains invalid characters.' 
     501                        ), 
     502                        'zone_out_of_range' => array( 
     503                                'title' => 'Zone name not in C-Class', 
     504                                'body' => 'The name of the zone does not match to any of the IP C-Classes that have been assigned to your node.' 
     505                        ), 
     506                        'zone_reserved_name' => array( 
     507                                'title' => 'Reserved zone name', 
     508                                'body' => 'The name of the zone is reserved by the system.' 
     509                        ), 
    497510                        'generic' => array( 
    498511                                'title' => "General error", 
  • trunk/globals/language/greek.php

    r159 r242  
    44 * 
    55 * Copyright (C) 2005 Nikolaos Nikalexis <winner@cube.gr> 
     6 * Copyright (C) 2009 Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr> 
    67 *  
    78 * This program is free software; you can redistribute it and/or modify 
     
    2021 */ 
    2122 
    22 /* el_GR for GNU/Linux - ell for Windows */ 
     23/* el_GR.utf8 for GNU/Linux - ell for Windows */ 
    2324setlocale(LC_ALL, 'el_GR', 'ell'); 
    2425 
     
    685686 Î»Î¿Î³Î±ÏÎ¹Î±ÏƒÎŒÎ¿Ï.' 
    686687                        ), 
     688                        'zone_invalid_name' => array( 
     689                                'title' => 'Μη έγκϠ
     690ρο όΜοΌα ζώΜης', 
     691                                'body' => '΀ο όΜοΌα ζώΜης ποϠ
     692 ÎŽÎ·Î»ÏŽÏƒÎ±Ï„ε περιέχει Όη έγκϠ
     693ροϠ
     694ς χαρακτήρες.' 
     695                        ), 
     696                        'zone_out_of_range' => array( 
     697                                'title' => 'ΌΜοΌα ζώΜης εκτός C-Class', 
     698                                'body' => '΀ο όΜοΌα ζώΜης ποϠ
     699 ÎŽÎ·Î»ÏŽÏƒÎ±Ï„ε ΎεΜ αΜτιστοιχεί σε καΜέΜα από τα C-Classes ποϠ
     700 ÏƒÎ±Ï‚ έχοϠ
     701Μ αποΎοΞεί.' 
     702                        ), 
     703                        'zone_reserved_name' => array( 
     704                                'title' => 'ΔεσΌεϠ
     705ΌέΜο όΜοΌα ζώΜης', 
     706                                'body' => '΀ο όΜοΌα ζώΜης ποϠ
     707 ÎŽÎ·Î»ÏŽÏƒÎ±Ï„ε είΜαι ΎεσΌεϠ
     708ΌέΜο από το σύστηΌα.' 
     709                        ), 
    687710                        'generic' => array( 
    688711                                'title' => "ΓεΜικό σφάλΌα", 
  • trunk/includes/pages/dnszones/dnszones.php

    r71 r242  
    44 * 
    55 * Copyright (C) 2005 Nikolaos Nikalexis <winner@cube.gr> 
     6 * Copyright (C) 2009 Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr> 
    67 *  
    78 * This program is free software; you can redistribute it and/or modify 
     
    5152                        "", 
    5253                        "dns_zones.status ASC, dns_zones.type ASC, dns_zones.name ASC"); 
     54                $table_dns->db_data_search($form_search_dns); 
    5355                for($i=1;$i<count($table_dns->data);$i++) { 
    5456                        if (isset($table_dns->data[$i])) { 
  • trunk/includes/pages/hostmaster/hostmaster_dnszones.php

    r26 r242  
    44 * 
    55 * Copyright (C) 2005 Nikolaos Nikalexis <winner@cube.gr> 
     6 * Copyright (C) 2009 Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr> 
    67 *  
    78 * This program is free software; you can redistribute it and/or modify 
     
    4849                        "", 
    4950                        "dns_zones.date_in DESC, dns_zones.status ASC"); 
     51                $table_dns->db_data_search($form_search_dns); 
    5052                $table_dns->db_data_multichoice('dns_zones', 'id'); 
    5153                for($i=1;$i<count($table_dns->data);$i++) { 
  • trunk/includes/pages/hostmaster/hostmaster_ranges.php

    r26 r242  
    44 * 
    55 * Copyright (C) 2005 Nikolaos Nikalexis <winner@cube.gr> 
     6 * Copyright (C) 2009 Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr> 
    67 *  
    78 * This program is free software; you can redistribute it and/or modify 
     
    5354                        "", 
    5455                        "ip_ranges.date_in DESC, ip_ranges.status ASC"); 
     56                $table_ip_ranges->db_data_search($form_search_ranges); 
    5557                foreach( (array) $table_ip_ranges->data as $key => $value) { 
    5658                        if ($key != 0) { 
  • trunk/includes/pages/mynodes/mynodes_dnszone.php

    r149 r242  
    44 * 
    55 * Copyright (C) 2005 Nikolaos Nikalexis <winner@cube.gr> 
     6 * Copyright (C) 2009 Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr> 
    67 *  
    78 * This program is free software; you can redistribute it and/or modify 
     
    7778                        $_POST['dns_zones__name'] = substr($_POST['dns_zones__name'], 0, -strlen($vars['dns']['root_zone'])-1); 
    7879                } 
     80                $_POST['dns_zones__name'] = validate_zone($_POST['dns_zones__name']); 
    7981                $form_zone = $this->form_zone(); 
    8082                $ret = TRUE; 
    8183                $f = array(); 
    8284                if (get('zone') == 'add') { 
     85                        if ($_POST['dns_zones__name'] == '') { 
     86                                if (is_null($_POST['dns_zones__name'])) $main->message->set_fromlang('error', 'zone_invalid_name'); 
     87                                else $db->output_error_fields_required(array('dns_zones__name')); 
     88                                return; 
     89                        } 
     90                        switch (get('type')) { 
     91                                case 'forward': 
     92                                        if ($_POST['dns_zones__name'].'.'.$vars['dns']['root_zone'] == $vars['dns']['ns_zone']) { 
     93                                                $main->message->set_fromlang('error', 'zone_reserved_name'); 
     94                                                return; 
     95                                        } 
     96                                        break; 
     97                                case 'reverse': 
     98                                        $iprange = $db->get("ip_start, ip_end", 
     99                                                        "ip_ranges", 
     100                                                        "node_id = ".intval(get('node'))); 
     101                                        foreach( (array) $iprange as $value) 
     102                                                if (reverse_zone_from_ip(long2ip($value['ip_start'])) == $_POST['dns_zones__name']) { 
     103                                                        $valid = TRUE; 
     104                                                        break; 
     105                                                } 
     106                                        if (!$valid) { 
     107                                                $main->message->set_fromlang('error', 'zone_out_of_range'); 
     108                                                return; 
     109                                        } 
     110                                        break; 
     111                                default: 
     112                                        $main->message->set_fromlang('error', 'generic');                
     113                                        return; 
     114                        } 
    83115                        $f = array('dns_zones.status' => 'waiting', 'dns_zones.type' => get('type'), "dns_zones.node_id" => intval(get('node'))); 
    84116                        $ret = $form_zone->db_set($f, 
  • trunk/includes/pages/ranges/ranges_search.php

    r154 r242  
    44 * 
    55 * Copyright (C) 2005 Nikolaos Nikalexis <winner@cube.gr> 
     6 * Copyright (C) 2009 Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr> 
    67 *  
    78 * This program is free software; you can redistribute it and/or modify 
     
    5758                        "", 
    5859                        "ip_ranges.status ASC, ip_ranges.ip_start ASC"); 
     60                $table_ip_ranges->db_data_search($form_search_ranges); 
    5961                foreach( (array) $table_ip_ranges->data as $key => $value) { 
    6062                        if ($key != 0) { 
  • trunk/install/schema.sql

    r236 r242  
    101101  `type` enum('p2p','ap','client') NOT NULL default 'p2p', 
    102102  `ssid` varchar(50) default NULL, 
    103   `protocol` enum('IEEE 802.11b','IEEE 802.11g','IEEE 802.11a','other') default NULL, 
     103  `protocol` enum('IEEE 802.11b','IEEE 802.11g','IEEE 802.11a','IEEE 802.11n','IEEE 802.3i (Ethernet)','IEEE 802.3u (Fast Ethernet)','IEEE 802.3ab (Gigabit Ethernet)','other') default NULL, 
    104104  `channel` varchar(50) default NULL, 
    105105  `status` enum('active','inactive') NOT NULL default 'active', 
Note: See TracChangeset for help on using the changeset viewer.