Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP7 Decoder for SourceGuardian Encoder)
- *
- * @ Version : 5.0.1.0
- * @ Author : DeZender
- * @ Release on : 22.04.2022
- * @ Official site : http://DeZender.Net
- *
- */
- namespace Classes;
- class Licenses
- {
- public const REGISTRY_PATH = Server::REGISTRY_PATH . '\\Licenses';
- public const NO_RESTRICTIONS = '4294967294';
- public const VALID_UNTIL_UNLIMITED = 'forever';
- public const RELOAD_DATE_NEVER = 'never';
- public const REG_CONNECTED = 0;
- public const PAID_SERVER = 19;
- public const ENABLE_SUPPORT = 21;
- public const ENTERPRISE_MASTER = 24;
- public const ENTERPRISE_SLAVE = 25;
- public const RIGHT_CONFERENCE_SCHEMA_ASYMMETRIC_ALLOWED = 'ASYMMETRICCONF_ALLOWED';
- public const RIGHT_CONFERENCE_SCHEMA_ROLE_ALLOWED = 'ROLECONF_ALLOWED';
- public const SECOND_IN_DAY = 86400;
- public const DATE_FORMAT = 'Y/m/d G.i.s O';
- public const RIGHT_REG_CONNECTED = 'REG_CONNECTED';
- public const RIGHT_GRACE_PERIOD = 'GRACE_PERIOD';
- public const RIGHT_ROAMING_ALLOWED = 'ROAMING_ALLOWED';
- public const RIGHT_ENCRYPT_ALLOWED = 'ENCRYPT_ALLOWED';
- public const RIGHT_USER_GROUPS_ALLOWED = 'USER_GROUPS_ALLOWED';
- public const RIGHT_LDAP_ALLOWED = 'LDAP_ALLOWED';
- public const RIGHT_FILE_TRANSFER_ALLOWED = 'FILETRANSFER_ALLOWED';
- public const RIGHT_SCREEN_SHARING_ALLOWED = 'SCREENSHARING_ALLOWED';
- public const RIGHT_VIDEO_RECORDING_ALLOWED = 'VIDEORECORDING_ALLOWED';
- public const RIGHT_WHITEBOARD_ALLOWED = 'WHITEBOARD_ALLOWED';
- public const RIGHT_SLIDE_SHOW_ALLOWED = 'SLIDESHOW_ALLOWED';
- public const RIGHT_ASYMMETRIC_CONF_ALLOWED = 'ASYMMETRICCONF_ALLOWED';
- public const RIGHT_ROLE_CONF_ALLOWED = 'ROLECONF_ALLOWED';
- public const RIGHT_UDP_MULTICAST_ALLOWED = 'UDPMULTICAST_ALLOWED';
- public const RIGHT_HD_ALLOWED = 'HD_ALLOWED';
- public const RIGHT_MULTI_GATEWAY_ALLOWED = 'MULTIGATEWAY_ALLOWED';
- public const RIGHT_WEB_RTC_BROADCAST_ALLOWED = 'WEBRTC_BROADCAST_ALLOWED';
- public const RIGHT_IMPROVED_SECURITY = 'IMPROVED_SECURITY';
- public const RIGHT_DIRECTORY = 'DIRECTORY';
- public const RIGHT_PAID_SERVER = 'PAID_SERVER';
- public const RIGHT_ENABLE_WEBINARS = 'ENABLE_WEBINARS';
- public const RIGHT_ENABLE_SUPPORT = 'ENABLE_SUPPORT';
- public const RIGHT_BROADCAST_ENABLED = 'BROADCAST_ENABLED';
- public const RIGHT_TRUECONF_SDK = 'TRUECONF_SDK';
- public const RIGHT_ENTERPRISE_MASTER = 'ENTERPRISE_MASTER';
- public const RIGHT_ENTERPRISE_SLAVE = 'ENTERPRISE_SLAVE';
- static public $reset_session = false;
- static public $trial_ban = [
- ['module' => 'users', 'action' => 'storage'],
- ['module' => 'group', 'action' => 'list']
- ];
- static public $no_reg_modules = ['reg', 'service', 'help'];
- public $error = null;
- public $error_certificate = null;
- public $error_license = null;
- public $conferences = null;
- public $online_users = null;
- public $mobileusers = null;
- public $symmetricparticipants = null;
- public $maxguests = null;
- public $gateways = null;
- public $restrictions = null;
- public $restrictions_rights = null;
- public $limited = null;
- public $trial_time = null;
- public $valid_until = null;
- public $reload_date = null;
- public $shutdown_time = null;
- public $terminalprousers = null;
- protected $linkBuilder = null;
- static private $instance = null;
- public function __construct()
- {
- $this->restrictions_rights = [
- [
- 'name' => static::RIGHT_REG_CONNECTED,
- 'value' => 0,
- 'ban_pages' => [],
- 'description' => _('Connection to registration server'),
- 'desc_value' => [
- ['class' => 'green', 'desc' => _('Not required')],
- ['class' => 'brown', 'desc' => _('Required')]
- ],
- 'link' => ''
- ],
- [
- 'name' => static::RIGHT_GRACE_PERIOD,
- 'value' => 0,
- 'ban_pages' => [],
- 'description' => _('Grace Period'),
- 'link' => ''
- ],
- [
- 'name' => static::RIGHT_ROAMING_ALLOWED,
- 'value' => 0,
- 'ban_pages' => [
- ['module' => 'network', 'action' => 'federation']
- ],
- 'description' => _('Federation'),
- 'link' => 'federation'
- ],
- [
- 'name' => static::RIGHT_ENCRYPT_ALLOWED,
- 'value' => 0,
- 'ban_pages' => [],
- 'description' => _('Stream Encryption'),
- 'link' => ''
- ],
- [
- 'name' => static::RIGHT_USER_GROUPS_ALLOWED,
- 'value' => 0,
- 'ban_pages' => [],
- 'description' => _('User Groups'),
- 'link' => ''
- ],
- [
- 'name' => static::RIGHT_LDAP_ALLOWED,
- 'value' => 0,
- 'ban_pages' => [
- ['module' => 'users', 'action' => 'storage'],
- ['module' => 'ldap', 'action' => 'settings']
- ],
- 'description' => _('LDAP / Active Directory'),
- 'link' => 'ldap'
- ],
- [
- 'name' => static::RIGHT_FILE_TRANSFER_ALLOWED,
- 'value' => 0,
- 'ban_pages' => [],
- 'description' => _('File Transfer'),
- 'link' => 'file-transfer'
- ],
- [
- 'name' => static::RIGHT_SCREEN_SHARING_ALLOWED,
- 'value' => 0,
- 'ban_pages' => [],
- 'description' => _('Screen Sharing'),
- 'link' => 'screen-sharing'
- ],
- [
- 'name' => static::RIGHT_VIDEO_RECORDING_ALLOWED,
- 'value' => 0,
- 'ban_pages' => [],
- 'description' => _('Video Recording'),
- 'link' => 'recording'
- ],
- [
- 'name' => static::RIGHT_WHITEBOARD_ALLOWED,
- 'value' => 0,
- 'ban_pages' => [],
- 'description' => _('Whiteboard'),
- 'link' => ''
- ],
- [
- 'name' => static::RIGHT_SLIDE_SHOW_ALLOWED,
- 'value' => 0,
- 'ban_pages' => [],
- 'description' => _('Slideshow'),
- 'link' => 'slideshow'
- ],
- [
- 'name' => static::RIGHT_ASYMMETRIC_CONF_ALLOWED,
- 'value' => 0,
- 'ban_pages' => [],
- 'description' => _('Asymmetric Conferences'),
- 'link' => ''
- ],
- [
- 'name' => static::RIGHT_ROLE_CONF_ALLOWED,
- 'value' => 0,
- 'ban_pages' => [],
- 'description' => _('Role-based Conferences'),
- 'link' => ''
- ],
- [
- 'name' => static::RIGHT_UDP_MULTICAST_ALLOWED,
- 'value' => 0,
- 'ban_pages' => [],
- 'description' => _('UDP Multicast Conferences'),
- 'link' => 'udp-multicast'
- ],
- [
- 'name' => static::RIGHT_HD_ALLOWED,
- 'value' => 0,
- 'ban_pages' => [],
- 'description' => _('HD Quality'),
- 'link' => ''
- ],
- [
- 'name' => static::RIGHT_MULTI_GATEWAY_ALLOWED,
- 'value' => 0,
- 'ban_pages' => [
- ['module' => 'network', 'action' => 'sip'],
- ['module' => 'network', 'action' => 'h323']
- ],
- 'description' => _('SIP/H.323 Gateway'),
- 'link' => 'multigateway'
- ],
- [
- 'name' => static::RIGHT_WEB_RTC_BROADCAST_ALLOWED,
- 'value' => 0,
- 'ban_pages' => [],
- 'description' => _('WebRTC'),
- 'link' => ''
- ],
- [
- 'name' => static::RIGHT_IMPROVED_SECURITY,
- 'value' => 0,
- 'ban_pages' => [],
- 'description' => _('Improved Security')
- ],
- [
- 'name' => static::RIGHT_DIRECTORY,
- 'value' => 0,
- 'ban_pages' => [
- ['module' => 'addons', 'action' => 'directory']
- ],
- 'description' => \Core\Settings::getDirectoryName(),
- 'link' => 'directory'
- ],
- [
- 'name' => static::RIGHT_PAID_SERVER,
- 'value' => 0,
- 'ban_pages' => [],
- 'description' => _('Server Type'),
- 'desc_value' => [
- ['desc' => _('Free')],
- ['class' => 'green', 'desc' => _('Paid')]
- ],
- 'link' => ''
- ],
- [
- 'name' => static::RIGHT_ENABLE_WEBINARS,
- 'value' => 0,
- 'ban_pages' => [],
- 'description' => _('Public Web Conferences'),
- 'link' => 'webinars'
- ],
- [
- 'name' => static::RIGHT_ENABLE_SUPPORT,
- 'value' => 0,
- 'ban_pages' => [],
- 'description' => _('Technical support'),
- 'desc_value' => [
- ['class' => 'red', 'desc' => _('Basic')],
- ['class' => 'green', 'desc' => _('Extended')]
- ],
- 'link' => 'support'
- ],
- [
- 'name' => static::RIGHT_BROADCAST_ENABLED,
- 'value' => 0,
- 'ban_pages' => [
- ['module' => 'conferences', 'action' => 'streaming']
- ],
- 'description' => \_pgettext('Extension for video conference streaming', 'Streaming'),
- 'link' => 'streaming'
- ],
- [
- 'name' => static::RIGHT_TRUECONF_SDK,
- 'value' => 0,
- 'ban_pages' => [],
- 'description' => _('Support for SDK Applications'),
- 'link' => 'sdk'
- ],
- [
- 'name' => static::RIGHT_ENTERPRISE_MASTER,
- 'value' => 0,
- 'ban_pages' => [
- ['module' => 'enterprise', 'action' => '']
- ],
- 'description' => _('Shared license pool role'),
- 'link' => 'enterprise',
- 'desc_value' => [
- ['class' => 'red', 'desc' => _('N/A')],
- ['class' => 'green', 'desc' => _('Manager')]
- ]
- ],
- [
- 'name' => static::RIGHT_ENTERPRISE_SLAVE,
- 'value' => 0,
- 'ban_pages' => [],
- 'description' => _('Shared license pool role'),
- 'link' => 'enterprise',
- 'desc_value' => [
- ['class' => 'red', 'desc' => _('N/A')],
- ['class' => '', 'desc' => _('Consumer')]
- ]
- ]
- ];
- \Core\Registry::read(static::getPath(), $this);
- $this->prepareValidUntil();
- $this->prepareReloadDate();
- $this->restrictions = $this->decodeRestrictions();
- foreach ($this->restrictions_rights as $key => $val) {
- if ($val['name'] == 'MULTIGATEWAY_ALLOWED') {
- $this->restrictions_rights[$key]['value'] = (!$this->restrictions[$key] || !$this->gateways ? 0 : 1);
- }
- else {
- $this->restrictions_rights[$key]['value'] = $this->restrictions[$key];
- }
- }
- $this->linkBuilder = \TCS\Application\DependencyContainer::getInstance()->get('TCS\\Application\\Service\\Restriction\\License\\Link\\LicenseLinkBuilderInterface');
- }
- static public function getPath()
- {
- return static::REGISTRY_PATH;
- }
- protected function prepareValidUntil()
- {
- if (is_null($this->valid_until)) {
- $this->setValidUntilFromCertificate();
- return NULL;
- }
- if ($this->isUnlimitedLicense()) {
- $this->valid_until = NULL;
- }
- }
- public function setValidUntilFromCertificate()
- {
- $valid_until = Configuration::getCertUntilTimestamp();
- ......................................................................
- ..........................................
- ..............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement