We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

How do you change the base_user table? | Forum

Topic location: Forum home » Support » General Questions
Miles
Miles Sep 29 '11
I want to use oxwall with an existing site. Due to the site structure, I can't use the ow_base_user table to hold user records. We already have a table with thousands of user records.

I want oxwall to refer to our current table to access user data instead of the ow_base_user table.

Where in the code can I go about doing this? I've searched the source code and I'm at a loss on how to do this.
Miles
Miles Sep 29 '11
Never mind, I found it, it's the user_dao.php file in the /ow_systems_plugin/base/bol/ folder.
Stefan
Stefan Sep 30 '11

Quote from Miles Never mind, I found it, it's the user_dao.php file in the /ow_systems_plugin/base/bol/ folder.
You should note that, changing the dao is not as simple as that.
You will need to change the fields in BOL_User as well to match your database columns and this will affect all other functions which use the BOL_User object.

This however is easily fixed.
1. In your user.php file, delete all property declarations.
2. You need to define a '__set()' and '__get' to remap all changed column names to the desired property name.

eg
public function __set($name, $value)
{
switch($name)
{
case 'username':
//let us assume your column name is uname
$this->uname = $value;
}
}

A similar definition for '__get' should be made.
This will ensure that the rest of the app works.
Den Team
Den Oct 5 '11
Changing user's tables name is not a good idea. If there will be any changes in this table, then these changes will not be applied to your site,cos table's name doesn't matches with table name in sql update instruction.
The best in your case - use another database :)