How to use aMember Pro for software licining

SEOboss

Junior Member
Joined
Nov 23, 2009
Messages
173
Reaction score
42
Hi

I need help I am willing to use aMember Pro script to sell multiple products so far every thing is ok because its default feature of amember

To validate users credentials I created a form in my software which will validate username and password if username password is ok my application will get shown if its wrong application will not get open - This is also OK

Main problem is as I am selling multiple products and if a user purchase any one software from me he will get access to all software because aMember successfully validate user name and password is its is ok and due to that user can use same username password for all software

so I need help how to prevent this
 
Works with aMember V4 Bootstrap:
PHP:
$active_subs = $user->getActiveProductIds();
if(in_array("PRODUCT_ID_NUMBER",$active_subs)==false){ // Not Purchase Product
 
Hi

Thank post cods for code , I will be very thankful to u if u explain or post code in c#/vb.net
Works with aMember V4 Bootstrap :
PHP:
$active_subs = $user->getActiveProductIds();
if(in_array("PRODUCT_ID_NUMBER",$active_subs)==false){ // Not Purchase Product
 
Hi

Thank post cods for code , I will be very thankful to u if u explain or post code in c#/vb.net

You must use PHP to contact the aMember API then you can return answers to your program, E.g.
On your web server get the users details etc then check for product existence:
if(in_array("PRODUCT_ID_NUMBER",$active_subs)==false){echo "NOT PURCHASED"; exit;}

And in VB:
If Response = "NOT PURCHASED" Then
MessageBox.Show("You do not have access to this product");
Me.Close()
End If
 
Not sure if aMember has this. But s2member has an "notifications api" where you can basically call an url after the user has successfully purchased your product. So what I do is when someone orders a product I just call my php script which then adds the user details to the "customer db" and this db I use for verifying the license.
 
Amember has a rest API. You have to "purchase" it for $0 (free). Next time you download amembers it comes with REST plugin and some documentation.

Otherwise, you need to hack into the amembers installation by writing a PHP based API.

Basically you import the boot strapper

require_once "../members/bootstrap.php";

Then after that you can make calls such as...

$user = Am_Di::getInstance()->userTable->getAuthenticatedRow($login, $pass, $code);

I think REST is probably easier. However when I needed integration I actually had to do it via the bootstrapper since the REST API wasn't released yet.
 
hi

its worked very well thanks for valuable help
 
Back
Top