Hi there!!
Some Background information
I have set my database up with the user permissions of Add, Delete, View. After I have Validated the record (that is accepted the new user as a member of the database or rejected the new user) I then access User Mangaement and assign the Accepted User with the modify function as well.
The reason I have done this is because I have given my users the ability to signup on line and some users also provide information that they may or maynot want to be public. I have set this up via public/private check box (see code below) to reveal the information to full members, while hiding it from members not yet validated and default users.
print qq||;
if ($per_mod) {
print qq|
<TR><TD COLSPAN="2" ALIGN="Right" VALIGN="Top"><$font_color>About Me:</FONT></TD>
<TD COLSPAN="3"><$font> $rec{'About Me'}</Font></TD></TR>
|;
}
print qq|
|;
}Ok my problem is that when I change a persons permissions via the admin screen. I am changing the password as well.
What I have found is that unless I actually type in the persons password at the same time as I set the 4 Permissions I am changing the users password to blank.
What this means is that when the user tries to sign on using
Username/originally chosen password they get access denied etc.
But if they sign on using
Username/leaving the password field blank they can access the database no problem.
Any ideas as to why I need to reenter the the persons password when I modify thier permissions?
Anyway that is the first little hiccup, the next thing is that I had been going to ask how I could get dbman to amend the user permissions (to include modify) automatically once the record has been validated.
I have found this code while searching through the forum and it sounds like it might be close to what I am wanting.
Set your $db_key field to be the userid field. (Since you just want one record per user, this is the way to go anyway.)
In sub html_home, add
code:
--------------------------------------------------------------------------------
%rec = &get_record($db_userid);
unless ($rec{$db_key}) {
$in{'add_form'} = 1;
&html_add_form;
return;
}
--------------------------------------------------------------------------------
This will cause the script to search for a record for the user as soon as he logs in. If a record is not found, he will be sent to the add form.
Give permissions of (1,1,1,1,0) to those signing up, but
1-- Take the "Add" link out of sub html_footer
and
2-- Take the footer out of sub html_add_form.which is.
A new user will have access to view and add record only. Once the record is validated then the above code would allow the user to have access to the delete and modify also.
I realise the above code as it is written currently doesn do this, and I'm hoping that someone will be able to modify for the code so it will.
Many thanks
Seer
Oh yes by the way my users can only add one record per user.
Some Background information
I have set my database up with the user permissions of Add, Delete, View. After I have Validated the record (that is accepted the new user as a member of the database or rejected the new user) I then access User Mangaement and assign the Accepted User with the modify function as well.
The reason I have done this is because I have given my users the ability to signup on line and some users also provide information that they may or maynot want to be public. I have set this up via public/private check box (see code below) to reveal the information to full members, while hiding it from members not yet validated and default users.
Code:
if ($rec{'Public'}) { print qq||;
if ($per_mod) {
print qq|
<TR><TD COLSPAN="2" ALIGN="Right" VALIGN="Top"><$font_color>About Me:</FONT></TD>
<TD COLSPAN="3"><$font> $rec{'About Me'}</Font></TD></TR>
|;
}
print qq|
|;
}
What I have found is that unless I actually type in the persons password at the same time as I set the 4 Permissions I am changing the users password to blank.
What this means is that when the user tries to sign on using
Username/originally chosen password they get access denied etc.
But if they sign on using
Username/leaving the password field blank they can access the database no problem.
Any ideas as to why I need to reenter the the persons password when I modify thier permissions?
Anyway that is the first little hiccup, the next thing is that I had been going to ask how I could get dbman to amend the user permissions (to include modify) automatically once the record has been validated.
I have found this code while searching through the forum and it sounds like it might be close to what I am wanting.
Code:
What I have done is to force a new user to add if he does not currently have a record in the database. Set your $db_key field to be the userid field. (Since you just want one record per user, this is the way to go anyway.)
In sub html_home, add
code:
--------------------------------------------------------------------------------
%rec = &get_record($db_userid);
unless ($rec{$db_key}) {
$in{'add_form'} = 1;
&html_add_form;
return;
}
--------------------------------------------------------------------------------
This will cause the script to search for a record for the user as soon as he logs in. If a record is not found, he will be sent to the add form.
Give permissions of (1,1,1,1,0) to those signing up, but
1-- Take the "Add" link out of sub html_footer
and
2-- Take the footer out of sub html_add_form.
A new user will have access to view and add record only. Once the record is validated then the above code would allow the user to have access to the delete and modify also.
I realise the above code as it is written currently doesn do this, and I'm hoping that someone will be able to modify for the code so it will.
Many thanks
Seer
Oh yes by the way my users can only add one record per user.