Gossamer Forum
Home : Products : DBMan : Installation :

Default users must not view admin fields

Quote Reply
Default users must not view admin fields
I configured an admin-only field (userid), however when I log on as default user and perform a serch I get access to the userid field which wasn't supposed to appear... what can I do?... thanks

I defined userid as:
usuerid => [11, 'alpha', -2, 8, 0, '', ''],
and the permissions:
$auth_no_authentication = 0;
$auth_logging = 1;
$auth_allow_default = 1;
$auth_view_own = 0;
$auth_user_field = -1;


Quote Reply
Re: Default users must not view admin fields In reply to
If you are creating your own forms, you can setup your userid field like the following which will hide it from all but admin.

if ($per_admin) {
print qq|
<TR><TD><$font>UserID:</FONT></TD><TD><INPUT TYPE="TEXT" NAME="UserID" SIZE="10" VALUE="$rec{'UserID'}" MAXLENGTH="10"> &nbsp $rec{'UserID'}</TD></TR>
|;
}
else {
print qq|
<TR><TD colspan=2> <input type="hidden" NAME="UserID" VALUE="$rec{'UserID'}"></TD></TR> |;
}
print qq|


you might also want to check the spelling as you first stated the field was userid, but your .cfg shows usuerid.

If you are using autogenerate to make your forms, the spelling might be the problem?

Hope this helps :)

Quote Reply
Re: Default users must not view admin fields In reply to
Thanks... Your code will help me in the near future when I design my own forms, but for now I am using autogenerated forms. I checked my spelling in the .cfg and its okay. Then, why are the admin-only fields still showing to default users?

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

Quote Reply
Re: Default users must not view admin fields In reply to
The only thing I can think of that might be causing problems is this line:

$auth_user_field = -1;

There are no -1 fields, as fields start with 0 and then are numbered consecutively.

I believe your user field is 11.

Try changing this:

$auth_user_field = 11;

Hope this helps Smile

Quote Reply
Re: Default users must not view admin fields In reply to
In Reply To:
There are no -1 fields, as fields start with 0 and then are numbered consecutively.
That is 100% incorrect. Wink

Read the documentation that comes with the out-of-the box DBMAN:

Code:

# 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.


Regards,


Eliot Lee
Quote Reply
Post deleted by JPDeni In reply to
Quote Reply
Re: Default users must not view admin fields In reply to
Emilio:

Please save a copy of your .cfg file on your server and then provide the URL so that we can take a look and see if we can spot something which can be causing your problems.

It's hard to guess what could be happening without seeing your script or your visiting your site.