mirror of
				https://github.com/billz/raspap-webgui.git
				synced 2025-03-01 10:31:47 +00:00 
			
		
		
		
	Merge pull request #1050 from RaspAP/feature-open-network
Remove pw requirement for open networks
This commit is contained in:
		@@ -343,19 +343,6 @@ $(document).on("click", ".js-toggle-password", function(e) {
 | 
			
		||||
    }
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
$(document).on("keyup", ".js-validate-psk", function(e) {
 | 
			
		||||
    var field  = $(e.target);
 | 
			
		||||
    var colors = field.data("colors").split(",");
 | 
			
		||||
    var target = $(field.data("target"));
 | 
			
		||||
    if (field.val().length < 8 || field.val().length > 63) {
 | 
			
		||||
        field.css("backgroundColor", colors[0]);
 | 
			
		||||
        target.attr("disabled", true);
 | 
			
		||||
    } else {
 | 
			
		||||
        field.css("backgroundColor", colors[1]);
 | 
			
		||||
        target.attr("disabled", false);
 | 
			
		||||
    }
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
$(function() {
 | 
			
		||||
    $('#theme-select').change(function() {
 | 
			
		||||
        var theme = themes[$( "#theme-select" ).val() ]; 
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
		<input type="hidden" name="ssid<?php echo $index ?>" value="<?php echo htmlentities($network['ssid'], ENT_QUOTES) ?>" />
 | 
			
		||||
		<?php if (strlen($network['ssid']) == 0) {
 | 
			
		||||
			$network['ssid'] = "(unknown)";
 | 
			
		||||
		} ?>
 | 
			
		||||
        } ?>
 | 
			
		||||
		<h5 class="card-title"><?php echo htmlspecialchars($network['ssid'], ENT_QUOTES); ?></h5>
 | 
			
		||||
 | 
			
		||||
		<div class="info-item-wifi"><?php echo _("Status"); ?></div>
 | 
			
		||||
@@ -62,7 +62,7 @@
 | 
			
		||||
				<?php if ($network['protocol'] === 'Open') { ?>
 | 
			
		||||
					<input type="password" disabled class="form-control" aria-describedby="passphrase" name="passphrase<?php echo $index ?>" value="" />
 | 
			
		||||
				<?php } else { ?>
 | 
			
		||||
					<input type="password" class="form-control js-validate-psk" aria-describedby="passphrase" name="passphrase<?php echo $index ?>" value="<?php echo $network['passphrase'] ?>" data-target="#update<?php echo $index ?>" data-colors="#ffd0d0,#d0ffd0">
 | 
			
		||||
					<input type="password" class="form-control" aria-describedby="passphrase" name="passphrase<?php echo $index ?>" value="<?php echo $network['passphrase'] ?>" data-target="#update<?php echo $index ?>" data-colors="#ffd0d0,#d0ffd0">
 | 
			
		||||
					<div class="input-group-append">
 | 
			
		||||
						<button class="btn btn-outline-secondary js-toggle-password" type="button" data-target="[name=passphrase<?php echo $index ?>]" data-toggle-with="<?php echo _("Hide") ?>">Show</button>
 | 
			
		||||
					</div>
 | 
			
		||||
@@ -75,7 +75,7 @@
 | 
			
		||||
				<input type="submit" class="col-xs-4 col-md-4 btn btn-warning" value="<?php echo _("Update"); ?>" id="update<?php echo $index ?>" name="update<?php echo $index ?>"<?php echo ($network['protocol'] === 'Open' ? ' disabled' : '')?> data-toggle="modal" data-target="#configureClientModal" />
 | 
			
		||||
				<button type="submit" class="col-xs-4 col-md-4 btn btn-info" value="<?php echo $index?>" name="connect"><?php echo _("Connect"); ?></button>
 | 
			
		||||
			<?php } else { ?>
 | 
			
		||||
				<input type="submit" class="col-xs-4 col-md-4 btn btn-info" value="<?php echo _("Add"); ?>" id="update<?php echo $index ?>" name="update<?php echo $index ?>" <?php echo ($network['protocol'] === 'Open' ? '' : ' disabled')?> data-toggle="modal" data-target="#configureClientModal" />
 | 
			
		||||
				<input type="submit" class="col-xs-4 col-md-4 btn btn-info" value="<?php echo _("Add"); ?>" id="update<?php echo $index ?>" name="update<?php echo $index ?>" data-toggle="modal" data-target="#configureClientModal" />
 | 
			
		||||
			<?php } ?>
 | 
			
		||||
			<input type="submit" class="col-xs-4 col-md-4 btn btn-danger" value="<?php echo _("Delete"); ?>" name="delete<?php echo $index ?>"<?php echo ($network['configured'] ? '' : ' disabled')?> data-toggle="modal" data-target="#configureClientModal" />
 | 
			
		||||
		</div><!-- /.btn-group -->
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user