Gossamer Forum
Home : Products : DBMan : Installation :

Record Added - but nothing shown

Quote Reply
Record Added - but nothing shown
Fantastic script as ever. Everything was working fine.
I added two mods:
1) to hotlink urls
2) to validate records (JPDeni)

Both mods work fine, with one exception:

When a User adds a record, the "Record Added" screen appears but the fields are blank (the field names appear).
The same is true of the email that admin receives notifying that a new record has been added.

When Admin adds a record, the Record Added screen appears normally, ie the fields are not blank and the email is not blank.

In both cases, the new record is available for Admin to validate and then appears as normal.

One other question:
Is it possible to suppress the display of the Validated radio buttons on the User's Add a Record screen (not on Admin's)?

Many thanks.

PS: I've searched the forum but can find nothing on this.

Quote Reply
Re: Record Added - but nothing shown In reply to
I can think of two possible sources of your problem.

Both the displaying of a record after adding and the sending of the email to admin are based on a comman &get_record($in{$db_key}). For some reason, your record is not being "getted." Smile

One reason could be that you have a problem with your $db_key variable or the value for the record. However, I'm starting to think that isn't the case, since the record eventually shows up.

Do you have a userid field in your database? Do you have $auth_user_field set correctly in your .cfg file? I can be pretty sure that you have $auth_modify_own=1; set in your .cfg file. Right?

Regarding hiding the Validated radio buttons -- are you using the autogenerate feature or have you created your own form?


JPD
Quote Reply
Re: Record Added - but nothing shown In reply to
Very many thanks.

You were right that I had $auth_modify_own=1. I changed it to =0 (though I don't quite know if that's right) and it seems to work ok, including the email. I've listed the # Authorization Options below just in case I've done anything stupid. I want Users to be able to get a uid, Add, Delete and Modify there own records, but all additions and modifications (maybe deletions, not important) to be validated by Admin.

Q: Do you have a userid field in your database?
A: No.

Q: Regarding hiding the Validated radio buttons -- are you using the autogenerate feature?
A: Yes (and they are still showing)

PS: why doesn't changing
Validated => [14, 'alpha', 0, 3, 1, 'No', 'Yes|No'],
to
Validated => [14, 'alpha', -2, 3, 1, 'No', 'Yes|No'],
hide the Validation field for users? It does for the ID no.

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

# 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.tefl.net/teacher-training/db.htm";

###VALIDATE RECORD MOD
# Full path to sendmail on your system
$mailprog = "|/usr/sbin/sendmail -t -oeq";
# $mailprog = '/usr/sbin/sendmail';


# Fieldname that contains the email address of the user
$db_email_field = 'Email';

# Your email address
$admin_email = 'admin@tefl.net';

Thanks again for your help.


Quote Reply
Re: Record Added - but nothing shown In reply to
This explains your problem:

I had $auth_modify_own=1 and

Q: Do you have a userid field in your database?
A: No.


There is no way to tell who "owns" a record unless you have a userid field. It's good that you turned it off.

Regarding the radio buttons, setting the field length to -2 works only for a text field. However, I wrote a mod that will allow you to have admin-only radio buttons, checkboxes, select fields and textareas. You can pick up the mod at http://www.jpdeni.com/...ods/autogenerate.txt.



JPD
Quote Reply
Thanks In reply to
Very many thanks. I'll use the mod.