May 9, 2007
How To Program /

Helmut, In my template at you set up a function Login. How do I learn more about this function? Specifically, I'm interested to know if somebody is logged in or not, and how to know who they are logged in as. Then I can create functionality accordingly, to ask them to log in or to show their picture, for example.

I'm also curious, where are the functions stored, and how might I write one and/or call one. Thank you. AndriusKulikauskas April 25, 2007 14:32 CET

This would be useful because I want to customize the functionality to let people see whether they are already logged in or whether they should log in or whether their preferences are simply set. Also, I would like to make a list of the people who have logged in most recently, if that is possible, too. AndriusKulikauskas May 2, 2007 10:32 CET

Helmut, here's another reason that I'd like to know that a person is logged in and who they are. I will be creating a function so that on any page they can recommend it. This will add their name to the field ThisPageIsRecommendedBy. That will serve as a kind of voting. So how can I know if they are logged in? and what their name is? AndriusKulikauskas May 7, 2007 9:16 CET

Andrius, currently there is no log for efficiently answering these questions. One would have to program that. -- HelmutLeitner May 7, 2007 10:16 CET

Hi Helmut, I could possibly program a log. But even without a log, the function Login is working and showing the name of the person logged in. Where is that function defined? And how might my code read it's output? AndriusKulikauskas May 7, 2007 11:52 CET

Andrius, I'm not sure I understand you. ActionLogin shows the login. ActionFormLogin answers the user's input into that form. $UserName stores the user name in the specific executable process and may show it to the client, but there is no way to access this data from outside, except passing it through some mechanism like a log file. -- HelmutLeitner May 8, 2007 6:56 CET

Helmut, in the template we're using there is a reference to {Insert:function.Login} that appears at as the output AndriusKulikauskas logout (AndriusKulikauskas ) in a small font when I am logged in. Where is that function stored? And how can its output be read programatically? AndriusKulikauskas May 9, 2007 15:56 CET

The function is part of the script and the data is transiently produced by reading the Cookie from the browser request, checking this (providing additional information about the user) and producing the output page. All this happens in the CGI call interface, doesn't produce data that can be read directly. -- HelmutLeitner May 9, 2007 16:46 CET

Helmut, Thank you for explaining. AndriusKulikauskas May 9, 2007 21:02 CET