Changeset 714
- Timestamp:
- 06/01/06 04:36:16 (7 years ago)
- Location:
- ccsd/private
- Files:
-
- 2 edited
-
modules/ccs_monitor_rurallink.py (modified) (3 diffs)
-
resources/rurallink.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ccsd/private/modules/ccs_monitor_rurallink.py
r713 r714 2968 2968 elif "isptype" in data.keys(): 2969 2969 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: 2972 2982 if "pass" not in data.keys(): 2973 2983 raise ccs_rurallink_error("Missing post variables!") 2974 changeISP(data["isptype"])2975 2984 username = urllib.unquote(data["username"]).strip() 2976 2985 password = urllib.unquote(data["pass"]).strip() … … 4155 4164 network = parts[len(parts)-1] 4156 4165 4157 if network != int_ifname and network != ap0_ifname:4166 if network not in ["internal", "ap0"]: 4158 4167 # Unknown network 4159 4168 request.send_error(404, "Cannot set policy for unknown network!") … … 4178 4187 # Update the policy 4179 4188 pref_set("traffic", "%s_policy" % network, policy, monitor_prefs) 4180 4189 4181 4190 # Now update the actual firewall 4182 4191 request.send_response(200, "Policy updated") 4183 4192 request.end_headers() 4184 4193 4194 doFirewall("start") 4195 4185 4196 @registerPage("/traffic/firewall", requireAuth=True, realm=CPE_ADMIN_REALM) 4186 4197 def trafficfirewall(request, method): -
ccsd/private/resources/rurallink.js
r709 r714 44 44 }, 45 45 '#wizard_isptype': function(element){ 46 element.onchange = wizardISP Updated;46 element.onchange = wizardISPTypeUpdated; 47 47 }, 48 48 '#wizard_ispusername': function(element){ … … 191 191 onSuccess:wizardUpdateSuccess, onFailure:wizardUpdateFailure}); 192 192 } 193 function wizardISPTypeUpdated(e) { 194 type = $F("wizard_isptype"); 195 pars = "isptype=" + type; 196 myAjax = new Ajax.Request("/", {method: 'post', postBody: pars}); 197 } 193 198 function wizardISPUpdated(e) { 194 type = $F("wizard_isptype");195 199 username = $F("wizard_ispusername"); 196 200 password = $F("wizard_isppassword"); 197 if ( type=="" ||username=="" || password=="") {201 if (username=="" || password=="") { 198 202 // Not all fields are complete 199 203 return; 200 204 } 201 205 showUpdateWindow("Configuring ISP"); 202 pars = " isptype=" + type + "&username=" + username + "&pass=" + password;206 pars = "username=" + username + "&pass=" + password; 203 207 myAjax = new Ajax.Request("/", {method: 'post', postBody: pars, 204 208 onSuccess:wizardUpdateSuccess, onFailure:wizardUpdateFailure});
Note: See TracChangeset
for help on using the changeset viewer.
