Ravi Nori has uploaded a new change for review.

Change subject: core : User Name modified on user login
......................................................................

core : User Name modified on user login

When a user logs into the User Portal or Admin Portal the
user name is modified and it looses the domain name attached
to it.

This patch appends the domain name to the user name before updating
the user info in database with the info from Ldap.

Change-Id: I072f9aa8dc706533682b53d8b5a56e9b2dc09b82
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=892631
Signed-off-by: Ravi Nori <[email protected]>
---
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/DbUser.java
1 file changed, 9 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/69/10869/1

diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/DbUser.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/DbUser.java
index b4a9a0c..ae02cbd 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/DbUser.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/DbUser.java
@@ -362,7 +362,7 @@
 
     public DbUser(LdapUser ldapUser) {
         setuser_id(ldapUser.getUserId());
-        setusername(ldapUser.getUserName());
+        setusername(getFullUserName(ldapUser));
         setname(ldapUser.getName());
         setsurname(ldapUser.getSurName());
         setdepartment(ldapUser.getDepartment());
@@ -373,6 +373,14 @@
         setGroupIds(ldapUser.getGroupIds());
     }
 
+    private String getFullUserName(LdapUser ldapUser) {
+        String userName = ldapUser.getUserName();
+        if (userName.indexOf("@") == -1) {
+            userName = userName +"@"+ ldapUser.getDomainControler();
+        }
+        return userName;
+    }
+
     public LdapRefStatus getAdStatus() {
         if (getstatus() == 0) {
             return LdapRefStatus.Inactive;


--
To view, visit http://gerrit.ovirt.org/10869
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I072f9aa8dc706533682b53d8b5a56e9b2dc09b82
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ravi Nori <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to