Bonjour
I would like to set up the database so that a user is limited to a specified number of records. They would then have Add, Modify rights but could only add records up to their limit.
Every user will have the same maximum number of records.
In db.cgi, sub validate record, I changed (as I read in a thread)
if ($data[$db_key_pos] eq $in{$db_key}) {
return "duplicate key error";
}
}
close DB;
to
code:
return "duplicate key error";
}
if ($data[$auth_user_field] eq $db_userid) {
++$user_count;
}
}
close DB;
if ($user_count >= X) {
return "maximum number of records reached"
}
X= number of records allowed per user.
My problem is that the admin can only add X records too.
I'd like to setup the database so that a user is limited to add X records and the admin (in this case, me) is not limited.
Any ideas on how to do that would be appreciated.
Dominique
(learning english, perl, the way of dbman works by means of this forum).
I would like to set up the database so that a user is limited to a specified number of records. They would then have Add, Modify rights but could only add records up to their limit.
Every user will have the same maximum number of records.
In db.cgi, sub validate record, I changed (as I read in a thread)
Code:
code: if ($data[$db_key_pos] eq $in{$db_key}) {
return "duplicate key error";
}
}
close DB;
to
code:
Code:
if ($data[$db_key_pos] eq $in{$db_key}) { return "duplicate key error";
}
if ($data[$auth_user_field] eq $db_userid) {
++$user_count;
}
}
close DB;
if ($user_count >= X) {
return "maximum number of records reached"
}
X= number of records allowed per user.
My problem is that the admin can only add X records too.
I'd like to setup the database so that a user is limited to add X records and the admin (in this case, me) is not limited.
Any ideas on how to do that would be appreciated.
Dominique
(learning english, perl, the way of dbman works by means of this forum).