Gossamer Forum
Home : Products : DBMan : Customization :

Can these be done?

(Page 1 of 2)
> >
Quote Reply
Can these be done?
I want to have 2 types of user that use my database.

Full Member : can view every thing.
Member : can view everything except Photo, Voice and Email address.

All member must enter their profile, and can only modify their own profile.

I have configure my database that it let Member view everything, And how can I let the user select they want to be Full Member or just Member?

here's what I've done.
http://www.it-g.com/htmlpl.txt
http://www.it-g.com/cgi-bin/friendsdb/db.cgi

Quote Reply
Re: Can these be done? In reply to
You're going to need to set up another permission in the password file. I'll see if I can get the code together later.


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





Quote Reply
Re: Can these be done? In reply to
Thks JPDeni!
Quote Reply
Re: Can these be done? In reply to
JPDeni dont forget abt me Smile hehe
Quote Reply
Re: Can these be done? In reply to
Okay. I'll get on it after I finish these messages. There's going to be a lot to change -- one line in one subroutine, another line in another subroutine. Lots of stuff.


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





Quote Reply
Re: Can these be done? In reply to
There are two questions I need you to answer first.

1-- Are you using the password lookup mod?

2-- How will the user type be determined?

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





Quote Reply
Re: Can these be done? In reply to
1-- Are you using the password lookup mod?

Yes, I will be using the password lookup mod.


2-- How will the user type be determined?

Maybe during the Create Account part, let the user choose either FULL MEMBER or MEMBER radio button? Then only the ADMIN can modify the user member status if requested.

PS. isit possible to add in online payment (credit card)into DBMAN?
Quote Reply
Re: Can these be done? In reply to
I'm kinda lost now..

I've add in the lookup mod, and also put in this

<tr><td align=right><$font>Email address:</font></td><td><input type="text" name="email" value="$email" size="14"></td></tr>

but when i inquiry the user, only the password comes out..the email does not.
Quote Reply
Re: Can these be done? In reply to
Do you have the following line in sub admin_display in db.cgi?

Code:
&html_admin_display ($message, $user_list, $password, $perm, $email);

And the following line in sub html_admin_display in html.pl?

Code:
my ($message, $user_list, $password, $permissions, $email) = @_;



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





Quote Reply
Re: Can these be done? In reply to
FYI, http://www.it-g.com/cgi-bin/friendsdb/db.cgi u can use admin/admin

and these http://www.it-g.com/auth.txt
http://www.it-g.com/defaultcgi.txt

http://www.it-g.com/auth.txt, http://www.it-g.com/auth.txt

Quote Reply
Re: Can these be done? In reply to
I'm getting sleepy....its 3.30am..

anyway..havent complete what I wanna say.

all the files can be view..
http://www.it-g.com/auth.txt , htmlpl.txt, dbcgi.txt, defaultcgi.txt

and yes, I have

my ($message, $user_list, $password, $permissions, $email) = @_;

&

&html_admin_display ($message, $user_list, $password, $perm, $email);

and still the email doesnt comes out ...

its my turn to sleep.....will contiune tomorrow morning..sleepy man canot work..sure alot of error comes out.

wanna thks u for all ur help...zzzzzzzz....


Quote Reply
Re: Can these be done? In reply to
What I could do is set up the permissions so that when users log in they are set at "Member" and when they pay, you can change them to "Full Member."
------------------

Ok..think thats the only way. How do i modify the script that can do what i requested in the above mention posting?

Quote Reply
Re: Can these be done? In reply to
I'll give you the code tomorrow, okay? I'm about falling asleep right now. I wanted to know for sure what you wanted so I would only have to do it once.


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





Quote Reply
Re: Can these be done? In reply to
okie! good nite and sweet dreams Smile
Quote Reply
Re: Can these be done? In reply to
Okay. Here goes. Let me know what happens, okay?

In auth.pl, sub auth_check_password, change

Code:
my ($pass, @passwd, $userid, $pw, @permissions, $file, $uid, $email);

