This topic is locked

Password

5/6/2004 9:45:01 AM
ASPRunnerPro General questions
T
Tegwin author

Hello,

I have just downloaded ASPRunner and I have started using it. Firstly I would like to say how nice it is . WHat I would like to know is as follows
Is there a way to make the data page display with just the data and then if you need to Add/Edit etc then you need to log in. I have seen that you can create a login so that you can use the system, view/Add/Remove Edit etc... Basically what I want to do is to allow my users to view the data but only certain users to Add/Remove information.. Is this possible wioth your software

Sergey Kornilov admin 5/7/2004

Hi,
you can use Database-based security in ASPRunner and enable guest login. Guest users will have readonly access while logged users will have access to Edit/Delete/Add functionality.

T
Tegwin author 5/7/2004

Ok that sort of works, its not quite what I had in mind. Let me try and explain.
I have some data (a phone book) that I want everyone to see, which can be viewed by anyone so for example when I go to the page http://webserver/phone

it will display the information. Then to have a link say for Admin, and when that link is clicked then it will ask for login and then that user can Add/Edit etc. Is this possible ?

Sergey Kornilov admin 5/9/2004

Here is what you can do:
Modify ..._list.asp file (see my changes in bold)

<%

Session("UserID") = "Guest"

If Session("UserID")="" Then

Response.Redirect "login.asp"

End If

%>


After that you can point your users directly to http://webserver/phone/..._list.asp while admin users should go to http://webserver/phone/login.asp and login first.

T
Tegwin author 5/10/2004

Excellent.. Thanks I will give that a try

T
Tegwin author 5/10/2004

Ok I have tried this and it sort of works.
This is what my code looks like.
<%

Session("UserID") = "Guest"

If Session("UserID")="" Then

Response.Redirect Replace("phone_login.asp", "%20", " ")

End If

%>
So if I go to http://servername/AspRunner/phone_list.asp then it logs in as Guest without asking for password... ok so far.. but it still has the add new button and edit etc etc.. Now if I go to http://servername/AspRunner/phone_login.asp then it comes up with the login box, when I login as Admin, it still says logged in as guest and also has all the Add New etc. I am not so worried about when Admin logs in that it says logged in as Guest, but when the guests are logged in I dont want then to be able to add New

Sergey Kornilov admin 5/10/2004

Sorry, here is the correct one:

<%

Session("UserID") = "Guest"

Session("AccessLevel")=ACCESS_LEVEL_GUEST


If Session("UserID")="" Then

Response.Redirect "login.asp"

End If

%>

T
Tegwin author 5/10/2004

Thanks once again I have tried this and it does the opposite now. When I go to the ...list.asp page it logs in as guest no problem. However this time when I log in as Admin it remains as guest with no way to add new records.

Sergey Kornilov admin 5/10/2004

One more try (I hope it's the last one):

<%

If Session("UserID")="" Then

  Session("UserID") = "Guest"

  Session("AccessLevel")=ACCESS_LEVEL_GUEST


End If

%>

T
Tegwin author 5/11/2004

Ok it actually works now but only the first time.
basically once if I make the changes to the ...list.asp files BEFORE logging in as admin then it works ok. if i then go and log in as admin I get the addnew etc. Now If I log off and then log back on with ..list.asp it keeps admin logged in. If I close down the browser and re type ...list.asp it works and then lkogin as admin it works. So it looks like it holding onto the session id or something until you close down the browser and then it works.
Anyway I can live with it like this.. thanks for your help