Membership Plugin, Database Interaction and Admin Panel Permissions

Inactive
  • 39 points
    Starting to get into this DEV thing
    I'm helpful
    dseason

    Member  —  17th March 2011 (1 year ago)         

    Hi,

    If you've been following my escapades so far, I have been directly interacting with the database to modify rules, levels and subscription types. For more information, you can view the topics:

    http://premium.wpmudev.org/forums/topic/membership-functionality-ii-ipn-filters-and-drip-feeds
    http://premium.wpmudev.org/forums/topic/membership-functionality-iii-paypal-integration-and-ipn#post-83062

    If anything in this topic doesn't make sense, please ask me for clarification. I would appreciate help on this!

    So far, everything is working really well! I have a few problems though, which seem to deal with permission issues and the Membership plugin admin panel. First and foremost, if I create subscriptions using the admin panel, I have absolutely no trouble modifying them, deleting them, or batch-processing them. The problem arises when I try to modify subscriptions which are being generated by my scripts.

    I first noticed this when I was cleaning out old test accounts. I would delete the account using Wordpress, and notice that all of the subscriptions, rules and levels tied to that account remained. So, I went through the admin panel, and batch-selected every subscription I wanted to delete (all of which were created outside of the admin panel.) When I went to click "delete," I was sent to the "You do not have access page." which is a selectable Membership plugin option. I thought that was strange, so I tried to delete subscriptions manually, and I received an error similar to:

    Subscription not deleted.

    I thought that it was strange that all of these subscriptions, rules and levels remained after I deleted a user, but I let it slide and deleted all of that data through phpMyAdmin. Just recently, while trying to activate a subscription via the hook 'membership_payment_processed' (unfortunately, the gateway isn't activating subscriptions that have received payment, I had to write code to do it instead) I found that I could not activate or deactivate any subscription I had created outside of the admin panel. I received the error:

    Subscription activation not toggled.

    It appears that my administrator account doesn't have permission to do this kind of stuff. Weird, huh?

    I understand that you would rather I not modify the subscriptions outside of the administrative panel, but the scope of this project demands that I do. What do I need to do to enable subscription modification for the administrator when creating subscriptions outside of the admin panel?

    Thank you for your help.