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.

Integrate Vanilla with custom user system

edited December 2008 in Vanilla 1.0 Help
Hello there. I'm completely new to Vanilla--this my first time using it. However, I'm fairly competent at programming PHP and MySQL.

I'm working on a website that needs a forum. I've created the website's user system entirely from scratch, so I'm faced with two choices: roll my own forum solution, thus ensuring integration; or attempt to integrate a pre-existing forum with the system. Both pose difficulties. I could code my own forum, but why make that much work for myself when there is something like Vanilla, which does exactly what I want--some place to hold discussions, something simple? On the other hand, I have no experience with using Vanilla, and in general I dislike trying to integrate external code into my projects. It usually gets messy. That being said, I am willing to try!

I read the WordPress integration document and followed its instructions in order to get Vanilla using my pre-existing users table, adding the columns that it did not already have that Vanilla needs. I also copied the authenticator class and edited it so that Vanilla will authenticate a user if he or she has the cookie my site uses for authentication. That's working fine.

I'm going to handle all user registration, sign in/sign out, preferences, and profile pages with the site's user management system. How could I best go about disabling this aspect of Vanilla--i.e., disabling registration and viewing a user's profile?

Edit: I've created an extension that removes the "Account" tab, and then I renamed account.php. Sound good?

Comments

  • judgejjudgej
    edited November 2008
    I would like to know the definitive way to handle this too. There are lots of people asking this question, lots of people saying that the information is out there, but very little that actually explains how to do this (in an upgradable way).

    -- Jason
  • edited November 2008
    You can override your menu.php Vanilla template and remove the <div id=“Session”></div> to remove user info at the top of the page and replace it with your system. Be sure to remove people.php and register.php too.
    About viewing profiles, I'd go for others template (don't know which ones) to change the links. Another trick is a custom account.php to hard redirect to your profiles system.
    You know which one is the ugliest...
  • This is what I have done on one site:-

    1. Stop people changing their details in Vanilla (so it is controlled by the external application):

    $Configuration['ALLOW_EMAIL_CHANGE'] = '0';
    $Configuration['ALLOW_NAME_CHANGE'] = '0';
    $Configuration['ALLOW_PASSWORD_CHANGE'] = '0';


    2. Change the signin and signout URLs to point to my external CMS (Xaraya):

    $Configuration['SIGNIN_URL'] = $Configuration['BASE_URL']
    . '../authsystem/login?returnurl=' . rawurlencode($_SERVER['SCRIPT_URI']);
    $Configuration['SIGNOUT_URL'] = $Configuration['BASE_URL'] . '../index.php/authsystem/logout';

    3. Removed people.php to prevent people from loggining in directly.

    Now, I have found there are other instances where users will be sent to people.php, so it should not be removed completely. Instead it can be replaced with a simple static page that sends people back to the signin screen.

    The idea of changing the links rather than removing them from the templates, is that (a) I do not need to search the templates and provide overrides, and (b) users do have a login and logout link on every page where they expect one, but it just happens that the authentication takes place on an external CMS.

    I don't think there is a register.php (registration is in people.php) unless I'm overlooking something?

    -- Jason
  • Yes, maybe I meant people.php, remembering an old post here.
    Once I tried, but I never managed to use Xaraya!
This discussion has been closed.