Yes, but moderators and people with normal modify permissions still can't rate or modify...
Jun 15, 2000, 12:27 AM
Veteran / Moderator (8669 posts)
Jun 15, 2000, 12:27 AM
Post #27 of 30
Views: 1518
There must be some combination of "if"s, "and"s, "or"s and "unless"es that will do this. Maybe if I write out what you need to do, I'll get some inspiration.
he can modify it
If this is a moderator
If the record belongs to his group
he can modify it
If the record belongs to him
he can modify itRight? Now we have to turn it around, because the script works the other way -- saying that if he doesn't meet the criteria he can't modify it.
Maybe we can turn the script around instead of the code.
$okay = 0;
if ($per_admin) { $okay=1; }
elsif ($per_mdr) {
if ($per_mdr == &group_number($data[$group_field])) {
$okay = 1;
}
}
if ($db_userid eq $data[$auth_user_field]) {
$okay = 1;
}
unless ($okay) {
$output .= "$line\n" and next LINE;
}
There's also going to be a problem with setting the userid field in the lines
if ($auth_user_field >= 0 and (!$per_admin or !$in{$db_cols[$auth_user_field]})) {
$in{$db_cols[$auth_user_field]} = $data[$auth_user_field];
}
But if we get the other thing worked out first, we can get this fixed later. I hope.
JPD
Code:
If this is an admin he can modify it
If this is a moderator
If the record belongs to his group
he can modify it
If the record belongs to him
he can modify it
Maybe we can turn the script around instead of the code.
Code:
$okay = 0;
if ($per_admin) { $okay=1; }
elsif ($per_mdr) {
if ($per_mdr == &group_number($data[$group_field])) {
$okay = 1;
}
}
if ($db_userid eq $data[$auth_user_field]) {
$okay = 1;
}
unless ($okay) {
$output .= "$line\n" and next LINE;
}
Code:
if ($auth_user_field >= 0 and (!$per_admin or !$in{$db_cols[$auth_user_field]})) {
$in{$db_cols[$auth_user_field]} = $data[$auth_user_field];
}
JPD
Jun 15, 2000, 3:33 PM
Veteran / Moderator (8669 posts)
Jun 15, 2000, 3:33 PM
Post #29 of 30
Views: 1486
The problem is that, when a moderator edits someone else's record, the moderator's userid will be entered into the userid field of the record.
You could just delete the line, although it would take away some of the security of the database.
I'm glad I was able to *finally* figure it out. It just takes some "thinking out loud" sometimes.
JPD
You could just delete the line, although it would take away some of the security of the database.
I'm glad I was able to *finally* figure it out. It just takes some "thinking out loud" sometimes.
JPD
Jun 15, 2000, 3:47 PM
Novice (17 posts)
Jun 15, 2000, 3:47 PM
Post #30 of 30
Views: 1492
Actually, that didn't happen...
Maybe it's because of my little modifications...
Sub html_rating_form_record calls html_rank_record, instead of html_record_form. And html_rank_record displays all the information, but only shows an <input> box for the Rating field. However, to avoid getting a "such and such field cannot be blank" error, I carried ALL the fields as <input type="hidden"> fields. So all the information from the record is carried on in the hidden fields, even the UID.
Well, everything's working fine.
Thanks for everything!
jorge
Maybe it's because of my little modifications...
Sub html_rating_form_record calls html_rank_record, instead of html_record_form. And html_rank_record displays all the information, but only shows an <input> box for the Rating field. However, to avoid getting a "such and such field cannot be blank" error, I carried ALL the fields as <input type="hidden"> fields. So all the information from the record is carried on in the hidden fields, even the UID.
Well, everything's working fine.
Thanks for everything!
jorge