[pve-devel] r5580 - in pve-manager/pve2: lib/PVE lib/PVE/API2 www/manager

svn-commits at proxmox.com svn-commits at proxmox.com
Tue Feb 22 08:43:01 CET 2011


Author: dietmar
Date: 2011-02-22 08:43:01 +0100 (Tue, 22 Feb 2011)
New Revision: 5580

Modified:
   pve-manager/pve2/lib/PVE/API2/Nodes.pm
   pve-manager/pve2/lib/PVE/REST.pm
   pve-manager/pve2/www/manager/ClusterConfig.js
Log:
fixes for latest PVE/AccessControl.pm changes


Modified: pve-manager/pve2/lib/PVE/API2/Nodes.pm
===================================================================
--- pve-manager/pve2/lib/PVE/API2/Nodes.pm	2011-02-22 07:41:39 UTC (rev 5579)
+++ pve-manager/pve2/lib/PVE/API2/Nodes.pm	2011-02-22 07:43:01 UTC (rev 5580)
@@ -193,7 +193,7 @@
 	my $max = $param->{max} || 0;
 	my $user = $rpcenv->get_user();
 
-	my $loguser = $user eq 'root' ? "" : $user;
+	my $loguser = $user eq 'root at pam' ? "" : $user;
 
 	my $res = decode_json(PVE::Cluster::get_system_log($loguser, $max));
 

Modified: pve-manager/pve2/lib/PVE/REST.pm
===================================================================
--- pve-manager/pve2/lib/PVE/REST.pm	2011-02-22 07:41:39 UTC (rev 5579)
+++ pve-manager/pve2/lib/PVE/REST.pm	2011-02-22 07:43:01 UTC (rev 5580)
@@ -266,7 +266,7 @@
 my $check_permissions = sub {
     my ($rpcenv, $perm, $username, $param) = @_;
 
-    return 1 if $username eq 'root';
+    return 1 if $username eq 'root at pam';
 
     die "permission check failed (user != root)\n" if !$perm;
 
@@ -335,7 +335,7 @@
 	    }
 	}
 
-	PVE::Cluster::log_msg('info', "root", "successful auth for user '$user'");
+	PVE::Cluster::log_msg('info', 'root at pam', "successful auth for user '$user'");
 	return { status => HTTP_OK, ticket => $ticket, 
 		 data => { ticket => $ticket }};
     }

Modified: pve-manager/pve2/www/manager/ClusterConfig.js
===================================================================
--- pve-manager/pve2/www/manager/ClusterConfig.js	2011-02-22 07:41:39 UTC (rev 5579)
+++ pve-manager/pve2/www/manager/ClusterConfig.js	2011-02-22 07:43:01 UTC (rev 5580)
@@ -11,7 +11,7 @@
 	    root: 'data',
 	    restful: true, // use GET, not POST
 	    fields: [ 
-		'id', 'domid', 'name', 'comment',
+		'id', 'firstname', 'lastname' , 'email', 'comment',
 		{ type: 'boolean', name: 'enabled' }, 
 		{ type: 'date', dateFormat: 'timestamp', name: 'expire' },
 	    ],
@@ -25,23 +25,38 @@
 
 	    return date.format("Y-m-d");
 	};
+	var render_full_name = function(firstname, metaData, record) {
 
+	    var first = firstname || '';
+	    var last = record.data.lastname || '';
+	    return first + " " + last;
+	};
+
+	var render_username = function(id) {
+	    return id.match(/^([^@]+)/)[1];
+	};
+	var render_realm = function(id) {
+	    return id.match(/@([^@]+)$/)[1];
+	};
+
 	Ext.apply(self, {
 	    store: store,
 	    autoExpandColumn: 'comment',
 	    stateful: false,
 	    columns: [
 		{
-		    header: 'ID',
+		    header: 'User name',
 		    width: 200,
 		    sortable: true,
+		    renderer: render_username,
 		    dataIndex: 'id'
 		},
 		{
-		    header: 'Auth',
+		    header: 'Realm',
 		    width: 100,
 		    sortable: true,
-		    dataIndex: 'domid'
+		    renderer: render_realm,
+		    dataIndex: 'id'
 		},
 		{
 		    header: 'Enabled',
@@ -60,7 +75,8 @@
 		    header: 'Name',
 		    width: 150,
 		    sortable: true,
-		    dataIndex: 'name'
+		    renderer: render_full_name,
+		    dataIndex: 'firstname'
 		},
 		{
 		    id: 'comment',
@@ -91,38 +107,27 @@
 	    autoDestory: true,
 	    root: 'data',
 	    restful: true, // use GET, not POST
-	    fields: [ 'id', 'users' ],
+	    fields: [ 'id', 'comment' ],
 	    idProperty: 'id',
 	    sortInfo: { field: 'id', order: 'DESC' }
 	});
 
-	var render_users = function(value) {
-
-	    if (!value)
-		return '-';
-
-	    // allow word wrap
-	    return '<div style="white-space:normal;">' + 
-		value.join(' ') + "</div>";
-	};
-
 	Ext.apply(self, {
 	    store: store,
-	    autoExpandColumn: 'users',
+	    autoExpandColumn: 'comment',
 	    stateful: false,
 	    columns: [
 		{
-		    header: 'ID',
+		    header: 'Group name',
 		    width: 200,
 		    sortable: true,
 		    dataIndex: 'id'
 		},
 		{
-		    id: 'users',
-		    header: 'Users',
-		    sortable: true,
-		    renderer: render_users, 
-		    dataIndex: 'users'
+		    id: 'comment',
+		    header: 'Comment',
+		    sortable: false,
+		    dataIndex: 'comment'
 		}
 	    ],
 	    listeners: {
@@ -170,7 +175,7 @@
 	    stateful: false,
 	    columns: [
 		{
-		    header: 'ID',
+		    header: 'Role name',
 		    width: 150,
 		    sortable: true,
 		    dataIndex: 'id'
@@ -216,7 +221,7 @@
 	    stateful: false,
 	    columns: [
 		{
-		    header: 'ID',
+		    header: 'Realm',
 		    width: 100,
 		    sortable: true,
 		    dataIndex: 'id'




More information about the pve-devel mailing list