Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/extensions/admin_ui/media/javascript/ui/authentication.js
1154 views
1
//
2
// Copyright (c) 2006-2025 Wade Alcorn - [email protected]
3
// Browser Exploitation Framework (BeEF) - https://beefproject.com
4
// See the file 'doc/COPYING' for copying permission
5
//
6
7
Ext.onReady(function() {
8
9
submitAuthForm = function() {
10
11
login_mask.show();
12
login_form.getForm().submit({
13
14
success: function() {
15
window.location.href = "<%= @base_path %>/panel"
16
},
17
failure: function() {
18
if(Ext.get('loginError') == null) {
19
Ext.DomHelper.insertAfter('loadingError', {id:'loginError', html: '<b>ERROR</b>: invalid username or password'});
20
}
21
login_mask.hide();
22
}
23
});
24
}
25
26
var login_form = new Ext.form.FormPanel({
27
28
url: 'authentication/login',
29
formId: 'login_form',
30
labelWidth: 125,
31
frame: true,
32
title: 'Authentication',
33
bodyStyle:'padding:5px 5px 0',
34
width: 350,
35
defaults: {
36
width: 175,
37
inputType: 'password'
38
},
39
defaultType: 'textfield',
40
41
items: [{
42
fieldLabel: 'Username',
43
name: 'username-cfrm',
44
inputType: 'textfield',
45
id: 'user',
46
listeners: {
47
specialkey: function(field,e) {
48
if (e.getKey() == e.ENTER) {
49
submitAuthForm();
50
}
51
}
52
}
53
},{
54
fieldLabel: 'Password',
55
name: 'password-cfrm',
56
inputType: 'password',
57
id: 'pass',
58
listeners: {
59
specialkey: function(field,e) {
60
if (e.getKey() == e.ENTER) {
61
submitAuthForm();
62
}
63
}
64
}
65
}],
66
67
buttons: [{
68
text: 'Login',
69
id: 'loginButton',
70
handler: function() {
71
submitAuthForm();
72
}
73
}]
74
});
75
76
var login_mask = new Ext.LoadMask(Ext.getBody(), {msg:"Authenticating to BeEF..."});
77
login_form.render('centered');
78
Ext.DomHelper.append('login_form', {tag: 'div', id: 'loadingError'});
79
document.getElementById('user').focus();
80
81
});
82
83