Пример #1
0
 def setUp(cls):
     cls.ethernet_uuid = network.add_ethernet_connection(
         'plinth_test_eth', 'eth0', 'internal', 'auto', '')
     cls.wifi_uuid = network.add_wifi_connection('plinth_test_wifi',
                                                 'wlan0', 'external',
                                                 'plinthtestwifi', 'adhoc',
                                                 'open', '', 'auto', '')
     cls.pppoe_uuid = network.add_pppoe_connection('plinth_test_pppoe',
                                                   'eth1', 'internal',
                                                   'x-user', 'x-password')
Пример #2
0
 def setUp(cls):
     cls.ethernet_uuid = network.add_ethernet_connection(
         'plinth_test_eth', 'eth0', 'internal',
         'auto', '', '', '', '', '')
     cls.wifi_uuid = network.add_wifi_connection(
         'plinth_test_wifi', 'wlan0', 'external',
         'plinthtestwifi', 'adhoc', 'open', '',
         'auto', '', '', '', '', '')
     cls.pppoe_uuid = network.add_pppoe_connection(
         'plinth_test_pppoe', 'eth1', 'internal',
         'x-user', 'x-password')
Пример #3
0
def add_pppoe(request):
    """Serve pppoe connection create form."""
    form = None

    if request.method == 'POST':
        form = AddPPPoEForm(request.POST)
        if form.is_valid():
            name = form.cleaned_data['name']
            interface = form.cleaned_data['interface']
            zone = form.cleaned_data['zone']
            username = form.cleaned_data['username']
            password = form.cleaned_data['password']

            network.add_pppoe_connection(
                name, interface, zone, username, password)
            return redirect(reverse_lazy('networks:index'))
    else:
        form = AddPPPoEForm()

    return TemplateResponse(request, 'connections_create.html',
                            {'title': _('Adding New PPPoE Connection'),
                             'subsubmenu': subsubmenu,
                             'form': form})
Пример #4
0
def add_pppoe(request):
    """Serve pppoe connection create form."""
    form = None

    if request.method == 'POST':
        form = AddPPPoEForm(request.POST)
        if form.is_valid():
            name = form.cleaned_data['name']
            interface = form.cleaned_data['interface']
            zone = form.cleaned_data['zone']
            username = form.cleaned_data['username']
            password = form.cleaned_data['password']

            network.add_pppoe_connection(
                name, interface, zone, username, password)
            return redirect(reverse_lazy('networks:index'))
    else:
        form = AddPPPoEForm()

    return TemplateResponse(request, 'connections_create.html',
                            {'title': _('Adding New PPPoE Connection'),
                             'subsubmenu': subsubmenu,
                             'form': form})