Gossamer Forum
Home : Products : DBMan : Customization :

Default to View Only

Quote Reply
Default to View Only
I had used dbman for a project that never got implemented after it was developed, and now I've forgotten most of what I knew.

This problem seems like it would be so easy to fix, but I can't seem to wrap my mind around it. All I want to do is to have it default to a "view only" mode when someone goes to http://www.ebr.lib.la.us/cgi-bin/db.cgi? I want "view only" to be the default, and I don't want anyone to have to log in as "guest" or any other user. Now, if I get that to work, I don't know how to go from there to log in as admin.

I've tried multiple times manipulating the authentication settings to no avail. Help this once-again newbie, please! Crazy
Quote Reply
Re: [emyers] Default to View Only In reply to
Check out your default.cfg...

1. Set the authentication to "1" (which is backwards from all of the other settings so don't let it confuse you). This says "Yes, there is NO authentication" (kinda like "Yes we have no bannanas").

2. Set the permissions for the default user (allow default user to "1" and specify "view only" permission.).

3. Then create yourself a link in the footer (in html.pl under html_footer) like this:

<A HREF="$db_script_link_url&login_form=1">Log In</A>

or

<A HREF="$db_script_link_url&html_login_form=1">Log in</A>

Try either one and see if it works.

Good Luck!
.
Quote Reply
Re: [Watts] Default to View Only In reply to
Neither one of these links seems to work.

Thanks anyway :(
Quote Reply
Re: [emyers] Default to View Only In reply to
Check out (and play around with) these settings in default.cfg:

Code:
# Authorization Options
# --------------------------------------------------------
# No Authentication? (1 = "there is no authentication", 0 = "there is authentication")
# If you choose no authentication, then set the permissions of what
# people can do with: @auth_default_permissions below.
$auth_no_authentication = 0;

# The amount of time in seconds that user files are kept in the
# auth directory before the program removes them. 2-6 hours is
# probably a good value.
$auth_time = 21600; # 6 hours (in seconds)

# Enable (1) or disable (0) logging.
$auth_logging = 1;

# Allow a default user? This means you can specify a user via the URL
# and skip the logon process. Use this to allow people to search without
# logging on, but require log in if they want to add/modify/remove etc.
# (1 = "yes", 0 = "no")
$auth_allow_default = 0;

# Default permissions used if there is no authentication, or for a default
# user. (View, Add, Delete, Modify, Admin), 1 = enable, 0 = disable.
@auth_default_permissions = (1,1,1,1,0);

# Allow people to sign up for their own userid/passwords? They will
# recieve default permissions.
$auth_signup = 1;

# Permissions a new signup should get.
@auth_signup_permissions = (1,1,1,1,0);

# Registered users: can modify/delete _only_ own records. For this to make
# sense you should set default off or to 1,0,0,0.
$auth_modify_own = 0;

# Registered users: can view _only_ own records. For this to make sense
# you should turn off default permissions.
$auth_view_own = 0;

# Auth user field. This is the field position in the database used for storing
# the userid who owns the record. Set to -1 if not used.
$auth_user_field = 9;

# URL to send user if they chose log off. Leave blank and the script will return to
# the logon prompt (although this only makes sense if you are using authentication).
$auth_logoff = "http://www.gossamer-threads.com/scripts/dbman/";

I think the answer will lie in the default user settings... see what you can come up with. Also check out LoisC's Unofficial FAQ (see any of her posts for the URL) there are many questions and answers there regarding permissions and viewing. I almost never allow default users so I can't remember the URL but basically it's something like: http://www.yourdomain.com/cgi-bin/dbman/db.cgi?db=default&user=default (or maybe it's userid=default)
Quote Reply
Re: [Watts] Default to View Only In reply to
 
For the admin login within the footer try using:

print qq!| <A HREF="db.cgi?db=XXX">Log On</A> !;

For the link into the database try using:

http://www.ebr.lib.la.us/cgi-bin/db.cgi?db=XXX&uid=default

changing XXX to the name of your db file for both links.

In your cfg file set your permissions to:

$auth_no_authentication = 0;

$auth_allow_default = 1;
@auth_default_permissions = (1,0,0,0,0);

$auth_signup = 0;
@auth_signup_permissions = (1,0,0,0,0);

Hope this helps

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/