本文整理匯總了PHP中Crypt::openLicense方法的典型用法代碼示例。如果您正苦於以下問題:PHP Crypt::openLicense方法的具體用法?PHP Crypt::openLicense怎麽用?PHP Crypt::openLicense使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Crypt
的用法示例。
在下文中一共展示了Crypt::openLicense方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getLicenseData
/**
* Get the already stored license data.
* @param string $uid
* @return \stdClass
*/
public function getLicenseData($uid)
{
$result = new stdClass();
$result->success = false;
$key = blowfishGetKey('ProcessMaker');
//TODO DELETE THIS LINE
//$result->success = true;
//return $result;
//Verify if activationCode exist in DB
$rs = $this->amBean->retrieve_by_string_fields(array("acm_uid" => $uid));
if (empty($rs)) {
$result->message = translate('LBL_PMSE_ADAM_LICENSEMANAGER_MESSAGE_IDFIELDMISSING', $this->moduleName);
return $result;
}
try {
$license = json_decode($this->crypt->openLicense($key, $rs->acm_data));
} catch (Exception $e) {
$result->message = $e->getMessage();
return $result;
}
if (empty($license)) {
$result->message = translate('LBL_PMSE_ADAM_LICENSEMANAGER_MESSAGE_NOTVALID', $this->moduleName);
return $result;
} else {
if (!isset($license->lic_max_admins)) {
$result->message = translate('LBL_PMSE_ADAM_LICENSEMANAGER_MESSAGE_ADMINISTRATORMISSING', $this->moduleName);
return $result;
} else {
$result->lic_max_admins = $license->lic_max_admins;
}
if (!isset($license->lic_max_users)) {
$result->message = translate('LBL_PMSE_ADAM_LICENSEMANAGER_MESSAGE_USERSMISSING', $this->moduleName);
return $result;
} else {
$result->lic_max_users = $license->lic_max_users;
}
if (!isset($license->lic_max_cases)) {
$result->message = translate('LBL_PMSE_ADAM_LICENSEMANAGER_MESSAGE_CASESMISSING', $this->moduleName);
return $result;
} else {
$result->lic_max_cases = $license->lic_max_cases;
}
if (!isset($license->lic_product_expiration_date)) {
$result->message = translate('LBL_PMSE_ADAM_LICENSEMANAGER_MESSAGE_PRODUCTDATEMISSING', $this->moduleName);
return $result;
} else {
$result->lic_product_expiration_date = $license->lic_product_expiration_date;
}
if (!isset($license->lic_support_expiration_date)) {
$result->message = translate('LBL_PMSE_ADAM_LICENSEMANAGER_MESSAGE_SUPPORTDATEMISSING', $this->moduleName);
return $result;
} else {
$result->lic_support_expiration_date = $license->lic_support_expiration_date;
}
if (!isset($license->lic_enabled_br)) {
$result->message = translate('LBL_PMSE_ADAM_LICENSEMANAGER_MESSAGE_BUSSINESRULESMISSING', $this->moduleName);
return $result;
} else {
$result->lic_enabled_br = (bool) $license->lic_enabled_br;
}
$result->success = true;
}
return $result;
}