Hi Joe,
licenses are stored in the servoy.properties file.
The UserManager plugin is able to read the properties file.
An easy way is to iterate all the properties and read the ones that you need to have (ie. license.0.licenses)
Another way would be to read the number of licensekeys in the manager (licenseManager.numberOfLicenses)
Then iterate the license.0.licenses, license.1.licenses etc.
- Code: Select all
function license_count() {
var _nTotal = 0;
var _nCount = parseInt(plugins.UserManager.getSettingsProperty('licenseManager.numberOfLicenses'), 10);
if(_nCount) {
for (var i = 0; i < _nCount; i++) {
_nTotal += parseInt(plugins.UserManager.getSettingsProperty('license.' + i + '.licenses'), 10);
}
}
return _nTotal;
}
Hope this helps