Project

General

Profile

« Previous | Next » 

Revision 908ee218

Added by Colin Smith over 20 years ago

  • Add enable_peruserbw() to determine whether or not per-user bandwidth fields should be grayed out.
  • Call this from enable_change() to set these values when the page is first accessed.

View differences:

usr/local/www/services_captiveportal.php
219 219
	}
220 220
}
221 221

  
222
function enable_peruserbw() {
223
	if (document.iform.peruserbw.checked == false) {
224
		document.iform.bwauthmacdn.disabled = 1;
225
		document.iform.bwauthmacup.disabled = 1;
226
		document.iform.bwauthipdn.disabled = 1;
227
		document.iform.bwauthipup.disabled = 1;
228
		document.iform.bwdefaultdn.disabled = 1;
229
		document.iform.bwdefaultup.disabled = 1;
230
	} else {
231
		document.iform.bwauthmacdn.disabled = 0;
232
                document.iform.bwauthmacup.disabled = 0;
233
                document.iform.bwauthipdn.disabled = 0;
234
                document.iform.bwauthipup.disabled = 0;
235
                document.iform.bwdefaultdn.disabled = 0;
236
                document.iform.bwdefaultup.disabled = 0;
237
	}
238
}
239

  
222 240
function enable_change(enable_change) {
223 241
	var endis;
224 242
	endis = !(document.iform.enable.checked || enable_change);
......
260 278

  
261 279
	auth_method_change();
262 280
	enable_https();
281
	enable_peruserbw();
263 282

  
264 283
}
265 284
//-->
......
340 359
	  <tr>
341 360
      <td valign="top" class="vncell">Per-user bandwidth restriction</td>
342 361
      <td class="vtable">
343
		  <input name="peruserbw" type="checkbox" class="formfld" id="peruserbw" value="yes" <?php if ($pconfig['peruserbw']) echo "checked"; ?>>
362
		  <input name="peruserbw" type="checkbox" class="formfld" id="peruserbw" value="yes" <?php if ($pconfig['peruserbw']) echo "checked"; ?> onClick="enable_peruserbw()">
344 363
          <strong>Enable per-user bandwidth restriction	</strong><br><br>
345 364
		<table cellpadding="0" cellspacing="0">
346 365
		<tr>

Also available in: Unified diff