Gossamer Forum
Home : Products : DBMan : Customization :

different fields...different subs

Quote Reply
different fields...different subs
hi jb....i am having a hard time figuring out how to create different looking add, modify, and search screens. i read a post of yours concerning hiding certain fields in the search screen by copying the html_record_form and renaming it to html_search_form, and then deleting the unwanted fields. that worked great, and now i have a search page that has only the fields i wanted to show up. when the search is run, the display page still shows all the records, which is exactly what i wanted....thank you very much for the post! but the problem i am having now is that when i go to an add, mod, or delete page, i get errors in the fields saying that it couldnt build the field because the fields arent defined. i have not modified any of these subs, and they still have the &html_record_form line in them. am i missing something? if you need to take a look at my code, let me know and i'll be happy to post it.

also....i have set this up so that anyone can view any records....but only the admin(me), and one other user can add, delete, or modify. when the link is clicked on the referring page, the main menu opens, allowing only viewing options...which is fine....but i can't seem to get the full menu with all the permissions to pop up anymore! no login screen or anything. here r my settings:

# 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 = 1;

# 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,0,0,0,0);

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

# 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 = -1;

any help would be greatly appreciated!!! thanx in advance.

chuck
Quote Reply
Re: different fields...different subs In reply to
sorry jp! i just read my message and realized i typed jb...lol....my apologies!
Quote Reply
Re: different fields...different subs In reply to
It might be a good idea for me to see your html.pl file. If you can copy it to a web-accessible directory -- one where you would place html files -- and rename it to html_pl.txt, that would be great. Then come back and let me know where I can find it and I'll take a look at it.

Regarding your login difficulties -- what URL are you using to access the database? Make sure that, if you want to log in, you don't use a URL that includes &uid=default.

Your permissions look fine.

------------------
JPD


PS. No problem about the typo! Smile




[This message has been edited by JPDeni (edited July 13, 1999).]
Quote Reply
Re: different fields...different subs In reply to
thanx for the quick reply jp! ok here is the address for the html file:
htpp://www.cantonconnection.com/html_pl.txt

also the address i'm using to access the database is:
http://www.cantonconnection.com/cgi-bin/dbman/db.cgi

i do have a different database that i am using called boats....there was a time when i could access the full menu with all the permissions, but not anymore. even when i could get to that page, it never asked me for a login....it just gave me full priviledges. anyway....one problem at a time i guess! hehe! let me know if there are changes that need to be made to my html file. thanx again!

chuck
Quote Reply
Re: different fields...different subs In reply to
Regarding authentication -- do you know what kind of software your server is using? It could be using something like Xitami which sends a server authentication automatically.

Try this. In auth.pl, add a # before the following line, so it looks like this:

Code:
# my ($server_auth) = $ENV{'REMOTE_USER'} | | $ENV{'AUTH_USER'};

Further down, in sub auth_check_permissions, change the lines to:

Code:
# if ($ENV{'REMOTE_USER'} | | $ENV{'AUTH_USER'}) {
# $username = $ENV{'REMOTE_USER'} | | $ENV{'AUTH_USER'};
# }
# else {
($userid =~ /^([A-Za-z0-9]+)\.\d+$/) ? ($username = $1) : return (0,0,0,0,0);
# }

See if that works for you. If not, then go back and delete all the #s and we'll look for something else.

Are you saying that the select fields aren't being built in html_record_form? (Just being sure. Smile )

At this point I don't see it, especially if the the fields aren't being built, because they're being built in the search form. Which means you have defined them.

(I do want to compliment you on your neat script. Makes it a lot easier to figure out. Smile )

I'm gonna have to ponder this one for a bit.


------------------
JPD





Quote Reply
Re: different fields...different subs In reply to
hi again jp! i appreciate the compliment about the script, but it really isn't neat due to anything i have done....i just haven't got around to modifying it much yet...so it's pretty much out of the box...hehe.

anyway....i tried your suggestion but the main menu with view only permission is still coming up. like i said....there was a time when i was getting the login screen, but i'm not anymore for some reason. i'll take the #'s out again and see if i can find something i have missed. i haven't altered the auth.pl at all except for your suggestion.

regarding my server software....it is running NT with WebSitePro/2.3.10. is that what you needed to know?

what is happening with the forms.....
as you can see from the html file, i copied and modified the html_record_form and renamed it to html_search_form. the new search form is building the fields just as i want them...which is without 3 of the fields that are part of the complete record. and when you view the search results, all of the fields are showing up just as i want them to there as well. but i want all of the fields to show up on the add, modify, and delete forms as well. unfortunately what is happening is that when the add form pops up, it has the correct number of table cells to represent all of the fields, but instead of printing them, it has an error message in each of the cells saying that it was unable to build because the field was undefined. i don't understand how this could be because the add, modify, and delete forms are all supposed to be utilizing the sub html_record_form as the form template, and that sub runs fine as far as displaying the records after the search goes. so i am really confused. i've been staring at these files for so long my eyes are bugging out! LOL! but i just can't see what i have done wrong. thanx again!
Quote Reply
Re: different fields...different subs In reply to
Yes, that is what I was asking concerning server software. I was thinking about Xitami, because I know there's a problem with that.

You don't really have to take out the # that you put in. It doesn't matter either way, unless you are going to be using .htaccess to have users enter the database.

Quote:
forms are all supposed to be utilizing the sub html_record_form as the form template, and that sub runs fine as far as displaying the records after the search goes.

Not exactly. The display uses html_record, not html_record_form.

How are you even able to access the add form?



------------------
JPD

BTW, I tried to access your "boats" database, and I got the login form.





[This message has been edited by JPDeni (edited July 13, 1999).]
Quote Reply
Re: different fields...different subs In reply to
oh yes you right....it is the html_record and not the form sub. so i guess i must have an error in the html_record_form sub then huh? i'll take another look at it.

i havent been able to access the add form since last nite because i couldnt get to the main menu with all the permission...but that is what was happening last nite.

you got to the login?! wow! what was the address you used? maybe i'm using an incorrect one or something? i was using:
http://www.cantonconnection.com/cgi-bin/dbman/db.cgi?db=boats

is that correct?

thanx again! i'm gonna take another look at the record_form.
Quote Reply
Re: different fields...different subs In reply to
wow jp....this is weird....i just re-entered that url and now im getting the login window again! lol. but now the problem is it isnt taking any of my passwords. i'll try deleting them all and resetting them.
Quote Reply
Re: different fields...different subs In reply to
jp.....i don't know what happened....but now everything is working fine! weird! i have to apologize for taking up your time! i do have a new problem now though. if i set $auth_no_authorization to "1" then i get the main menu with view permission only. that is how i want it to appear to anyone that is going to search the database. but now what url do i use to get to the login screen again so that admin can change records? if i set no_authorization to "0" it gives me the login page, but i dont want my visitors that are just there to view the db to have to log in. how do i set this up? or can i?

thanx again for all your help! you're the greatest!

chuck
Quote Reply
Re: different fields...different subs In reply to
Set $auth_no_authentication=0.

Have your default users access the database by going to

http://www.cantonconnection.com/cgi-bin/dbman/db.cgi?db=boats&uid=default

When you access the database, go to
http://www.cantonconnection.com/cgi-bin/dbman/db.cgi?db=boats


------------------
JPD





Quote Reply
Re: different fields...different subs In reply to
thank ya thank ya thank ya!

chuck