to

Code:
my ($pass, @passwd, $userid, $pw, @permissions, $file, $uid, $email, $fmem);

and change

Code:
($userid, $pw, $view, $add, $del, $mod, $admin, $email) = split (/:/, $pass);

to

Code:
($userid, $pw, $view, $add, $del, $mod, $admin, $email, $fmem) = split (/:/, $pass);

and change

Code:
return ('ok', $db_uid, $view, $add, $del, $mod, $admin);

to

Code:
return ('ok', $db_uid, $view, $add, $del, $mod, $admin, $fmem);

In auth.pl, sub auth_check_permissions, change

Code:
my ($username, @permissions, $permission, $name, $pw, $view, $add, $del, $mod, $admin, $email);

to

Code:
my ($username, @permissions, $permission, $name, $pw, $view, $add, $del, $mod, $admin, $email, $fmem);

and change

Code:
($name, $pw, $view, $add, $del, $mod, $admin, $email) = split (/:/, $permission);

to

Code:
($name, $pw, $view, $add, $del, $mod, $admin, $email, $fmem) = split (/:/, $permission);

and change

Code:
return ($view, $add, $del, $mod, $admin);

to

Code:
return ($view, $add, $del, $mod, $admin, $fmem);

In db.cgi, sub main, change

Code:
($status, $uid, $per_view, $per_add, $per_del, $per_mod, $per_admin)
= &auth_check_password; # Authenticate User, get permissions and userid.

to

Code:
($status, $uid, $per_view, $per_add, $per_del, $per_mod, $per_admin, $fmem)
= &auth_check_password; # Authenticate User, get permissions and userid.

In sub admin_display, change

Code:
($userid, $pw, $view, $add, $del, $mod, $admin, $email) = split (/:/, $pass);

to

Code:
($userid, $pw, $view, $add, $del, $mod, $admin, $email, $fmem) = split (/:/, $pass);

and change

Code:
print PASS "$in{'new_username'}:$in{'password'}:$in{'per_view'}:$in{'per_add'}:$in{'per_del'}:
$in{'per_mod'}:$in{'per_admin'}:$in{'email'}\n";

to

Code:
print PASS "$in{'new_username'}:$in{'password'}:$in{'per_view'}:$in{'per_add'}:$in{'per_del'}:
$in{'per_mod'}:$in{'per_admin'}:$in{'email'}:$in{'fmem'}\n";

and change

Code:
print PASS "$in{'username'}:$in{'password'}:$in{'per_view'}:$in{'per_add'}:$in{'per_del'}:
$in{'per_mod'}:$in{'per_admin'}:$in{'email'}\n";

to

Code:
print PASS "$in{'username'}:$in{'password'}:$in{'per_view'}:$in{'per_add'}:$in{'per_del'}:
$in{'per_mod'}:$in{'per_admin'}:$in{'email'}:$in{'fmem'}\n";

and after

Code:
Admin <input type=checkbox name="per_admin" value="1" |;
($data[6] and $perm .= "CHECKED"); $perm .= qq|>|;

add

Code:
Full Member <input type=checkbox name="fmem" value="1" |;
($data[8] and $perm .= "CHECKED"); $perm .= qq|>|;

and after

Code:
Admin <input type=checkbox name="per_admin" value="1" |;
($auth_default_perm[4] and $perm .= "CHECKED"); $perm .= qq|>|;

add

Code:
Full Member <input type=checkbox name="fmem" value="1" >|;

In db.cgi, sub signup, change

Code:
($userid, $pw, $view, $add, $del, $mod, $admin,$email) = split (/:/, $pass);

to

Code:
($userid, $pw, $view, $add, $del, $mod, $admin, $email, $fmem) = split (/:/, $pass);

and change

Code:
print PASS "$in{'userid'}:$in{'pw'}:$permissions:$in{'email'}\n";

to

Code:
print PASS "$in{'userid'}:$in{'pw'}:$permissions:$in{'email'}:0\n";

