[pmg-devel] [PATCH pmg-gui v4 2/3] realms: enable default realm support

Markus Frank m.frank at proxmox.com
Wed Mar 19 14:29:58 CET 2025


Allow PAM and PMG realms to be edited and set as default. To make the
login view reflect the default realm setting, the value of the realm
field is removed.

Signed-off-by: Markus Frank <m.frank at proxmox.com>
---
v4:
* removed the default value of the realm field in the LoginView so that
  the default realm is automatically selected.
* changed commit message

 js/LoginView.js      |  1 -
 js/UserManagement.js |  1 +
 js/Utils.js          | 16 ++++++++++------
 3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/js/LoginView.js b/js/LoginView.js
index 67940ed..cb7e43f 100644
--- a/js/LoginView.js
+++ b/js/LoginView.js
@@ -374,7 +374,6 @@ Ext.define('PMG.LoginView', {
 			    reference: 'realmfield',
 			    name: 'realm',
 			    baseUrl: '/access/auth-realm',
-			    value: 'pam',
 			},
 			{
 			    xtype: 'proxmoxLanguageSelector',
diff --git a/js/UserManagement.js b/js/UserManagement.js
index f6ada1b..79d1e3f 100644
--- a/js/UserManagement.js
+++ b/js/UserManagement.js
@@ -40,6 +40,7 @@ Ext.define('PMG.UserManagement', {
 	    itemId: 'realms',
 	    baseUrl: '/access/auth-realm',
 	    storeBaseUrl: '/access/auth-realm',
+	    showDefaultRealm: true,
 	    iconCls: 'fa fa-address-book-o',
 	},
     ],
diff --git a/js/Utils.js b/js/Utils.js
index d4a55a8..aa17d83 100644
--- a/js/Utils.js
+++ b/js/Utils.js
@@ -877,12 +877,16 @@ Ext.define('PMG.Utils', {
 	Proxmox.Schema.authDomains.ldap.add = false;
 	Proxmox.Schema.authDomains.ad.add = false;
 
-	Proxmox.Schema.authDomains.pam.edit = false;
-	Proxmox.Schema.authDomains.pmg = {
-	    add: false,
-	    edit: false,
-	    sync: false,
-	};
+	Proxmox.Schema.overrideAuthDomains({
+	    pmg: {
+		name: 'Proxmox Mail Gateway authentication server',
+		ipanel: 'pmxAuthSimplePanel',
+		add: false,
+		edit: true,
+		pwchange: true,
+		sync: false,
+	    },
+	});
 
 	// do whatever you want here
 	Proxmox.Utils.override_task_descriptions({
-- 
2.39.5





More information about the pmg-devel mailing list