Gossamer Forum
Home : Products : DBMan : Customization :

Relational mod demo

Quote Reply
Relational mod demo
I was asked to create a demo of the relational mod, so I did. Smile You can access it at http://www.jpdeni.com/...ation/db.cgi?db=user. You can either sign up for an account (regular DBMan signup) or you can view the records as a default user.

On the login page there is a link where you can pick up the files I used for the database. They are all there, except for auth.pl (which I didn't change at all) and db.cgi (which I only changed a little). The changes from the db.cgi script are in a "ReadMe.txt" file.

It's just a silly little database, but it uses all of the fields that are in the discussion of the relational mod.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Relational mod demo In reply to
Denise, thank you so much for doing this. Now I'll have something to build upon.

Q: This may be beyond possibilities for this script, but I would be interested in knowing if there was a way that, should a user chose to delete themselves from the user.db, their records in the item.db would be deleted as well as their entry into the password file.

As it is right now, a user can chose to remove themselves (Delete User Info) and the items will remain forever unless some admin cleanup is performed.

Quote Reply
Re: Relational mod demo In reply to
(I prefer "Deni" to "Denise." Smile)

I think I set it up so that it would delete the items when a user deleted him/herself. I'll give it another shot.

Yep. I just deleted "Wilma Flintstone's" user info from the database and her dinosaur and parrot went "poof!"

It doesn't delete the username from the database, though. That's not specifically a feature which is related to relational databases, so I didn't add it. But it can be done.



JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Relational mod demo In reply to
> (I prefer "Deni" to "Denise.")

Please accept my apology. Blush

In Reply To:
Yep. I just deleted "Wilma Flintstone's" user info from the database and her dinosaur and parrot went "poof!"
Hmm, I don't understand why it would work for you but not me. I created a user and logged in, added one item and then removed myself. The item remained, though the 'Offered by' and 'From' fields are blank.

I can create this user once again (same userid) and back goes the item under said user...

I tried the same with Wilma Flinstone (since you did) and I experienced the same -- items were left, though the user was gone.

Ideas?


Quote Reply
Re: Relational mod demo In reply to
Please try it again, but leave the items there after you delete the user. At present, every item has an associated user.


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Relational mod demo In reply to
In Reply To:
Please try it again, but leave the items there after you delete the user.
I have not deleted any items, and both the user I created and Wilma Flinstone users are removed (have been since yesterday). The only user in the db is Carol Hall. All items are still present, though obviously some now have no associated user. Quite puzzling that they should go away for you and not me.
Quote Reply
Re: Relational mod demo In reply to
Oh. You're talking about *your* database and not mine. That's where I got confused. I thought you were working on the demo.

Did you look at the ReadMe.txt file that was in the .zip file? There's code there that you need to insert into sub delete_records.


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Relational mod demo In reply to
Now she tells me... Smile

Thanks, Deni. That did it!

Quote Reply
Re: Relational mod demo In reply to
Ummmmm, that's why the file is named ReadMe.txt. Wink

I know that the code was not in the relational mod file. I hadn't thought of it until I was creating the demo.

Glad we got it cleared up. Smile

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Relational mod demo In reply to
heh. I know. Read the docs. I made the assumption (for some odd reason, I dunno) that it was the same readme that came with dbman. And you know what they say...

My bad. Sorry. Blush

And, again, thanks! Smile

Quote Reply
Re: Relational mod demo In reply to
In Reply To:
It doesn't delete the username from the database, though. That's not specifically a feature which is related to relational databases, so I didn't add it. But it can be done.
I forgot to ask: How can this be done?

Quote Reply
Re: Relational mod demo In reply to
Since JPDeni's expertise is no longer available, I now ask if *anyone* can help with this.

Specifically, how would one automatically delete a user from the password file when they are deleted from the user.db database?

It looks like it could be a matter of simply adding some code to 'sub delete_records' but, though I think I follow what is taking place in that subroutine, I don't know how to write the code necessary to open the password file, find the user info and delete it.

Thanks in advance for all help you can give!