Drupal Integration Questions

Discussion in 'aMember Pro v.4' started by press_enterprise, Nov 26, 2012.

  1. press_enterprise

    press_enterprise New Member

    Joined:
    Aug 29, 2006
    Messages:
    25
    We have two separate subdomains working with Drupal 7 and aMember 4 integration:

    http://www.mysite.com - Drupal 7​

    I swear at one point, when I logged into one site, I was logged into both, but now that seems that only works one way.

    If I log into www/D7 first, I am logged into account/a4. Links crossing back and forth between both sites work, maintaining my user login. When I log out of www/D7, I am also logged out of account/a4. However, if a user logs into account/a4 first, then visits the www/D7 site, they are not logged in and must log in again. Is this a known issue and/or is there anything I can do about it?

    --

    I have also found that aMember's Access Log and Account Sharing Prevention tools are not of much use anymore since they only track visits and logins to the account/a4 site, not the www/D7 site. What can I do to fix this? I was thinking about forcing all logins to go through the aMember login form instead of the Drupal login form to capture account access, but the first issue listed above makes that a non-option.

    --

    Is there any way to link User Profile fields between the two user databases? For instance, aMember has a First Name and Last Name field for a user. Drupal allows you to add any custom fields you want. Can I create a link or integration between the two that will be maintained if a user modifies information on either site? Since both aMember and Drupal can both have custom Profile fields, this would be a very powerful feature for both systems to be able to use this kind of data.

    --

    Any help is appreciated.
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,274
    1. To fix single login issue try to edit /amember/application/default/plugins/protect/drupal.php and change this line:
    Am_Protect_SessionTable::COOKIE_PARAM_EXACT_DOMAIN => true
    to
    Am_Protect_SessionTable::COOKIE_PARAM_EXACT_DOMAIN => false
    Please let me know the result.
    2. In order to use Access Log and account sharing protection you have to use aMember's login form. So you should force all logins to amember after number 1 is fixed.
    3. This can be done as customization only. Contact us in helpdesk, we will help with this.
  3. press_enterprise

    press_enterprise New Member

    Joined:
    Aug 29, 2006
    Messages:
    25

    The above code modification worked. I can now:

    - Open https://account.mysite.com/ (aMember 4 installation) in Tab #1
    - Open http://www.mysite.com/ (Drupal 7 installation) in Tab #2
    - Log into Tab #1
    - Refresh Tab #2 and I am logged in.
    - Log out of Tab #1
    - Refresh Tab #2 and I am logged out.

    I will now work on redirecting any login/logout requests from Drupal to aMember's forms. Is there a relatively easy way to create a page/template in aMember that just looks like this with no header or footer:

    [​IMG]


    That way I can embed that page onto my www site and incorporate aMember's snazzy form validation and css.

    Thanks!

    Attached Files:

  4. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,274
    You should edit /amember/application/default/views/login.phtml , here is example how it should looks like:
    Code:
    <?php
    echo $this->doctype('XHTML1_TRANSITIONAL');
    ?>
    <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <title><?php echo $title ?></title>
            <?php $this->printLayoutHead(); ?>
        </head>
        <body>
    
    <?php include $this->_script('_error.phtml'); ?>
    <?php $noInitAjaxForm = true; ?>
    <?php include $this->_script('_login.phtml'); ?>
    <br />
    <p style="text-align:center"><?php __e('Not registered yet?') ?> <a href="<?php echo REL_ROOT_URL ?>/signup/index/c/<?php p(@$hidden['saved_form']) ?>"><?php __e('Signup here') ?>
    <br />
            <?php echo $this->render('_popup.phtml'); ?>
            <?php echo $this->placeholder('body-finish'); ?>
        </body>
    </html>
    
    
  5. press_enterprise

    press_enterprise New Member

    Joined:
    Aug 29, 2006
    Messages:
    25
    Tested that code change and it does indeed make it a standalone form with no header or footer. How can I make a separate page that looks like this instead of changing my actual login page? If someone does go to https://account.mysite.com/login I want it to have the header and footer - I just need a non-header/footer version of the page I can embed elsewhere.

    Thanks for all your help alexander.
  6. press_enterprise

    press_enterprise New Member

    Joined:
    Aug 29, 2006
    Messages:
    25
    Just an update, I created a new file with that code in /amember/application/default/views/login_embed.phtml, hoping that would just create a /login_embed path that would work, but I get a 404 error. I hope that clarifies what I'm trying to do.
  7. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,274
    Well, there is no simple way to do this. As I have understood you want to include that page somewhere on your site?
    If so, just save default login page as html, modify that html code and remove everything that is not necessary, then include in your other pages.
  8. press_enterprise

    press_enterprise New Member

    Joined:
    Aug 29, 2006
    Messages:
    25
    Saving the HTML is a great and simple idea. I did that, changed my href, src, and action attributes, but my login forms don't work. Please see Support Ticket Reference NKC-93435-973
  9. press_enterprise

    press_enterprise New Member

    Joined:
    Aug 29, 2006
    Messages:
    25
    Sorry to bring up an old post but we are still on the same versions and we are trying to migrate our Drupal site to strictly use HTTPS. We've updated the $base_url in Drupal and the "Drupal base url" in aMember's configuration.

    When we attempt to log into the Website using the embedded form that works via HTTP, the login works to get us into aMember, but Drupal doesn't log in. The cookie data seems to be ok, but for some reason Drupal simply doesn't recognize the cookie that aMember does.

    - Open https://account.mysite.com/ (aMember 4 installation) in Tab #1
    - Open http://www.mysite.com/ (Drupal 7 installation) in Tab #2
    - Log into Tab #1
    - Refresh Tab #2 and I am NOT logged in

    Any ideas?
  10. press_enterprise

    press_enterprise New Member

    Joined:
    Aug 29, 2006
    Messages:
    25

Share This Page