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
7d633d5f
Commit
7d633d5f
authored
Jan 13, 2012
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow to set password on pam and pve realm
parent
c5f6451f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
3 deletions
+48
-3
UserEdit.js
www/manager/dc/UserEdit.js
+48
-3
No files found.
www/manager/dc/UserEdit.js
View file @
7d633d5f
...
@@ -19,6 +19,48 @@ Ext.define('PVE.dc.UserEdit', {
...
@@ -19,6 +19,48 @@ Ext.define('PVE.dc.UserEdit', {
method
=
'
PUT
'
;
method
=
'
PUT
'
;
}
}
var
validate_pw
=
function
()
{
if
(
verifypw
.
getValue
()
!==
pwfield
.
getValue
())
{
return
gettext
(
"
Passwords does not match
"
);
}
return
true
;
};
var
verifypw
=
Ext
.
createWidget
(
'
textfield
'
,
{
inputType
:
'
password
'
,
fieldLabel
:
gettext
(
'
Verify Password
'
),
name
:
'
verifypassword
'
,
submitValue
:
false
,
disabled
:
true
,
hidden
:
true
,
validator
:
validate_pw
});
var
pwfield
=
Ext
.
createWidget
(
'
textfield
'
,
{
inputType
:
'
password
'
,
fieldLabel
:
gettext
(
'
Password
'
),
minLength
:
5
,
allowBlank
:
false
,
name
:
'
password
'
,
disabled
:
true
,
hidden
:
true
,
validator
:
validate_pw
});
var
update_passwd_field
=
function
(
realm
)
{
if
(
realm
===
'
pve
'
||
realm
===
'
pam
'
)
{
pwfield
.
setVisible
(
true
);
pwfield
.
setDisabled
(
false
);
verifypw
.
setVisible
(
true
);
verifypw
.
setDisabled
(
false
);
}
else
{
pwfield
.
setVisible
(
false
);
pwfield
.
setDisabled
(
true
);
verifypw
.
setVisible
(
false
);
verifypw
.
setDisabled
(
true
);
}
};
var
column1
=
[
var
column1
=
[
{
{
xtype
:
me
.
create
?
'
textfield
'
:
'
displayfield
'
,
xtype
:
me
.
create
?
'
textfield
'
:
'
displayfield
'
,
...
@@ -29,6 +71,7 @@ Ext.define('PVE.dc.UserEdit', {
...
@@ -29,6 +71,7 @@ Ext.define('PVE.dc.UserEdit', {
allowBlank
:
false
,
allowBlank
:
false
,
submitValue
:
me
.
create
?
true
:
false
submitValue
:
me
.
create
?
true
:
false
},
},
pwfield
,
verifypw
,
{
{
xtype
:
'
pveGroupSelector
'
,
xtype
:
'
pveGroupSelector
'
,
name
:
'
groups
'
,
name
:
'
groups
'
,
...
@@ -88,16 +131,16 @@ Ext.define('PVE.dc.UserEdit', {
...
@@ -88,16 +131,16 @@ Ext.define('PVE.dc.UserEdit', {
listeners
:
{
listeners
:
{
change
:
function
(
combo
,
newValue
){
change
:
function
(
combo
,
newValue
){
realm
=
newValue
;
realm
=
newValue
;
update_passwd_field
(
realm
);
}
}
},
},
submitValue
:
false
submitValue
:
false
});
});
}
}
var
ipanel
=
Ext
.
create
(
'
PVE.panel.InputPanel
'
,
{
var
ipanel
=
Ext
.
create
(
'
PVE.panel.InputPanel
'
,
{
column1
:
column1
,
column1
:
column1
,
column2
:
column2
,
column2
:
column2
,
onGetValues
:
function
(
values
)
{
onGetValues
:
function
(
values
)
{
// hack: ExtJS datefield does not submit 0, so we need to set that
// hack: ExtJS datefield does not submit 0, so we need to set that
if
(
!
values
.
expire
)
{
if
(
!
values
.
expire
)
{
...
@@ -134,7 +177,9 @@ Ext.define('PVE.dc.UserEdit', {
...
@@ -134,7 +177,9 @@ Ext.define('PVE.dc.UserEdit', {
}
}
}
}
me
.
setValues
(
data
);
update_passwd_field
(
data
.
realm
);
me
.
setValues
(
data
);
}
}
});
});
}
}
...
...
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