Get username in custom script that works with amember_remote (for V4)

Discussion in 'Customization & add-ons' started by chronoshift, Feb 27, 2013.

  1. chronoshift

    chronoshift aMember Pro Customer

    Joined:
    Jul 23, 2007
    Messages:
    61
    So I have a plugin that works with amember_remote for v3. Here is a part of a code that needs to be changed.

    Code:
    if(is_file($vars)){
        include('config.inc.php');
        $_amember_id = $_SESSION['_amember_id'];
        $info = pathinfo($vars);
        $ref = $_SERVER["HTTP_REFERER"];
        $ref = explode('/', trim($ref,'/'));
        $text = $_SESSION['_amember_remote_login'].'<br>'.$ref[2].'<br>'.date('d.m.y H:i:s').'<br>'.$_SERVER['REMOTE_ADDR'];
        $text = base64_encode($text);
    So here we get a username and then do some manipulations with it. V4 is very different and uses API, maybe there is a easy way to change that part for V4.
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    This is not going to work by default.
    amember remote in v4 doesn't store user's info in session. if you need this functionality you need to add it yourself into controllers/indexController.php

Share This Page