close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Displaying a logged in users name on all backend homepage.

Thread began 10/29/2009 12:19 pm by jenkolaka19379118 | Last modified 11/06/2009 12:51 pm by Jason Byrnes | 2252 views | 9 replies |

jenkolaka19379118

Displaying a logged in users name on all backend homepage.

Hello,

Ok I have figured out how to display a users name on a page.

e.g welcome: {session.sessionname}

I was able to do this by creating the session on the login page, server behaviour, "authenticate user". I went to step 3/3 and added 2 sessions, one for firstname column and another for lastname column. Then I went to my admin homepage and bind the sessions to the page. So I get e.g.

Welcome John Doe.

What I need help on is I need to display the users userLevel next to the name.

e.g. Welcome John Doe {session.userLeveltextdescription}

The problem is if I use the session variable in my parent table I will get the userlevel ID so it will display an integer. How would I get the session to display the text value of the userlevel ID according to the logged in user?

ps I have a bad feeling this has something to do with parameters, which I have no clue how to use, so I would be grateful if this can be explained indepth including all the neccessary recordsets and server behaviours I would need for the page. I have linked the login redirect page to this admin homepage so in addition I just need to know all the php the admin homepage needs to function.

Many Thanks in advance

Sign in to reply to this post

Jason ByrnesWebAssist

On the admin home page create a recordset that queries the UserLevel table. using simple view, set the filtering options to use the UserLevelID column equal to, In the variable type Dropdown list, select session variable, then type the name of the session variable crated on login that contains the UserLevelID.

next, use the Set Session Value server behavior.


In the Server Behaviors list, click the plus button and select WA Cookies -> Set Session Value. Set the trigger to the recordset not being empty. set the name to something that makes sense for you. for the value, click the lightning bolt and select the UserLevelName column from the recordset.

Sign in to reply to this post

Douglas Fox

'Bind' Session Variable

More Newbie questions!!! Any help is really appreciated. :) This is basically a problem I need to solve too.

I can see how you created the session variables, but how do you 'bind' them to the user pages?

Really what I would love to do is put the code in the template so that all my pages will get the same message (i.e. "Welcome John Doe"). I just can't figure out how to reference the session variable within the HTML section of the page.

Also, how would I go about hiding the "Welcome John Doe" if the user wasn't logged in? Am I able to pick up on session variables in the CSS file somehow?????

Doug Fox
--------------
SA Newbie
--------------

Sign in to reply to this post

Jason ByrnesWebAssist

The session variables are available on the Bindings panel. To open the bindings panel, go to Window Bindings.

In the bindings panel, expand the session collection, select the binding you want and dragt it to the page where you want it to display.

To hide the binding if the user is not loged in, select the code in design view, then on the server behaviors panel, click the plus button and select SecurityAssist -> Show Region. form the list of rules select the Logged in rule so the binding will only show if the user is logged in.

Sign in to reply to this post

Douglas Fox

can it be done on Dreamweaver templates?

Is it possible to put the binding and the "Show Region" within a Dreamweaver template?

Or do I have to add an editable region (to locate it properly on each page) and go to each page and perform these steps?

Thanks for your help.

Doug

Sign in to reply to this post

Douglas Fox

Completed the template change

Sorry... I answered my own question. I was able to put the code in using SA in a test page and transfer that code to the template. Now it seems to be working well. Thanks.

Doug

Sign in to reply to this post

jenkolaka19379118

Hi Jason,

Am I supposed to bind the UserLevelName to the page from the recordset or the newly created session variable created using cookies toolkit? I couldn't get is to work when I binded the newly created session variable.

Sign in to reply to this post

Jason ByrnesWebAssist

The recordset to look up the UserLevelName should be on the page that the login page redirects to.


The set session value behvavior is on the same page, make sure it is after the recordset.


you xcan then use the session variable to display the UserLevelName on any page.

If you are still having trouble, send a copy of the login page and the page you have the recordset on.

Sign in to reply to this post

jenkolaka19379118

Thanks so much Jason,

The problem was exactly as you described. The set session behaviour was above the recordset, causing the session not to display on the page. Once I moved the recordset code above the session code, it works perfectly.

Many Thanks Again

Sign in to reply to this post

Jason ByrnesWebAssist

Great, glad to hear it's working.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...