Gossamer Forum
Home : Products : DBMan : Customization :

Add Permission Mod question

Quote Reply
Add Permission Mod question
How would I use this new mod, if for example I want this scenario?

SIGNUP: choose either STUDENT or INSTRUCTOR

IF they choose STUDENT, THEY SINGUP with USERNAME and EMAIL address, login and only VIEW records as a MEMBER.

If NEW USER chooses INSTRUCTOR, THEY signup, then login and then GOTO ADD record.

Is this possible? I have an idea but not sure really how to approach this.....(Client wants STUDENT PERSONAL INFO on record)

Thanks Theri


Quote Reply
Re: Add Permission Mod question In reply to
I'm not sure.

The information they would enter would be the same, right? If not, you would need to have two different signup forms.

If they are the same, you could add radio buttons to the signup form to choose whether they were a student or an instructor. For our purposes, we'll call it status and the options are student and instructor.

In your .cfg file, set up another array --

@auth_student_permissions = (1,0,0,0,0);

Assign your instructor permissions to the @auth_signup_permissions array.

In sub signup (db.cgi file), just after the first line (the one that starts with "my"), add

if ($in{'status'} eq "student") { @auth_signup_permissions = @auth_student_permissions; }

You don't need the Add Permission mod.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Add Permission Mod question In reply to
Hi Carol.

The student would only enter their name, email address and maybe city, state.....not a whole lot.

The teachers, are going to have to enter a lot more info....bio, certification etc....

Thats the only difference.

Would that code work then?

Thanks
Theri



I forgot to add, that I have successfully just installed the Add Permission Mod (But still have my existing backups:)

Quote Reply
Re: Add Permission Mod question In reply to
Where do you want to store the student information? Do you want to add it to the .pass file? (Bad idea if it's anything more than the email address.) Or do you want to have separate databases for students and instructors?

Maybe I should ask what the database is for. (Did you tell me that already?) Does it hold instructor information or student information?

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Add Permission Mod question In reply to
Hehe, sorry.

Okay, the way the database was going to work was this:

Instructors signed up for an account. Then they would add their record (one record per instructor) After that, the visitors, or students would be able to find an instructor (golf or tennis instructor)by searching basically.
Well, the client wants to have the students or visitors, who wish to view/search for an instructor signup themselves and provide personal information.

So now I need a way to add the Student/Visitor personal info (not for public viewing) Name, Address, Phone, Email, etc....and allow them to view the records of the instructors, after logging in.

That's where I get messed up:(

Does that make anymore sense?



http://www.coastcottages.com/book/ will give you all my files to view if need be.
Quote Reply
Re: Add Permission Mod question In reply to
Your explanation helps a lot.

You are going to need to have two databases -- one for information about the instructors and one for information about students. You have too much detail required for the students to be able to put it all in the .pass file and there's no way you could put both sets of data into one database.

You will need the AddPermission mod. I'll have to think about this for a little while before I can give you a fuller answer, though.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Add Permission Mod question In reply to
Okay, well that makes sense. I'll tell you this much. I have gotten to Step 5 in the add permission mod and it's working. There is one thing I need to note, I have successfully installed the following mods:

Skip Home
Password Lookup
User Friendly
Add Permission
Disclaimer Mod

After that I forget now:)

I have not changed the default fields yet. I wanted to make sure everything worked before I got to that point. Right now I have it so when a user signs up, they enter username/email and then login (must agree to disclaimer first) then automatically with your help, they go straight to Add Record, and/or Modify Record Form. :)

I'll wait to hear from you:)
Thanks again JPD

Quote Reply
Re: Add Permission Mod question In reply to
I'm going to go over this again to make sure I have it exactly right. You tell me where I go wrong.

A student comes to the database. He signs up for a username and password. He fills out some personal information. After that he can view the information on the instructors, but cannot view the information about other students. Question: Can the student modify or delete his own information?

An instructor comes to the database. He signs up for a username and password. He fills out a more extensive form. He can then view information on all instructors, and modify (or delete?) his own.

An admin comes to the database. He can view all of the students' and instructors' information.

Have I got this right?

What I'm thinking is that you would have two databases -- one for students and one for instructors. The two databases would share the same auth directory and .pass file.

When a student signs up, he fills out all of his information on one screen -- adding a record to the database and signing up for a username and password all on the same form. The record is written to the student database. He is then immediately taken to the instructor database where he can view records.

The instructor would do the regular sign up and add procedure.

Does this sound like what you want?

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Add Permission Mod question In reply to
Again the question is posed, "Will you marry me?" Yes, that is exactly what I need.

The Student can modify their own record or delete (Whatever is easiest)
The instructor can modify, delete their own is fine also.
Whether the instructors can see other instructors info, is not a concern, just have to make sure student information is kept private.

You got it :)

Thanks
Theri


Quote Reply
Re: Add Permission Mod question In reply to
:)

Hmmmm. The plan I had won't work if students can modify or delete their records.

Lemme get back to you. My brain is really frazzled this week.

Just to let you know -- I'm working on stopping smoking and I'm using a prescription drug (Zyban) as part of it. I have to take the Zyban for a week before I stop. Right now it's making it pretty hard to even think. Maybe tomorrow will be better.



JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Add Permission Mod question In reply to
Tell you what, if not allowing a student to delete the file or modify it, simplifies things: that will work for me.

PS...I too am preparing to stop smoking. They are putting me on Wulbutrin (Similar to Zyban) I'll be thinking of you while you do it....I know it aint easy.


I just got back last night from surgery, so I dont know what I Have missed. Anything new I can implement on that multi level permission mod?

Thanks Theri


Quote Reply
Re: Add Permission Mod question In reply to
Hi Carol....Just wanted to know how things were going and if you had any success? I have been playing around with some info I got off of the FAQ site with multiple dbases using same .cgi file, but no luck yet.....if it helps any, make a suggestion on what the easiest way would be?

Anyways, 7 more days for me and I am nicotine free (I'm a bear when I quit) :)
You have a great weekend.

Theri


Quote Reply
Re: Add Permission Mod question In reply to
Just curious if you have had any luck with a.)the NIC FIT and b.) the permission issue?

Thanks
Theri