Gossamer Forum
Home : Products : DBMan : Customization :

How to restrict specific features to LOGGED IN Users

Quote Reply
How to restrict specific features to LOGGED IN Users
Hi, this is my first post in here in quite some time and I hope that this is the correct forum and that someone can assist me.



What I'm trying to do is limit features such as ADD, MODIFY, and DELETE to users who are logged in. Currently, you can go to the website and view with no problems. My other issue is that I'm using SSI calls that lists categories on the left hand side of the screen. Anyways, the categories can be clicked to view and I am using the default uid to do this. Should I be doing this some other way? Is there a variable I should be using that DBMAN knows the user is logged in/out?? I don't want the user to have to log in each time they want to add something and the way it is set-up now if I'm logged in and click on one of the categories (using the default uid) in effect I am being logged out.



Thanks in advance!!
Quote Reply
Re: [now@cox.net] How to restrict specific features to LOGGED IN Users In reply to
You can limit who can see the options to view, add, modify or delete with your permission settings.

And then defining the permissions within your sub html_footer such as:

print qq!| <A HREF="$db_script_link_url&add_form=1">Add Record</A> ! if ($per_add);

As far as using a side menu within your DBMan display the easiest method (which I use extensively) is by using a sub called sub include which follows:

sub include {
# --------------------------------------------------------
# This is text to include. Use like an SSI.

my $file = shift;
open (FILE, "<$file") or die "Can't open $file ($!)";
print <FILE>;
close FILE;
}
## Then add this line wherever you want file included # |; &include ("dbside.txt"); print qq| #

If this doesn't work with other than default users you may need to add the actual coding into your html.pl file or if you use a format.pl file (easier to make changes).

You could add the coding within your sub html_page_top or sub html_page_bottom depending on how you have your side menu setup to display.

For you category list instead of using: &uid=default

use: &uid=$db_uid

This will then keep people logged in as they navigate using your side menu.

Hope this helps and gives you some ideas.

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/
Quote Reply
Re: [LoisC] How to restrict specific features to LOGGED IN Users In reply to
Well, thank you for the information. The bad news is - I knew most of what you said but I do appreciate the information. However, once I started playing with the last item you mentioned (the uid=$db_uid) I realized that what I want may not be possible. My problem is, I create a 'framed' page (header.shtml, menu.shtml, and main.shtml). The menu.shtml uses an include statement to pull in the categories. When you fiirst enter the page, the uid=default. When you login, it doesn't refresh the menu.shtml file. SO, when the logged-in user clicks on a category in the menu.shtml file - the uid now goes back to default.



Originally I was going to program the html.pl file to do everything but then decided to use external html files to make programming easier (so I thought). Also, by having external files I found it easier to use include statements.



In any event, if you have ANYTHING to help I would definately appreciate it!!