Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Dual vanilla install user integration

ThaRiddlaThaRiddla New
edited May 2008 in Vanilla 1.0 Help
I've been poking around in both the documentation and on the forums and have been unable to find what I'm looking for.

I have a vanilla install in my root directory and an additional install outfitted with Jazzman's Issue Tracker in a subdirectory "projects". Currently I'm manually mirroring the User database tables to allow a single login to work with both installs, which is highly annoying and time consuming whenever i get a new user or someone changes their information. Is there a way that I can redirect the projects install to point to the root directory's user tables?

Both installs are working on the same user/pass, just different tables. In the projects install I've added a line in conf/database.php to allow me to reference the root install database
$Configuration['DATABASE_NAME'] = 'database1_issuedb'; // For integration of main forum user database $Configuration['USER_DATABASE_NAME'] = 'database1_rootdb';
But I don't know where else to change so that the USER_DATABASE_NAME is referenced.

Any help you can offer is much appreciated.

Comments

  • I'm afraid Vanilla is intended to have both installs use the same database--just differing table prefixes so the table names don't conflict. However, this doesn't mean you can't do it with separate databases. If you take your issue tracker install, copy the library/People.Class.Authenticator.php file and name it something like People.Class.RootAuthenticator.php. Next, add this line to conf/settings.php: $Configuration['AUTHENTICATION_MODULE'] = 'People/People.Class.RootAuthenticator.php'; Then you can edit the RootAuthenticator to make direct queries to your root database instead of using the database defined in settings.
  • so, if i migrated my issue tracker tables over to my root database, change my conf/database.php file to reflect the new database, would that eliminate the need for a custom authenticator?
  • well, i'm halfway there.

    I've migrated my "projects" database over to my root install database. All the "projects" tables are prefixed with IST_
    Everything works until i try to integrate it into my root User tables (prefixed with LUM_)

    I have my conf/database.php line $Configuration['DATABASE_TABLE_PREFIX'] = 'IST_'; to point to the tables, but it's looking for IST_User as well. All of the documentation and discussions i've found say that the User table doesn't reference this variable, but it seems to be doing so in my case.

    Can anyone point me in the right direction? I've tried commenting out that line in my conf/database.php file and it goes straight back to LUM_
  • That should be all you need to do...

    appg/database.php defines the user table:$DatabaseTables['User'] = 'LUM_User'
    Even looking in there you can see that all other table definitions don't have the prefix... And it shouldn't be looking for a IST_User unless you set $DatabaseTables['User'] = 'IST_User'
  • ThaRiddlaThaRiddla New
    edited September 2007
    I've added that line to appg/database.php

    If I try to go directly to the subfolder - I can get the sign-in form, but when submitted i get this:
    Error Message An error occurred while attempting to validate your credentials Affected Elements Authenticator.Authenticate(); The error occurred on or near: Table 'vanilla_db.IST_User' doesn't exist

    If I login through the root and navigate to the subfolder i get this:
    Error Message An error occurred while attempting to retrieve the requested user. Affected Elements UserManager.GetSessionDataById(); The error occurred on or near: Table 'vanilla_db.IST_User' doesn't exist I've deleted cookies (path, domain and session) cleared my cache and restarted firefox...any suggestions?
  • OK, I could have sworn I got this to work before. ... But it doesn't look like its even possible when looking at the code.

    There may be more places to fix this, but we'll try fixing the login first. Go into library/people/People.Class.Authenticator.php and change this line, adding the underlined:
          $s->SetMainTable('User', 'u', $Context->DatabaseTables['User']);
    And then repeat your login test with $DatabaseTables['User'] set to 'LUM_User'.
  • That gives me the same error, except i get a notice of an undefined variable on that line that i changed.
  • ThaRiddlaThaRiddla New
    edited September 2007
    this is really strange...the ONLY prefix that the
    $DatabaseTables['User'] = 'LUM_User'

    code doesn't like is LUM_ I can change it to BLAH or FOO or whatever and it reads correctly. When it's LUM_ it defaults back to IST_ which is how my other tables are defined.
  • hmm... that is strange... what happens if you use IST_User for both installs?

    As far as my reading code... I was wrong about where the prefix gets added... I thought it was supposed to be handled in the authenticator itself, but it looks like the prefix is added to the table names in Framework.Functions.php, the GetTableName function, which is called from the SqlBuilder
  • ThaRiddlaThaRiddla New
    edited September 2007
    I'll have to try using IST_User for both installs...For now, I just created a new table IST_User from LUM_User. Then it threw me an error about needing IST_Role (I will need a separate table for this as the issue tracker requires a different them than my main install).

    Thinking differently, is there a way for a new user to be added to both tables upon registration? Not really the cleanest solution. :|
  • Have you installed either of the forums using the latest 1.1.3rc? There were some changes made to the install script in there I think i wonder if they had any effect?
  • No. I'm running 1.1.2 on both installs.
  • It's currently looking like I'm going to have to keep using separate user tables.

    Style preference info is kept in the User table and since my two installs use separate styles, I can't use a common table unless I rename the two styles to the same thing, which will be confusing in the future for updates.
  • I'm just about to embark on the task of integrating a vanilla install with an issue tracker install, i'm wondering would be easier or even possible to just create an extension which integrates them.

    Thoughts?
  • I install issue tracker in a directory myforum.com/tracker in one database with myforum.com but other prefix. Now I had a problem - it is necessary, that all users from myforum.com would be sign in and in myforum.com/tracker but had different roles. For example Ed had the default member rights on myforum.com and all issue rights on myforum.com/tracker.Help, please
  • you can try to add a column to the user table, e.g. 'TrackerRole' so the user can have different roles in both sites. (an addon will to this quite easily)

    the issue is to have the tracker to handle this new roles instead of the standard 'Role' column in the user table...maybe swapping its values when you are on either site so the current role will always be in the 'Role' column, but you have like a backup value thats the user role for the other site. The problem here is that then the user couldn't visit both sites at the same time... :(

    I hope I wasn't too confusing, i don't know, it's just fast idea
  • I tried that that to do in base, but at me nothing has turned out. Help, it is very important
  • Maybe try the MultiRoles extension?
  • Thanks, but MultiRoles does not help me. On myforum.com there are no those rights which gives issue tracker in myforum.com/tracker, and to me the problem with the sign in information is all the same important
  • Does anybody know?
This discussion has been closed.