cancel
Showing results for 
Search instead for 
Did you mean: 

Retriving user details from Portal database

Former Member
0 Kudos

Hi Friends

Do any one knows how to retrive user(portal login user) details from Portal database.

Thank you

maruti

Accepted Solutions (1)

Accepted Solutions (1)

Dheerendra
Participant
0 Kudos

hi maruti ....what the problem is with u guy's.....

it is too much simple to get the user Details from portals database.....first of plz noted some points.

1. u must use the IUser InterFace.

2. also the Data abt a user is mapped thrgh the attribute-mapping xml file which mapped to the LDAP Server.

Also the my following code Snippet may solves ur's problem....as i had worked on same and get successfully data of the logged user from Back-end...

-


String userID = "";

String [] nameSpace, attrib = new String[100], nSpace;

try{

IWDClientUser wdUser = WDClientUser.getCurrentUser();

IUser user = wdUser.getSAPUser();

nSpace = user.getAttributeNamespaces();

// for(int k =3 ; k < nSpace.length; k++)

// {

// wdComponentAPI.getMessageManager().reportSuccess("NameSpace: "+nSpace[k]);

// nameSpace = user.getAttributeNames(nSpace[k]);

nameSpace = user.getAttributeNames("com.sap.security.core.usermanagement");

for(int i = 0 ; i < nameSpace.length; i++)

{

if(nameSpace<i>.equals("uniquename"))

{

attrib = user.getAttribute("com.sap.security.core.usermanagement",nameSpace<i>);

//wdComponentAPI.getMessageManager().reportSuccess(":::::::: "nameSpace<i>" "+attrib.length);

for(int j =0 ; j < attrib.length; j++)

{

//wdComponentAPI.getMessageManager().reportSuccess("Login ID::::::-->"+attrib[j]);

wdContext.currentContextElement().setLoginid(attrib[j]);

}

userID = attrib[0];

}

//----


if(nameSpace<i>.equals("firstname"))

{

attrib = user.getAttribute("com.sap.security.core.usermanagement",nameSpace<i>);

//wdComponentAPI.getMessageManager().reportSuccess(":::::::: "nameSpace<i>" "+attrib.length);

for(int j =0 ; j < attrib.length; j++)

{

// wdComponentAPI.getMessageManager().reportSuccess("FirstName::::::-->"+attrib[j]);

wdContext.currentContextElement().setFirstname(attrib[j]);

}

userID = attrib[0];

}

//----


//----


if(nameSpace<i>.equals("lastname"))

{

attrib = user.getAttribute("com.sap.security.core.usermanagement",nameSpace<i>);

//wdComponentAPI.getMessageManager().reportSuccess(":::::::: "nameSpace<i>" "+attrib.length);

for(int j =0 ; j < attrib.length; j++)

{

// wdComponentAPI.getMessageManager().reportSuccess("lastname::::::-->"+attrib[j]);

wdContext.currentContextElement().setLastname(attrib[j]);

}

userID = attrib[0];

}

//----


//----


-


with Best Regard's

Dheerendra k Shukla

Answers (1)

Answers (1)

Former Member
0 Kudos

Maruti,

Why not to use advises given in your other thread ???

You didn't even reply to authors, meanwhile there are correct answers...

VS

Former Member
0 Kudos

Hi Valery Silaey

Thank you for your reply. I am actually collectiing the necessary information. I really like to reply to every one who try to help me out .Thank you and all.

Maruti

Former Member
0 Kudos

Maruti,

The way to say "thanks" and other guidelines for community members are well described here:

If did not read them, please do this now.

And then please check your 4 topics -- I bet there are at least helpfull answers:

[url ;Sending Email to proxy[/url]

VS