Changeset 714


Ignore:
Timestamp:
06/01/06 04:36:16 (7 years ago)
Author:
mglb1
Message:
  • Minor bugfixes to the wizard to allow configuration with DSL modems
Location:
ccsd/private
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ccsd/private/modules/ccs_monitor_rurallink.py

    r713 r714  
    29682968        elif "isptype" in data.keys(): 
    29692969            try: 
    2970                 if "username" not in data.keys(): 
    2971                     raise ccs_rurallink_error("Missing post variables!") 
     2970                changeISP(data["isptype"]) 
     2971            except: 
     2972                log_error("Exception setting ISP type", sys.exc_info()) 
     2973                isperr = "Failed to set ISP type" 
     2974                request.send_error(500, "Unable to setup ISP") 
     2975                request.end_headers() 
     2976                return 
     2977            request.send_response(200, "ISP type set") 
     2978            request.end_headers() 
     2979            return 
     2980        elif "username" in data.keys(): 
     2981            try: 
    29722982                if "pass" not in data.keys(): 
    29732983                    raise ccs_rurallink_error("Missing post variables!") 
    2974                 changeISP(data["isptype"]) 
    29752984                username = urllib.unquote(data["username"]).strip() 
    29762985                password = urllib.unquote(data["pass"]).strip() 
     
    41554164    network = parts[len(parts)-1] 
    41564165     
    4157     if network != int_ifname and network != ap0_ifname: 
     4166    if network not in ["internal", "ap0"]: 
    41584167        # Unknown network 
    41594168        request.send_error(404, "Cannot set policy for unknown network!") 
     
    41784187    # Update the policy 
    41794188    pref_set("traffic", "%s_policy" % network, policy, monitor_prefs) 
    4180  
     4189     
    41814190    # Now update the actual firewall 
    41824191    request.send_response(200, "Policy updated") 
    41834192    request.end_headers() 
    4184      
     4193 
     4194    doFirewall("start") 
     4195 
    41854196@registerPage("/traffic/firewall", requireAuth=True, realm=CPE_ADMIN_REALM) 
    41864197def trafficfirewall(request, method): 
  • ccsd/private/resources/rurallink.js

    r709 r714  
    4444    }, 
    4545    '#wizard_isptype': function(element){ 
    46         element.onchange = wizardISPUpdated; 
     46        element.onchange = wizardISPTypeUpdated; 
    4747    }, 
    4848    '#wizard_ispusername': function(element){ 
     
    191191        onSuccess:wizardUpdateSuccess, onFailure:wizardUpdateFailure}); 
    192192} 
     193function wizardISPTypeUpdated(e) { 
     194    type = $F("wizard_isptype"); 
     195    pars =  "isptype=" + type; 
     196    myAjax = new Ajax.Request("/", {method: 'post', postBody: pars}); 
     197} 
    193198function wizardISPUpdated(e) { 
    194     type = $F("wizard_isptype"); 
    195199    username = $F("wizard_ispusername"); 
    196200    password = $F("wizard_isppassword"); 
    197     if (type=="" || username=="" || password=="") { 
     201    if (username=="" || password=="") { 
    198202        // Not all fields are complete 
    199203        return; 
    200204    } 
    201205    showUpdateWindow("Configuring ISP"); 
    202     pars =  "isptype=" + type + "&username=" + username + "&pass=" + password; 
     206    pars =  "username=" + username + "&pass=" + password; 
    203207    myAjax = new Ajax.Request("/", {method: 'post', postBody: pars,  
    204208        onSuccess:wizardUpdateSuccess, onFailure:wizardUpdateFailure}); 
Note: See TracChangeset for help on using the changeset viewer.