Gossamer Forum
Home : Products : DBMan : Installation :

Help to setup permission

Quote Reply
Help to setup permission
I want to allow everybody view/add/register, and registered user can modify/delete their record. I tried to change permission many ways but it never work like I wanted. Can anyone help me on this? By the way, what's the link for people to register? This is my current setting:

$auth_no_authentication = 0;
$auth_time = 21600;
$auth_logging = 0;
$auth_allow_default = 1;
@auth_default_permissions = (1,1,0,0,0);
$auth_signup = 0;
@auth_signup_permissions = (1,1,0,0,0);
$auth_modify_own = (1,1,1,0);
$auth_view_own = 1;

Thanks for any help.
Quote Reply
Re: Help to setup permission In reply to
I'm no DBMan expert but...

If you want people to only delete their own record, you'll have to force them to register first. Otherwise, all the records will be 'owned' by the default user, and nobody except admins will be able to delete -unless you let anybody delete any record.
Change
@auth_default_permissions = (1,0,0,0,0);
$auth_signup=1;
@auth_signup_permissions = (1,1,1,1,0);
$auth_modify_own=1;
and
$auth_view_own=1;
(why stop registered people from viewing all records when you have default user access to view all records?)

Hope this helps
Quote Reply
Re: Help to setup permission In reply to
obelisk is right, except that it should be

$auth_view_own = 0;

Otherwise default users won't be able to view any records at all and registered users will only be able to view their own.

I did give someone a mod in the other DBMan forum that would allow users to add a record and register for a userid and password at the same time. I haven't heard back on how it worked, yet, though.



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






Quote Reply
Re: Help to setup permission In reply to
I just add your mods and it's perfect as I wanted. Thanks for the mods JPDeni. You're the man.
Quote Reply
Re: Help to setup permission In reply to
Hi JPDeni,

I also tried to get the mod working. But I wasn't that succesfull.

I use your relational mod for linking a user database and a item database. I also have the userfriendly html mod. And the part that at the loginscreen there is a link to sign up. I do not use the secure password lookup mod.

To get your mod: add a record at the time of signup -- one record per user working, I went through your paper step by step. I did something that stood otherwise in your text. I didn't copy the html_record but the html_record_form. I assumed this was a type error, because I couldn't find a place to put in the password input in a copy of html_record. But unfortunately it didn't work.

I can get to the login screen, but the link to sign up is gone (it was there before). Stands after a authorazation if.
When I tried to get directly to the signup page by the url:
http://www.XXXXXX.com/cgi-bin/dbman/db_user.cgi?db=user&uid=default&add_form=1

The part to enter the UserId was not visible. It stands in the script after an authorization if:
if ($per_admin) {
I was able to get it visible but it's not going to win a beautycontest.

Also the password input field was not visible. I think this is the same problem with the authorization. By changing some authorizations I could get it visible and sign up as a new user. I get the next message at the main menu:

This database has been set up so any user can view any other users information, but you can only modify
and delete your own records. If you have admin access, you can of course do anything you like.

But there are no links in the footer to modify or delete.

Another change I made during trying getting it work was:
I changed in the sub html_add_form of user_html.pl the statement:
&html_record_form (&get_defaults);
to
&html_add_record_form (&get_defaults);

I don't know anymore, why i did it. But it seemed good.


I'm getting crazy like a dog. I don't understand a bit of it anymore.
Is it possible that this mod isn't working in combination with other mod's. Or I'm I doing something completely wrong?? Please could you help. Or someone else?

Jan


Quote Reply
Re: Help to setup permission In reply to
I'll need to see your html.pl file.

Please copy it to a web-accessible directory (one where you would place .html files) and rename it to html_pl.txt. Then come back here and tell me where I can find it.


JPD
Quote Reply
Re: Help to setup permission In reply to
Hi JPDeni,

The files can be found at:

http://www.vogelarena.com/user_html_pl.txt
http://www.vogelarena.com/user_cfg.txt
http://www.vogelarena.com/db_user_cgi.txt

I'm very sorry, but I already had made some changes to get a nice lay-out. So it's possible that there is a lot of junk between the line's. Also have I translated some terms to the Dutch language. If you think it's this way impossible to find a sollution, I will try to get back to a backup, and try to implement the mod again.

Thanx,
Jan.

Quote Reply
Re: Help to setup permission In reply to
If you want the userid field to be visible for everyone, change

Code:

|;
if ($per_admin) {
print qq|
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="150"><$font_color>UserID:</FONT></TD>
<TD VALIGN="TOP" WIDTH="475"> <INPUT TYPE="TEXT" NAME="UserID" SIZE="20" VALUE="$rec{'UserID'}" MAXLENGTH="255"></TD></TR>
|;

#### was before -> <input type="hidden" NAME="UserID" VALUE="$rec{'UserID'}">
#### I changed it because otherwise the UserId field isn't visible.

}
else {
print qq|

<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="150"><$font_color>UserID:</FONT></TD>
<TD VALIGN="TOP" WIDTH="475"> <INPUT TYPE="TEXT" NAME="UserID" SIZE="20" VALUE="$rec{'UserID'}" MAXLENGTH="255"></TD></TR>


|;
}


print qq|
to

Code:

<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="150"><$font_color>UserID:</FONT></TD>
<TD VALIGN="TOP" WIDTH="475"> <INPUT TYPE="TEXT" NAME="UserID" SIZE="20" VALUE="$rec{'UserID'}" MAXLENGTH="255"></TD></TR>
The reason you don't get the signup link on the login form is because you have $auth_signup = 0;. And this is the way you want it, if you are using "Option 4" from the "Limit records a user can add" mod. You don't want users to go to the regular signup form.

However, you can send users to the add form to sign up by changing (in sub html_login and sub html_login_failure)

Code:

if ($auth_signup) {
print qq|You can sign up for an account online right <a href="$db_script_url?db=$db_setup&signup_form=1">here</a>.|;
}
to

Code:

print qq|You can sign up for an account online right
<a href="$db_script_url?db=$db_setup&uid=default&add_form=1">here</a>.
|;
I guess I forgot to add that to the mod. I'll get it done later.




JPD
Quote Reply
Re: Help to setup permission In reply to
Hi JPDeni,

Thanx for helping me out again. This parts works now.

Another part isn't working yet. As I told you before I'm using your relational mod.

When I log in as an user, and view my personal (user) record, The records of the item database are not visible. (worked before allright)

When I log in as administrator and search for the record of that user, then I can see the records of the item database. So something is still wrong.

My newest versions of the files can be found at:
http://www.vogelarena.com/db_user_cgi.txt
http://www.vogelarena.com/user_cfg.txt
http://www.vogelarena.com/user_html_pl.txt

I have another coherent problem with the display of the items with a search in the user database. When I, as administrator, let the program make a list of all users ("List All"), Only the first diplayed user does have the items displayed. All the other users in the list have the same items, as the first one. (This problem is not that big, I won't need it for my users, but as an administrator it would be nice if it worked right.)

Could you help me out again, or someone else?
Jan.


Quote Reply
Re: Help to setup permission In reply to
I don't know what the problem would be. I think the only way for me to figure it out would be to have admin access to your database. You can send me the URL and username/password by private message if you'd like.


JPD