Gossamer Forum
Home : Products : DBMan : Customization :

Ask for delete auth and db record

Quote Reply
Ask for delete auth and db record
Hello all,


I want setup the process is that the each user has only one record in db and the login_id is keyword in db.
If the user delete the one and only one record in db, it will auto delete the auth record with same record id(login_id).

How can I do it?

Thx


------------------
Quote Reply
Re: Ask for delete auth and db record In reply to
I don't know what you mean. Are you wanting to delete the entry in the password file when someone deletes a record?


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





Quote Reply
Re: Ask for delete auth and db record In reply to
mention abt del..

For my case, registered user can only have one record which they must key in once they registered.

if the Admin del the user, the record of that user will not be automaticaly delete rite? is there any way to make that happen?
Quote Reply
Re: Ask for delete auth and db record In reply to
Oh, I see. I had it backwards.

I'm going to assume that the $db_key field is the same as your userid field. That's the only way this will work.

In sub admin_display (db.cgi), look for

$in{'delete'} and do {

a little further down from that, change:

Code:
foreach $line (@lines) {
($line =~ /^$in{'username'}:/) ?
($found = 1) :
print PASS $line;
}

to

Code:
foreach $line (@lines) {
if ($line =~ /^$in{'username'}:/) {
$found = 1;
$in{'username'} = "delete";
&delete_records;
}
else {
print PASS $line;
}
}

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





Quote Reply
Re: Ask for delete auth and db record In reply to
Hello JPDeni,

Yes, it is ok, but other way.
If the user delete the own record, it will auto delete the login record in password file.
How can I do it?

Thx

Gab

------------------
Quote Reply
Re: Ask for delete auth and db record In reply to
my $db_key = 'LoginID';

can it still work?