/
var
/
www
/
html
/
sugar13
/
modules
/
SF_Subscriptions
/
Upload File
HOME
<?php /* * SubscriptionFlow Package for SugarCRM * * Copyright (C) SubscriptionFlow. All rights reserved. * * Your installation or use of this package is subject to the applicable * terms available at https://www.subscriptionflow.com/terms-and-conditions * If you do not agree to all of the applicable terms, do not install or use this package. * Support: https://support.subscriptionflow.com */ if (empty($_REQUEST['method'])) { header('HTTP/1.1 400 Bad Request'); $response = "method is required."; $json = getJSONobj(); echo $json->encode($response); } global $currentModule; require_once('modules/' . $currentModule . '/license/SugarSubscriptionFlowOutfittersLicense.php'); if ($_REQUEST['method'] == 'validate') { SugarSubscriptionFlowOutfittersLicense::validate(); } else if ($_REQUEST['method'] == 'change') { SugarSubscriptionFlowOutfittersLicense::change(); } else if ($_REQUEST['method'] == 'add') { SugarSubscriptionFlowOutfittersLicense::add(); } else if ($_REQUEST['method'] == 'test') { $user_id = null; if (!empty($_REQUEST['user_id'])) { $user_id = $_REQUEST['user_id']; } $validate_license = SugarSubscriptionFlowOutfittersLicense::isValid($currentModule, $user_id, true); if ($validate_license !== true) { echo "License did NOT validate.<br/><br/>Reason: " . $validate_license; $validated = SugarSubscriptionFlowOutfittersLicense::doValidate($currentModule); if (is_array($validated['result'])) { echo "<br/><br/>Key validation = " . !empty($validated['result']['validated']); $outfitters_config = []; require('modules/' . $currentModule . '/license/config.php'); if ($outfitters_config['validate_users'] == true) { echo "<br/>User validation = " . !empty($validated['result']['validated_users']); echo "<br/>Licensed User Count = " . $validated['result']['licensed_user_count']; echo "<br/>Current User Count = " . $validated['result']['user_count']; if ($validated['result']['user_count'] > $validated['result']['licensed_user_count']) { echo "<br/><br/>Additional Users Required = " . ($validated['result']['user_count'] - $validated['result']['licensed_user_count']); } } } } else { echo "License validated"; } }