[pve-devel] r6348 - in pve-manager/pve2: . www/manager/dc

svn-commits at proxmox.com svn-commits at proxmox.com
Fri Jul 22 06:44:48 CEST 2011


Author: dietmar
Date: 2011-07-22 06:44:48 +0200 (Fri, 22 Jul 2011)
New Revision: 6348

Modified:
   pve-manager/pve2/ChangeLog
   pve-manager/pve2/www/manager/dc/AuthEdit.js
   pve-manager/pve2/www/manager/dc/UserEdit.js
Log:
commit patches from Seth


Modified: pve-manager/pve2/ChangeLog
===================================================================
--- pve-manager/pve2/ChangeLog	2011-07-22 04:34:04 UTC (rev 6347)
+++ pve-manager/pve2/ChangeLog	2011-07-22 04:44:48 UTC (rev 6348)
@@ -1,3 +1,9 @@
+2011-07-21  Seth Lauzon  <seth.lauzon at gmail.com>
+
+	* www/manager/UserEdit.js: add pveRealmComboBox field
+
+	* www/manager/AuthEdit.js: impl. multiple server designation
+
 2011-07-21  Proxmox Support Team  <support at proxmox.com>
 
 	* www/manager/Utils.js (API2Request): improved waitMsgTarget

Modified: pve-manager/pve2/www/manager/dc/AuthEdit.js
===================================================================
--- pve-manager/pve2/www/manager/dc/AuthEdit.js	2011-07-22 04:34:04 UTC (rev 6347)
+++ pve-manager/pve2/www/manager/dc/AuthEdit.js	2011-07-22 04:44:48 UTC (rev 6348)
@@ -9,6 +9,7 @@
 
         var url;
         var method;
+        var serverlist;
 
         if (me.create) {
             url = '/api2/extjs/access/domains';
@@ -24,17 +25,20 @@
                 name: 'realm',
                 fieldLabel: 'Realm',
                 value: me.realm,
+                emptyText: 'company.net',
                 allowBlank: false
             },
             {
                 xtype: 'textfield',
                 name: 'base_dn',
                 fieldLabel: 'Base Domain Name',
+                emptyText: 'CN=Users,DC=Company,DC=net',
                 allowBlank: false
             },
             {
                 xtype: 'textfield',
-                name: 'useer_attr',
+                name: 'user_attr',
+                emptyText: 'uid / sAMAccountName',
                 fieldLabel: 'User Attribute Name',
                 allowBlank: false
             },
@@ -42,6 +46,7 @@
                 xtype: 'textfield',
                 name: 'comment',
                 fieldLabel: 'Comment',
+                emptyText: 'Enterprise Directory Server',
                 allowBlank: false
             },
             {
@@ -53,16 +58,31 @@
         ];
 
         var column2 = [
-            {
-                xtype: me.create ? 'textfield' : 'displayfield',
+	    Ext.create('Ext.form.ComboBox', {
+		fieldLabel: 'Server Type',
                 name: 'type',
-                fieldLabel: 'Server Type',
-                allowBlank: false
-            },
+		store: Ext.create('Ext.data.Store', {
+		    fields: ['type'],
+		    data: [
+			{'type':'AD'},
+			{'type':'LDAP'}
+		    ]
+		}),
+		queryMode: 'local',
+		displayField: 'type',
+		valueField: 'type'
+	    }),
             {
                 xtype: 'textfield',
-                name: 'server',
                 fieldLabel: 'Server Address',
+                name: 'servers',
+                emptyText: '192.168.2.23,ldap.company.net',
+                listeners: {
+                    change: function(combo, newValue){
+                        serverlist = newValue.split(',');
+                    }
+                },
+                submitValue: false,
                 allowBlank: false
             },
             {
@@ -75,7 +95,7 @@
             },
             {
                 xtype: 'pvecheckbox',
-                fieldLabel: 'Secure Communication',
+                fieldLabel: 'SSL',
                 name: 'secure',
                 uncheckedValue: 0
             }
@@ -83,7 +103,15 @@
 
 	var ipanel = Ext.create('PVE.panel.InputPanel', {
 	    column1: column1,
-	    column2: column2
+	    column2: column2,
+	    onGetValues: function(values) {
+                var i;
+                for (i=0; i<serverlist.length; i++) {
+                    var num = i + 1;
+                    values['server' + num.toString()] = serverlist[i];
+                }
+		return values;
+	    }
 	});
 
         Ext.applyIf(me, {
@@ -95,13 +123,20 @@
 
         me.callParent();
 
-//        if (!me.create) {
-//            me.load({
-//                success: function(response, options) {
-//		    var data = response.result.data;
-//                  me.setValues(data);
-//                }
-//            });
-//        }
+        if (!me.create) {
+            me.load({
+                success: function(response, options) {
+		    var data = response.result.data;
+                    var count = 1;
+                    while (data['server' + count.toString()]) {
+			if (data.servers) {
+			    data.servers += ',';
+			}
+                        data.servers += data['server' + count.toString()];
+                    }
+                    me.setValues(data);
+                }
+            });
+        }
     }
 });

