Gossamer Forum
Home : Products : DBMan : Installation :

Diffrent levels of authority

Quote Reply
Diffrent levels of authority
Hey Experts!,

I have a desperate need for something. It seems that when I try to install a .htaccess and .htpasswd so I can double verify, etc... LONG STORY.

It will go to default authority or what ever.

And I can't have that.

So what I need to do, is have it so I can have three levels of authority:

The first level anyone can login, and view everything but not add or delete/modify stuff. Only view but, they can't view a certain text area. I know how to make it so the admin can only view it but hang on.

The second level will allow our clients to view/search/modify/add/delete their own database entries.. But the catch is, they can't have admin access and they need to see the hidden field that people using the first level of authority can't view.

And of course the third level is admin, which can do all things like normal.

I need some supper help with this please.

Thanks

David

Quote Reply
Re: Diffrent levels of authority In reply to
Sounds similar to the way dbman comes set-up 'out of the box'. Check the FAQ or JPD's Configurator to set up your permissions - you'll need to approve new members (so you can specify permissions - I'm guessing) I'm sure there are several MOD's for this... you'll have to decide if you want everyone to log in (with 'guests' using a standard login/password like "guest & guest", or only require a log in when members want to change/delete/view secret area.

As far as the text area... in sub html_record and sub html_record_form (in html.pl) you'll need a "section" like this:
if ($per_mod) {print qq| put your secret text stuff or db fields here |;}

This way, anyone with modify permissions (members & admin) can see the text area, but not guests.

If you want a way to manage your .htaccess I've used Account Manager Lite which can be found at: http://cgi.elitehost.com

Hope this at least gets you started -Mike.
No bounce. No play.

Quote Reply
Re: Diffrent levels of authority In reply to
How do I add the

if ($per_mod) {print qq| put your secret text stuff or db fields here |;}

I mean, do I just add it where the notes field is? Like <TD valign="middle" WIDTH="400"> <TEXTAREA NAME="Notes" ROWS="5" COLS="40" WRAP="VIRTUAL" MAXLENGTH="10000">$rec{'Notes'}</TEXTAREA></TD></TR>

is where my notes field is at. Do I make it:

<TD valign="middle" WIDTH="400"> <TEXTAREA NAME="Notes" ROWS="5" COLS="40" WRAP="VIRTUAL" MAXLENGTH="10000">if ($per_mod) {print qq| $rec{'Notes'}</TEXTAREA> |;}</TD></TR>

Thanks,
David

Quote Reply
Re: Diffrent levels of authority In reply to
Ummm ... go to JPdeni's site first. check out the standard setup options first. I think what you're asking for can be done basically with out MAJOR modifications. I have a smiliar setup going.

There is an extra-permission-level mod but it's major work to install not difficult just it's probably one of the most involved to install and long. But I don't think this is really not you're looking for, there's other ways to do this too.

check here:
You may want to check our JPDeni's excellent DBMan tutorial.
http://jpdeni.com/dbman

And LoisC's excellent resource
Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/


Thanks to them both.



good luck

**************************************
on the pages in between ...
Quote Reply
Re: Diffrent levels of authority In reply to
Hey Qooq,

I have a question... I have installed the Add Permisions mod... I want to know how do I config it so, it will allow members with the extra permison enabled to view the notes field too? Or is that like a member/admin mod? So the user will still see only their content but, be able to see the same stuff as the admin?

Thanks,

David

Quote Reply
Re: Diffrent levels of authority In reply to
In your html_record or sub html_record_long you when you list the field for viewing you can set them up
so that only those with a certain permission can view them.
Let's say you new permission is called "mem"


if ($per_mem) {
print qq|
<LIST OF FIELDS> |;
}
else {
print qq|
<LIST OF FIELDS> |;
}

if ($per_admin) { print qq|

<LIST OF FIELDS> |;
}

In the FAQ noted below in the section "Viewing / Format" you will find various thread references for conditional displaying of fields.


Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: Diffrent levels of authority In reply to
Hey,

I found something at Unoffical DBMan FAQ:

Want only the owner of the record and those with admin permissions to see a field(s)

Use:
|;
if (($db_userid eq $rec{'UserID'}) || ($per_admin)) {
print qq| [The record information] |;
}
print qq|

Um.. Where am I suppose to put the field at? Where it says [The record information]? Or in between the [ and the ]?

Also,
(
if ($per_mem) {
print qq|
<LIST OF FIELDS> |;
}
else {
print qq|
<LIST OF FIELDS> |;
}

if ($per_admin) { print qq|

<LIST OF FIELDS> |;
}
)
In your code you mention <LIST OF FIELDS>. What do you mean? And When I try to make do the permiosions thing, and I have it set to user to see only their posts when I add something using the new permision, it doesn't show anything... But it adds it.... Only the admin can see it... And when it comes up with success, nothing shows just table cells and when I try searching within that username it doesn't find anything at ALL.. WHY?

Nothing is working, and I am getting stressed because it is not working. Please help...

Go to http://www.special-guests.com/show/ that is where all of the files are at.

Thanks

David

Quote Reply
Re: Diffrent levels of authority In reply to
LoisC who answered you is the owner of the FAQ site :-)

something like this:

print " $Dealer " if ($per_mem);
print " $View " if ($per_view);

you can pass variables or menu links and such the above is for my menu links. It's nice since I have a price for regualr folks and a price for dealers. Obviously, don't want the regular folks see what kind of price a dealer can buy at, I'd be getting complaints since discounts run up to 45% :-)

well, the site is actually my friend's. :-)

good luck


**************************************
on the pages in between ...
Quote Reply
Re: Diffrent levels of authority In reply to
I don't understand even though I do know some CGI and understand it well, but not fully.... That is like me talking to a dog... I don't understand. lol

The url I gave you to the scripts, do you think you could tell me where to put that piece of code? And how to insert it? Also, when I post a thing to the database, why won't it show what I've posted in the success page, all the fields are blank and when I try to view it even though I have only own view records, it comes up with Nothing Found. Why? But the admin see's it and it's there/

Thanks

David

Quote Reply
Re: Diffrent levels of authority In reply to
In Reply To:
How do I add the

if ($per_mod) {print qq| put your secret text stuff or db fields here |;}

I mean, do I just add it where the notes field is? Like <TD valign="middle" WIDTH="400"> <TEXTAREA NAME="Notes" ROWS="5" COLS="40" WRAP="VIRTUAL" MAXLENGTH="10000">$rec{'Notes'}</TEXTAREA></TD></TR>

is where my notes field is at. Do I make it:

<TD valign="middle" WIDTH="400"> <TEXTAREA NAME="Notes" ROWS="5" COLS="40" WRAP="VIRTUAL" MAXLENGTH="10000">if ($per_mod) {print qq| $rec{'Notes'}</TEXTAREA> |;}</TD></TR>
Yes! But here is what I'd do...

|; #stops the printing
if ($per_mod) { #only if they have modify rights
print qq| #start printing again
<TD valign="middle" WIDTH="400"> <TEXTAREA NAME="Notes" ROWS="5" COLS="40" WRAP="VIRTUAL" MAXLENGTH="10000">$rec{'Notes'}</TEXTAREA> </TD></TR>
|; #stops printing for those w/ modify rights
}
else #do like above, but print the below stuff if they don't have modify rights
{
print qq|
<TD valign="middle" WIDTH="400"> Something other than "Notes", like an empty text-area box, or message of the day or something</TD></TR>
|;
}
print qq| #finishes printing the rest of your table/page


This way those w/ modify permissions see a text-area with notes, those without see whatever you have in the bold part, either another text-area box or whatever you want.

Hope this helps...

Ps: I highly recommend "Perl for Dummies" - it'll explain all of the above and more.

Quote Reply
Re: Diffrent levels of authority In reply to
I would like to tan you all for your wonderful help your have provided me. Unfortunetly, I am unable to continue with this database due to, to many complications.

So I must hire some one to do this for me.

Also, I am willing to take bids, if you would do this.

Thanks

David

Quote Reply
Re: Diffrent levels of authority In reply to
webwizzz:

I'll give you my email via private message and I will help you get your database up and running, If you haven't already had any offers.

There will be no charge for my help.

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/