In db.cgi, sub lookup, change

Code:
($userid, $pw, $view, $add, $del, $mod, $admin, $email) = split (/:/, $pass);

to

Code:
($userid, $pw, $view, $add, $del, $mod, $admin, $email, $fmem) = split (/:/, $pass);

When you want to tell the difference between a "member" and a "full member," use the variable $fmem.

Code:
if ($fmem) {
print "this person is a full member";
}
else {
print "this person is a member";
}


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





Quote Reply
Re: Can these be done? In reply to
can i ask u what does the $email do?

now after the mod. everyone can see the email add in the short display..here's what was the script previously

print qq|<a href="$long_url">$rec{'LoginID'}</a></td>|;
unless ($db_userid eq "default")
{
print qq|
<td><a href="mailto:$rec{'E-mail'}">$rec{'E-mail'}</a>|;
}
print qq|
<td>$rec{'Sex'}</td>
<td>$rec{'Age'}</td>|;
unless ($db_userid eq "default")
{
print qq|
<td>$rec{'Photoyesno'}</td>
<td>$rec{'Voiceyesno'}</td>|;
}
print qq|
<td>$rec{'Brief'}|;

how do i mod it to only when FULL memeber can see the email add?
Quote Reply
Re: Can these be done? In reply to
The $email variable is there to take into account the email address that's in your password file. When it was the last field in the line, I didn't have to worry about it. Now that there's another field after it, I have to take it into account.

Just change

unless ($db_userid eq "default") {

to

if ($fmem) {

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





Quote Reply
Re: Can these be done? In reply to
one more thing, at the User Management (under the sub html_admin_display), there's only New Username, and Change Password. I want to add in Email also..so when any admin inquiry a user, the email will be shown

how do i mod it?
Quote Reply
Re: Can these be done? In reply to
hmm..so i no need to add a email to the Database Definition? I added one to it already. so i can take it out?

'E-mail' => [12, 'alpha', 40, 50, , '', '' ],
Quote Reply
Re: Can these be done? In reply to
I guess I made a little typo in my lookup mod, so maybe you didn't know where to change it.

In html.pl, sub html_admin_display, change

Code:
my ($message, $user_list, $password, $permissions) = @_;

to

Code:
my ($message, $user_list, $password, $permissions, $email) = @_;

after

Code:
<tr><td align=right><$font>Change Password:</font></td>
<td><input type="text" name="password" value="$password" size="14"></td></tr>

add

Code:
<tr><td align=right><$font>Email address:</font></td>
<td><input type="text" name="email" value="$email" size="14"></td></tr>

You did say that you had already installed my password lookup mod, right?


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





Quote Reply
Re: Can these be done? In reply to
I don't have any idea how to incorporate credit card payment in DBMan.

What I could do is set up the permissions so that when users log in they are set at "Member" and when they pay, you can change them to "Full Member." That's the only thing I can think of if you're going to require payment for full membership.


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





Quote Reply
Re: Can these be done? In reply to
after modify it,

i entered 3 types of user, one is admin, one is full member the other is member.

when I login as a member, at the searching part, the Photo: yes|no and Voice: yes|no should not be out, but its shown.

I try to change it to
if ($fmem) {
print qq|
<br><$font_color><b>Photo:</b></font> |; print &build_radio_field ("Photoyesno", "$rec{'Photoyesno'}"); print qq|
<br><$font_color><b>Voice:</b></font> |; print &build_radio_field ("Voiceyesno", "$rec{'Voiceyesno'}");
}

but doesn not work.

and, when I login as member, I listall, at the short display, the Email should not be shown. but its there.
Quote Reply
Re: Can these be done? In reply to
the showing of email part in "User Management" i've solve it.

Quote Reply
Re: Can these be done? In reply to
I went back to your site to see if I could figure out what the problem is, but you have deleted all the other userids and I didn't want to mess with your database.


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





Quote Reply
Re: Can these be done? In reply to
JPDeni , u can do anything to it Smile its ok.
> >