aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/adm/style/acp_ext_list.html
diff options
context:
space:
mode:
authorMatt Friedman <maf675@gmail.com>2015-08-28 07:49:07 -0700
committerMatt Friedman <maf675@gmail.com>2015-08-28 07:49:07 -0700
commit6c36f56b12afcb97dbaa7cc248435df3e7a3fdc9 (patch)
tree3db6d53d9783e8fb4bfcadc575e79be6262c2f15 /phpBB/adm/style/acp_ext_list.html
parent13851f308f57e0cda4c24f9a9a186aac912213d1 (diff)
downloadforums-6c36f56b12afcb97dbaa7cc248435df3e7a3fdc9.tar
forums-6c36f56b12afcb97dbaa7cc248435df3e7a3fdc9.tar.gz
forums-6c36f56b12afcb97dbaa7cc248435df3e7a3fdc9.tar.bz2
forums-6c36f56b12afcb97dbaa7cc248435df3e7a3fdc9.tar.xz
forums-6c36f56b12afcb97dbaa7cc248435df3e7a3fdc9.zip
[ticket/14123] Remove redundant help messages
PHPBB3-14123
Diffstat (limited to 'phpBB/adm/style/acp_ext_list.html')
0 files changed, 0 insertions, 0 deletions
='#n16'>16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172
package network::wireless;

use strict;
use common;

sub convert_wep_key_for_iwconfig {
    #- 5 or 13 characters, consider the key as ASCII and prepend "s:"
    #- else consider the key as hexadecimal, do not strip dashes
    #- always quote the key as string
    my ($real_key, $restricted) = @_;
    my $key = member(length($real_key), (5, 13)) ? "s:$real_key" : $real_key;
    $restricted ? "restricted $key" : "open $key";
}

sub get_wep_key_from_iwconfig {
    #- strip "s:" if the key is 5 or 13 characters (ASCII)
    #- else the key as hexadecimal, do not modify
    my ($key) = @_;
    $key =~ s/^s:// if member(length($key), (7,15));
    my ($mode, $real_key) = $key =~ /^(?:(open|restricted)\s+)?(.*)$/;
    ($real_key, $mode eq 'restricted');
}

sub convert_key_for_wpa_supplicant {
    my ($key) = @_;
    if ($key =~ /^([[:xdigit:]]{4}[\:-])+[[:xdigit:]]{2,}$/) {
        $key =~ s/[\:-]//g;
        return lc($key);
    } else {
        return qq("$key");
    }
}

#- FIXME: to be improved (quotes, comments) and moved in common files
sub wlan_ng_update_vars {
    my ($file, $vars) = @_;
    substInFile {
        while (my ($key, $value) = each(%$vars)) {
            s/^#?\Q$key\E=(?:"[^#]*"|[^#\s]*)(\s*#.*)?/$key=$value$1/ and delete $vars->{$key};
        }
        $_ .= join('', map { "$_=$vars->{$_}\n" } keys %$vars) if eof;
    } $file;
}

sub wlan_ng_configure {
    my ($in, $ethntf, $module) = @_;
    $in->do_pkgs->install('prism2-utils');
    if ($ethntf->{WIRELESS_ESSID}) {
        my $wlan_conf_file = "$::prefix/etc/wlan/wlan.conf";
        my @wlan_devices = split(/ /, (cat_($wlan_conf_file) =~ /^WLAN_DEVICES="(.*)"/m)[0]);
        push @wlan_devices, $ethntf->{DEVICE} unless member($ethntf->{DEVICE}, @wlan_devices);
        #- enable device and make it use the choosen ESSID
        wlan_ng_update_vars($wlan_conf_file,
                            {
                                WLAN_DEVICES => qq("@wlan_devices"),
                                "SSID_$ethntf->{DEVICE}" => qq("$ethntf->{WIRELESS_ESSID}"),
                                "ENABLE_$ethntf->{DEVICE}" => "y"
                            });
        my $wlan_ssid_file = "$::prefix/etc/wlan/wlancfg-$ethntf->{WIRELESS_ESSID}";
        #- copy default settings for this ESSID if config file does not exist
        -f $wlan_ssid_file or cp_f("$::prefix/etc/wlan/wlancfg-DEFAULT", $wlan_ssid_file);
        #- enable/disable encryption
        wlan_ng_update_vars($wlan_ssid_file,
                            {