/** * @brief parse the license info file, print whether the user has the right to use. */ function getLicenseFromAgency($module, $user_id, $serial_number) { $cache_file = nucommon::checkLicense($user_id, $module, $serial_number); if (file_exists($cache_file)) { $oXml = new XmlParser(); $buff = $oXml->parse(FileHandler::readFile($cache_file)); $userObj = $buff->drm->user; if ($userObj) { $user = $userObj->body; if ($user != $user_id) { $this->checkLicense($user_id, $module, $serial_number, TRUE); return TRUE; } } $serialObj = $buff->drm->serial; if ($serialObj) { $serial = $serialObj->body; if ($serial != $serial_number) { $this->checkLicense($user_id, $module, $serial_number, TRUE); return TRUE; } } $licenseObj = $buff->drm->license; if ($licenseObj) { $license = $licenseObj->body; if ($license == 'none') { // print nothing } } } return FALSE; }
/** * @brief 제품등록인증 */ function getLicenseFromAgency() { $oNproductModel = getModel('nproduct'); $config = $oNproductModel->getModuleConfig(); return nucommon::getLicenseFromAgency('nproduct', $config->user_id, $config->serial_number); }