Basic auth
This commit is contained in:
@@ -140,6 +140,12 @@ select.interface {
|
||||
ajax(server, {action: 'set-remote', params: {server: $('#server_'+pid).val() , session: pid}});
|
||||
}
|
||||
|
||||
function auth(pid) {
|
||||
ajax(server, {action: "auth-user-pass", params:{session: pid,
|
||||
user:$('#auth_'+pid+'>input.user').val(),
|
||||
password:$('#auth_'+pid+'>input.pass').val()}});
|
||||
}
|
||||
|
||||
function refresh(server, data) {
|
||||
setTimeout(function(){ ajax(server, {"action":"get-remotes"} )}, 3000);
|
||||
if (data["last_change"] == last_change) {
|
||||
@@ -176,7 +182,15 @@ select.interface {
|
||||
} else {
|
||||
line +='<td>'+infos['active-vpn']+'</td>';
|
||||
}
|
||||
if(infos['status']=="Need Password") {
|
||||
line +='<td><form id="auth_'+pid+'" action="#" onsubmit="auth('+pid+') ; return false" >';
|
||||
line +='<input class="user" placeholder="Enter login" size="8">';
|
||||
line +='<input type="password" placeholder="Password" size="8" class="pass">';
|
||||
line +='<input type="submit" value="G0">';
|
||||
line +='</form></td>';
|
||||
} else {
|
||||
line +='<td>'+infos['status']+'</td>';
|
||||
}
|
||||
|
||||
line +='<td><a href="javascript:vpn_restart('+pid+')">Reload</a></td>';
|
||||
line +='<td><a href="javascript:vpn_kill('+pid+')">Kill</a></td>';
|
||||
|
||||
Reference in New Issue
Block a user