This topic is locked

Differnet field for 'Logged in as'

3/5/2009 3:39:52 PM
ASPRunnerPro General questions
T
Tim author

Hello,
Is there an easy way to change the field used for "Logg in as" and the list of users on the "Assign Users to Groups" form?
I am using ASPRunner security and Windows authentication (so no one ever really types in a user name). On the logon page I look up the Windows user name from a table, then grab a StaffID field (which is a int field) and assign that number to the "UserID" session varible. I also grab a "FullName" field and assign it to a Session("UserName") varible. I would like to use this full name for the "Logged in as" and list of users on the "Assign Users to Groups" form, but I would like to continue to use the StaffID field as the username (on the security page of the wizard). How would you suggest doing this?
Also, it sure would be nice to have search capability on the "Assign Users to Groups" form <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=11125&image=1&table=forumtopics' class='bbc_emoticon' alt=':)' />
Thanks,

Tim

J
Jane 3/6/2009

Tim,
to change username in theLogged in <username> message useList page: Before display event on the Events tab.

Here is a sample:

xt.assign "username",Session("UserName")


To change usernames on the Assign Users to Groups page edit generated admin_members_list.asp file manually.

Find this line:

row("username")=my_htmlspecialchars(rs("Username"))



and replace it with this one:

row("username")=my_htmlspecialchars(Session("UserName"))

T
Tim author 3/6/2009

Perfect. Thanks so much Jane.

T
Tim author 3/11/2009

Jane,
Sorry to bring this back again, but the second solution here doesn't work for me. (The first solution works great.. thanks)
When I change the code in the admin_members_list.asp page to Session("UserName") it displays all users as the current logged on user, which makes sense I guess because that's what the Session("UserName") is set to at that moment. i tried using rs("FullName") - which is the field i use to popluate the username session varible - but that just threw errors. Any other thoughts?
Thanks for your time.

Tim

J
Jane 3/12/2009

Tim,
find this line in the admin_members_List.asp file:

gsqlHead="select [Username] "



and repalce it with this one:

gsqlHead="select [Username],[FullName] "


Then use this code:

row("username")=my_htmlspecialchars(rs("FullName"))

T
Tim author 4/14/2009

Hi Jane,
Sorry... digging up an old issue - once again <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=40149&image=1&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' /> I swear I did this fix a few weeks ago and it worked great, but here are my issues now:
Everytime I publish the app it overwrites the edited version of admin_members_List.asp. Is that just how it has to be? A bit of a pain, but I could live with that.
It looks like the user list is still sorted by the StaffID instead of FullName... is there a way to correct that?
Also, with either of the admin_members_List.asp file (edited or not), I get an error page when I try to sort by any of the column headers. The user list column header works, but any of the group columns fail.
Thanks for your help.

Tim

J
Jane 4/15/2009

Tim,
unofrtunately there is no easy way to sort records on this page.
Regarding the error message.

Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.