Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
pve-manager
Commits
10f7ed8d
Commit
10f7ed8d
authored
Jun 23, 2014
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add support for two factor auth
parent
16bef583
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
4 deletions
+46
-4
PVEProxy.js
www/manager/data/PVEProxy.js
+8
-2
UserEdit.js
www/manager/dc/UserEdit.js
+10
-1
RealmComboBox.js
www/manager/form/RealmComboBox.js
+8
-0
LoginWindow.js
www/manager/window/LoginWindow.js
+20
-1
No files found.
www/manager/data/PVEProxy.js
View file @
10f7ed8d
...
...
@@ -32,7 +32,7 @@ Ext.define('PVE.RestProxy', {
Ext
.
define
(
'
pve-domains
'
,
{
extend
:
"
Ext.data.Model
"
,
fields
:
[
'
realm
'
,
'
type
'
,
'
comment
'
,
'
default
'
,
fields
:
[
'
realm
'
,
'
type
'
,
'
comment
'
,
'
default
'
,
'
tfa
'
,
{
name
:
'
descr
'
,
// Note: We use this in the RealmComboBox.js
...
...
@@ -45,7 +45,13 @@ Ext.define('PVE.RestProxy', {
return
value
;
}
// return realm if there is no comment
return
info
.
comment
||
info
.
realm
;
text
=
info
.
comment
||
info
.
realm
;
if
(
info
.
tfa
)
{
text
+=
"
(+
"
+
info
.
tfa
+
"
)
"
;
}
return
text
;
}
}
],
...
...
www/manager/dc/UserEdit.js
View file @
10f7ed8d
...
...
@@ -118,11 +118,19 @@ Ext.define('PVE.dc.UserEdit', {
name
:
'
email
'
,
fieldLabel
:
gettext
(
'
E-Mail
'
),
vtype
:
'
email
'
},
}
];
var
columnB
=
[
{
xtype
:
'
textfield
'
,
name
:
'
comment
'
,
fieldLabel
:
gettext
(
'
Comment
'
)
},
{
xtype
:
'
textfield
'
,
name
:
'
keys
'
,
fieldLabel
:
gettext
(
'
Key IDs
'
)
}
];
...
...
@@ -147,6 +155,7 @@ Ext.define('PVE.dc.UserEdit', {
var
ipanel
=
Ext
.
create
(
'
PVE.panel.InputPanel
'
,
{
column1
:
column1
,
column2
:
column2
,
columnB
:
columnB
,
onGetValues
:
function
(
values
)
{
// hack: ExtJS datefield does not submit 0, so we need to set that
if
(
!
values
.
expire
)
{
...
...
www/manager/form/RealmComboBox.js
View file @
10f7ed8d
...
...
@@ -2,6 +2,14 @@ Ext.define('PVE.form.RealmComboBox', {
extend
:
'
Ext.form.field.ComboBox
'
,
alias
:
[
'
widget.pveRealmComboBox
'
],
needOTP
:
function
(
realm
)
{
var
me
=
this
;
var
rec
=
me
.
store
.
findRecord
(
'
realm
'
,
realm
);
return
rec
&&
rec
.
data
&&
rec
.
data
.
tfa
?
rec
.
data
.
tfa
:
undefined
;
},
initComponent
:
function
()
{
var
me
=
this
;
...
...
www/manager/window/LoginWindow.js
View file @
10f7ed8d
...
...
@@ -34,6 +34,13 @@ Ext.define('PVE.window.LoginWindow', {
initComponent
:
function
()
{
var
me
=
this
;
var
otp_field
=
Ext
.
createWidget
(
'
textfield
'
,
{
fieldLabel
:
gettext
(
'
OTP
'
),
name
:
'
otp
'
,
allowBlank
:
false
,
hidden
:
true
});
Ext
.
apply
(
me
,
{
width
:
400
,
modal
:
true
,
...
...
@@ -95,9 +102,21 @@ Ext.define('PVE.window.LoginWindow', {
}
}
},
otp_field
,
{
xtype
:
'
pveRealmComboBox
'
,
name
:
'
realm
'
name
:
'
realm
'
,
listeners
:
{
change
:
function
(
f
,
value
)
{
if
(
f
.
needOTP
(
value
))
{
otp_field
.
setVisible
(
true
);
otp_field
.
setDisabled
(
false
);
}
else
{
otp_field
.
setVisible
(
false
);
otp_field
.
setDisabled
(
true
);
}
}
}
},
{
xtype
:
'
pveLanguageSelector
'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment