Migrate existing web app with C5 - combining databases?
Permalink
I have an existing web-app (about 30 tables, using CodeIgniter for DB manipulation and ajax + login, UI is built in ExtJS) that I would like to combine with Concrete5 as the frontend CMS.
I have VPS hosting, so I can create two databases (one for my app, one for C5), but there is a lot of overlap - for instance, I need to allow users to login from my database (1000 users with a lot of relational tables connected to them) into Concrete5.
I could add the group information into my database, so C5 would know, what kind of user logged in. This user should then be able to use C5 to administer web pages and (depending on group) also access my ExtJS web-app.
How would I approach this? I cannot import users into C5 tables under any conditions. I could (with a LOT of work) refactor my web-app to use prefixed tables and squeeze my tables into C5's database, should that be neccessary.
Thank you for any ideas / best practices!
I have VPS hosting, so I can create two databases (one for my app, one for C5), but there is a lot of overlap - for instance, I need to allow users to login from my database (1000 users with a lot of relational tables connected to them) into Concrete5.
I could add the group information into my database, so C5 would know, what kind of user logged in. This user should then be able to use C5 to administer web pages and (depending on group) also access my ExtJS web-app.
How would I approach this? I cannot import users into C5 tables under any conditions. I could (with a LOT of work) refactor my web-app to use prefixed tables and squeeze my tables into C5's database, should that be neccessary.
Thank you for any ideas / best practices!
The quickest way I can think of is to simply combine login functionality but leave the rest of the functionality separate. You might want to re-skin your app's admin interface to look like c5's, so it doesn't seem like separate systems to the user (or just keep them separate and explain to users that that's just the way it is).
How to combine logins? Well, assuming both sites are on the same domain, you can share the session cookie between the two systems. You will want to have a look into the C5 core code to see how it reads and saves this session data, and then modify your app to work that way as well (it will be infinitely easier to modify your own code than to try and change C5's code). You may need to rig up some system where upon first login to the C5 site, if no user exists, it runs a query against your other system to see if the user exists there, and if so import that one user's data over to the C5 system (basically register them behind the scenes using data from the other system). You'll run into problems in terms of synching future profile updates, though, so you need to decide if you care about that or not (if you do care, you will need to write more synching code that is triggered on a profile update from either system).
There are definitely other ways to do it as well, but off the top of my head that seems like the one I would try.
-Jordan