Gossamer Forum
Home : Products : DBMan : Customization :

Add permissions mod

Quote Reply
Add permissions mod
Got it all working (*cough, cough*). For my alumni database, right now, I've made all the current folks, members. What I'd like to do is have the guest/guest work for those who are simply looking to see if that certain alumni is in my database. My problem tho', with guest/guest, is the Add Record default gets in the way -- does no good to fill out the record, as "guest" only has view permission.
Suggestions?
JR

Quote Reply
Re: Add permissions mod In reply to
In Reply To:
the Add Record default gets in the way
I don't understand.


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Add permissions mod In reply to
My database is built, requiring new users to add a record b4 going any farther. Unfortunately, with that and this new mod, if I login with guest/guest I get the form requiring me to Add a Record before going any farther in the database to View
JR

Quote Reply
Re: Add permissions mod In reply to
I'm not sure if your calling this from your homepage, but if so you would have code something like this:

%rec = &get_record($db_userid);
if (!%rec) {
print "Location: $db_script_url?db=user&uid=$db_uid&add_form=1\n\n";
return;
}

I think if you use:

if ($per_add) {
%rec = &get_record($db_userid);
if (!%rec) {
print "Location: $db_script_url?db=user&uid=$db_uid&add_form=1\n\n";
return;
}
}

It will only go to the add form if the guest has permissions to add a record.

Hope this helps

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: Add permissions mod In reply to
Maybe I need to talk out what I "think" I'm trying to accomplish, ACK!

1. Now that my all-years reunion is over, and I can breathe again, I've finally come to the realization that managing reunion activities, the db and the 3 associated decade centered websites has become too taxing on my nerves, effort and resources. With this mod, I hope to ween my alumni into a fee based adventure.
2. What I've currently done with this mod is take the already registered alumni and made them "members" (I'm grandfathering them).
3. New "registrants" will still be required to Add a Record first b4 accessing the database, but then only have access to the short display. Once I receive the "member"ship fee, they'll get full access (less admin)
4. Beyond all this, anyone who simply wants to see if that certain alumni is in the database (guest), should be able to view the short display, without having to Add a Record or register first.

I think I just said what this mod offers, but wanted to throw my own words out, to make sure I'm on target.

Lois,

I haven't even tried yr suggestion yet -- wanted to make sure I'm on target with my comments above first.

Thx in advance.

JR

Quote Reply
Re: Add permissions mod In reply to
Try Lois's suggestion. If the "guest" login name does not have add permission, the user will not be sent to the "add" page.


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Add permissions mod In reply to
Thank you Lois and JPD, :-)

Note tho' for anyone else following this thread. For my db, I changed my sub html_home from
Code:
$in{$db_key} = $db_userid;
my ($status,@hits) = &query('view');
unless ($status eq 'ok') {
&html_add_form;
return;
}
to
Code:
if ($per_add) {
$in{$db_key} = $db_userid;
my ($status,@hits) = &query('view');
unless ($status eq 'ok') {
&html_add_form;
return;
}
}
which goes along with my http://gossamer-threads.com/...=25&Old=allposts discussion.

Further, 'til I can break the fee news to my alumni, I think I'll want to change my user (author) permission to 111110 ... right?

Lastly, check out my db (guest/guest) @ http://home.flash.net/...murgnam/dbman/db.cgi and tell me if I'm on the mark. Thx.

JR

Quote Reply
Re: Add permissions mod In reply to
I would do something about the "Change Password" link in the footer. Smile

I'm still not sure why you don't just give default users permission to view the database. That way they wouldn't have to log in to view.



JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Add permissions mod In reply to
OUCH! Good Point! Would I simply modify
Code:
print qq!| <A HREF="$db_script_link_url&change_password_form=1">Change Password</A> ! unless ($db_userid eq "default");
somehow?

Also, I hate to seem dumb, but
In Reply To:
give default users permission to view the database. That way they wouldn't have to log in to view.
means?

I guess I'm confusing "guest" with the "default" user, what am I missing?

JR

Quote Reply
Re: Add permissions mod In reply to
Since all of your registered users will have permission to add, you can change the line in the footer to

print qq!| <A HREF="$db_script_link_url&change_password_form=1">Change Password</A> ! if ($per_add);

To allow default users to view the database without having to log in, in your .cfg file, set

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

Use the following URL for default users to access the database:

http://home.flash.net/cgi-bin/cgiwrap/murgnam/dbman/db.cgi?db=default&uid=default

(It won't work now, because you are not allowing default users.)

If you do allow default users, you won't have to change the code for the Change Password link.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Add permissions mod In reply to
WOW!!! That little snipet not only solved this problem, but the other "default" problem I was having with the External Link to What's New Mod. WOW!!!

THANKS JPD!!

JR

Quote Reply
Re: Add permissions mod In reply to
Cool! Glad I could help, Joe.

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