Drupal demotion instead of "blocked"

Discussion in 'Integration' started by ethankap, Sep 26, 2007.

  1. ethankap

    ethankap New Member

    Joined:
    Sep 18, 2007
    Messages:
    1
    Is there a way to reconfigure AMember so it doesn't block a user on expiration, but instead demotes them by removing the "paid" role?
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    modify drupal.inc.php:
    function subscription_deleted($member_id, $product_id, $member){
    $member = $this->escape_record($member);
    $max = $this->get_max($member['data']['status']);
    $active = ($max=='') ? 0 : 1;
    $this->query("UPDATE [db]users
    SET status='$active'
    WHERE name='$member[login]'");
    $this->update_membership($member);

    }

    change this function to:
    function subscription_deleted($member_id, $product_id, $member){
    $member = $this->escape_record($member);
    $max = $this->get_max($member['data']['status']);
    $active = ($max=='') ? 0 : 1;
    $this->update_membership($member);

    }

Share This Page