Modified: pve-manager/pve2/www/manager/dc/UserEdit.js
===================================================================
--- pve-manager/pve2/www/manager/dc/UserEdit.js	2011-07-22 04:34:04 UTC (rev 6347)
+++ pve-manager/pve2/www/manager/dc/UserEdit.js	2011-07-22 04:44:48 UTC (rev 6348)
@@ -9,6 +9,7 @@
 
         var url;
         var method;
+        var realm;
 
         if (me.create) {
             url = '/api2/extjs/access/users';
@@ -21,11 +22,11 @@
         var column1 = [
             {
                 xtype: me.create ? 'textfield' : 'displayfield',
-//                name: me.create ? 'username' : 'userid',
                 name: 'userid',
                 fieldLabel: 'Userid',
                 value: me.userid,
-                allowBlank: false
+                allowBlank: false,
+                submitValue: me.create ? true : false
             },
 	    new Ext.form.ComboBox({
 		fieldLabel: 'Group',
@@ -33,7 +34,7 @@
 		multiSelect: true,
 		hiddenName: 'groupid',
 		store: new Ext.data.Store({
-		     autoLoad: true,
+                    autoLoad: true,
 		    model: 'pve-groups',
 		    proxy: {
 			type: 'pve',
@@ -66,8 +67,6 @@
             {
                 xtype: 'fieldset',
                 title: 'Personal Information',
-                collapsible: true,
-                collapsed: true,
                 defaultType: 'textfield',
                 layout: 'anchor',
                 defaults: {
@@ -104,20 +103,20 @@
             });
         }
 
-//        if (me.create) {
-//            column1.splice(1,0,{
-//                xtype: 'pveRealmComboBox',
-//                name: 'realm',
-//                fieldLabel: 'Realm',
-//                allowBlank: false,
-//                submitValue: true
-//            },
-//            {
-//                xtype: 'hidden',
-//                name: 'userid',
-//                value: ipanel.findField('username').getValue()
-//            });
-//        }
+        if (me.create) {
+            column1.splice(1,0,{
+                xtype: 'pveRealmComboBox',
+                name: 'realm',
+                fieldLabel: 'Realm',
+                allowBlank: false,
+                listeners: {
+                    change: function(combo, newValue){
+                        realm = newValue;
+                    }
+                },
+                submitValue: false
+            });
+        }
 
 
 	var ipanel = Ext.create('PVE.panel.InputPanel', {
@@ -129,6 +128,10 @@
 		    values.expire = 0;
 		}
 
+		if (realm) {
+		    values.userid = values.userid + '@' + realm;
+		}
+
 		return values;
 	    }
 	});




More information about the pve-devel mailing list