Gossamer Forum
Home : Products : DBMan : Discussions :

Why the form-length definition UserID is negatve?

Quote Reply
Why the form-length definition UserID is negatve?
I don't understand why the form-length in field_name definition is negative (-2)for the UserID?
Userid => [9, 'alpha', -2, 15, 0, '', ''],
Please Help

Quote Reply
Re: Why the form-length definition UserID is negatve? In reply to
I am not sure what you mean by negative.

Regards,

Eliot Lee

Quote Reply
Re: Why the form-length definition UserID is negatve? In reply to
From the ReadMe.txt file:


form-length= the length the form field should be. Set to 0 for select, checkbox
or radio buttons, and set to '40x3' to make a 40 col by 3 row
textarea box. Set to -1 for hidden fields. Set -2 for admin only fields.
This is useful for the Userid field which will let an admin edit/view it,
but other users can't see it.
All these fields only apply if you are
using auto_form_generation. You can alternatively, design your own form.


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Why the form-length definition UserID is negatve? In reply to
Hi, I downloaded DBMan yesterday and am starting at the beginning with no perl or database experience :-)
One step at a time and I am here: http://www.webtwists.com/cgi-bin/dbman/db.cgi
I am trying to hide the Userid field from viewers. I thought this thread had the answer, but I must be missing something. My default_cfg.txt is here: http://www.webtwists.com/lab/default_cfg.txt

Any help would be greatly appreciated.
Rehaber

Quote Reply
Re: Why the form-length definition UserID is negatve? In reply to
It looks like you have everything correct. Have you made any changes to sub build_html_record?

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Why the form-length definition UserID is negatve? In reply to
Thanks for the reply. From what I have read on your site it looks correct to me too, but still shows the Userid to the world. No changes to sub build_html_record. I have posted:
http://www.webtwists.com/lab/html_pl.txt and
http://www.webtwists.com/lab/db_cgi.txt

Thank you for the help,


Quote Reply
Re: Why the form-length definition UserID is negatve? In reply to
For some reason you are missing a line in sub build_html_record.

After

next if ($db_form_len{$field} == -1);

add

next if (($db_form_len{$field} == -2) and (!$per_admin));

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Why the form-length definition UserID is negatve? In reply to
Thanks much.
Your fix works great!
I check the zip file I downloaded and the line is missing in the original. Should someone be notified?



Quote Reply
Re: Why the form-length definition UserID is negatve? In reply to
Yes. I'll mention it to Alex. Thanks for letting me know. Smile

JPD
http://www.jpdeni.com/dbman/