Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating a New Company
11-23-2013, 10:37 AM
Post: #1
Creating a New Company
When I create a database, my host provider creates the following unique database setting for each database, Host name, Database name, Data Base User name and Password. The only item I’m allowed to change is the Password. Running Z_MakeNewCompany.php, the database and company name is entered has to be the same as posted by an admin “The name of the directory under companies needs to match exactly with the name of the database”. In my case, each database has been created via my host provider with unique names.
But looking at the config.php file, it appears that the same $host name, DBUser and DBPassword has to be used for both databases/companys. As noted above my host provider doesn’t support or allow changing those names.
Therefore the only way I see around this is to have a complete copy of weberp installed on my host for every company with a unique URL.
Do I have a miss understanding or is the reasoning correct?
Visit this user's website Find all posts by this user
Quote this message in a reply
11-25-2013, 11:29 AM
Post: #2
RE: Creating a New Company
Hi, Gray,

I think you should require your host provider create those databases with same database user at the same host.

Thanks and best regards!

Exson
Find all posts by this user
Quote this message in a reply
11-26-2013, 07:13 AM
Post: #3
RE: Creating a New Company
Hi Exson,
Thank for your reply.
From your reply I take it, my reasoning is correct.
Good luck telling a host provider to change it's processes/procedures. They have their reasons. I believe one reason is they want all items to be unique. Except the password which allows access only to the owner.
One way to allow multi companies to use the same date base would be to provide unique prefixes for the tables for each company. By the way, when I tried this at installation time. The prefix was added to database name and it could not be accessed.
GrayRyder
Visit this user's website Find all posts by this user
Quote this message in a reply
05-21-2014, 06:49 AM
Post: #4
RE: Creating a New Company
(11-26-2013 07:13 AM)grayryder Wrote:  Hi Exson,
Thank for your reply.
From your reply I take it, my reasoning is correct.
Good luck telling a host provider to change it's processes/procedures. They have their reasons. I believe one reason is they want all items to be unique. Except the password which allows access only to the owner.
One way to allow multi companies to use the same date base would be to provide unique prefixes for the tables for each company. By the way, when I tried this at installation time. The prefix was added to database name and it could not be accessed.
GrayRyder

I use bluehost. I can create databases (ControlPanel->MySQL Databases) and create users. Then assign user~database pair, e.g. for different company. I think that is norm for most providers.
Like Exson suggested, would not hurt to ask your provider. Good luck.
Find all posts by this user
Quote this message in a reply
05-23-2014, 01:13 AM (This post was last modified: 05-23-2014 01:16 AM by serakfalcon.)
Post: #5
RE: Creating a New Company
WebERP doesn't currently support database table prefixes. It's one of several ongoing things I'm looking into.

However, a workaround you could do, is this:
in config.php alter $DBUser & $DBPassword to be an arrays, with the key being the database they belong to.

so,
Code:
$DBUser = array(
    'weberp'=>'someuser',
    'weberp2'=>'anotheruser');
$DBPassword = array(
    'weberp'=>'somepass',
    'weberp2'=>'anotherpass');

And in includes/ConnectDB_mysqli.inc (assuming you're using mysqli, which you should be)

change line 17 to

Code:
$db = mysqli_connect($host , $DBUser[$_SESSION['DatabaseName']], $DBPassword[$_SESSION['DatabaseName']],$_SESSION['DatabaseName'], $mysqlport);

We'll have to do a more comprehensive solution in the future but that should work in your case.
Find all posts by this user
Quote this message in a reply
05-23-2014, 07:53 PM
Post: #6
RE: Creating a New Company
Andrew,

That's great!

Best regards!

Exson
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)