Gossamer Forum
Home : Products : DBMan : Customization :

database

Quote Reply
database
I am setting up individual database for some supplier.

For example, I have DARK (dark.db)and LIGHT(light.db) supplier, Isit possible that in the login page, after they enter their login and password, it will detect which database to use.
Quote Reply
Re: database In reply to
Hello nels:

If you are only going to run one database, then you can just edit the
config and html files and ignore the following.

If you are planning to run multiple databases then you will need at a minimum
seperate database.db and database.cfg files. You might want seperate password,
counter and log files as well. You might also want seperate html files. For each
database, just set up a new config file with the appropriate file names defined.

To tell the script which database to use, you pass in the name of the config
file to load. For instance, if I have a 'orders.cfg' file for a list of orders,
I would call that by going to:

http://server.com/cgi-bin/db.cgi?db=orders

Note: You don't put on the .cfg. Just the part before the .cfg. If you don't
specify a config file to use, the script will look for "default.cfg".


------------------
-------------------- Gossamer Threads Inc. ----------------------
Sun Djaja Email: sun@gossamer-threads.com
Internet Consultant
http://www.gossamer-threads.com

Quote Reply
Re: database In reply to
If the structure of the databases are different, then you will also need to create a separate html.pl for each database.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: database In reply to
The database , html will be the same. I wanted to have only one database, but supplier can only view their own product. Only one person can Edit/Add/Modify/Delete the record.
Quote Reply
Re: database In reply to
Could you explain in detail what you want to accomplish? It seems your two posts in this thread contradict each other.


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





Quote Reply
Re: database In reply to
My database will consist of some sports brand. Each supplier carries one brand.

Everyday, there will be one person updating their products(using DBMAN). Each supplier will be given a login and password to check their stock balance. They can only see their product eg. Supplier A carries Nike, so when the supplier login , he can only view and search product that he supply.

All I can think of is to have individual database for each supplier, and when they go into the login page, after they login, the scrip will somehow from their login id, will search for the database that belong to that supplier.

Not sure is there any other better way to simplify it.
Quote Reply
Re: database In reply to
Much easier way to do this.

In your .cfg file, add a Userid field and set

$auth_no_authentication = 0;
$auth_modify_own = 1;
$auth_user_field = the number of your Userid field;



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





Quote Reply
Re: database In reply to
The problem is, its not the supplier who is entering the data. There will be one person (name ADMIN) who will enter all the supplier's balance stock. The output will be like this

Supplier|Product Code|Description|quantity|Location|

So, only the ADMIN have the permission to Modify/Delete/Add all the records.

Those supplier will have only View/List All/Search permission. And supplier can only view their own Product.

And, if this cannot be done, I would need to have multiple database. Eg

Supplier1 database will consist of 2 user. one will be the admin and the supplier itself.

Supplier2 database will consist of 2 user. one will be the admin and the supplier itself.

And so on.... Like this..I wont need to bother abt Supplier2 can see Supplier1's database. But then...How do I do it in a way that I have one page that let them key in their login and password, the script will know which database to use? I cannot do a list for them to select which supplier they are. eg

Please select -- Supplier 1
Supplier 2
Supplier 3

So, I will need a way round that when they enter their password, they will be bring to their own Database.


Quote Reply
Re: database In reply to
Okay. You can set it up like this, then.

$auth_view_own = 1;
$auth_modify_own = 0;

and the other things like I gave you before. When the person with admin permission adds the record, he can enter the userid of the supplier.

In db.cgi, sub add_record, delete the line

Code:
($auth_user_field >= 0) and ($in{$db_cols[$auth_user_field]} = $db_userid);


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