本文整理汇总了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;
}