[pve-devel] [PATCH manager 38/49] use window.PasswordEdit from widget toolkit

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Jan 23 11:05:55 CET 2018


Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/dc/UserView.js | 55 +--------------------------------------------
 1 file changed, 1 insertion(+), 54 deletions(-)

diff --git a/www/manager6/dc/UserView.js b/www/manager6/dc/UserView.js
index da1b516a..6dfc1041 100644
--- a/www/manager6/dc/UserView.js
+++ b/www/manager6/dc/UserView.js
@@ -1,56 +1,3 @@
-Ext.define('PVE.window.PasswordEdit', {
-    extend: 'Proxmox.window.Edit',
-
-    initComponent : function() {
-	var me = this;
-
-	if (!me.userid) {
-	    throw "no userid specified";
-	}
-
-	var verifypw;
-	var pwfield;
-
-	var validate_pw = function() {
-	    if (verifypw.getValue() !== pwfield.getValue()) {
-		return gettext("Passwords does not match");
-	    }
-	    return true;
-	};
-
-	verifypw = Ext.createWidget('textfield', { 
-	    inputType: 'password',
-	    fieldLabel: gettext('Confirm password'), 
-	    name: 'verifypassword',
-	    submitValue: false,
-	    validator: validate_pw
-	});
-
-	pwfield = Ext.createWidget('textfield', { 
-	    inputType: 'password',
-	    fieldLabel: gettext('Password'), 
-	    minLength: 5,
-	    name: 'password',
-	    validator: validate_pw
-	});
-
-	Ext.apply(me, {
-	    subject: gettext('Password'),
-	    url: '/api2/extjs/access/password',
-	    items: [
-		pwfield, verifypw,
-		{
-		    xtype: 'hiddenfield',
-		    name: 'userid',
-		    value: me.userid
-		}
-	    ]
-	});
-
-	me.callParent();
-    }
-});
-
 Ext.define('PVE.dc.UserView', {
     extend: 'Ext.grid.GridPanel',
 
@@ -123,7 +70,7 @@ Ext.define('PVE.dc.UserView', {
 	    disabled: true,
 	    selModel: sm,
 	    handler: function(btn, event, rec) {
-		var win = Ext.create('PVE.window.PasswordEdit',{
+		var win = Ext.create('Proxmox.window.PasswordEdit', {
                     userid: rec.data.userid
 		});
 		win.on('destroy', reload);
-- 
2.14.2





More information about the pve-devel mailing list