Advertisement
Guest User

Untitled

a guest
Mar 16th, 2023
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.37 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP7 Decoder for SourceGuardian Encoder)
  6. *
  7. * @ Version : 5.0.1.0
  8. * @ Author : DeZender
  9. * @ Release on : 22.04.2022
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. namespace Classes;
  15.  
  16. class Licenses
  17. {
  18. public const REGISTRY_PATH = Server::REGISTRY_PATH . '\\Licenses';
  19. public const NO_RESTRICTIONS = '4294967294';
  20. public const VALID_UNTIL_UNLIMITED = 'forever';
  21. public const RELOAD_DATE_NEVER = 'never';
  22. public const REG_CONNECTED = 0;
  23. public const PAID_SERVER = 19;
  24. public const ENABLE_SUPPORT = 21;
  25. public const ENTERPRISE_MASTER = 24;
  26. public const ENTERPRISE_SLAVE = 25;
  27. public const RIGHT_CONFERENCE_SCHEMA_ASYMMETRIC_ALLOWED = 'ASYMMETRICCONF_ALLOWED';
  28. public const RIGHT_CONFERENCE_SCHEMA_ROLE_ALLOWED = 'ROLECONF_ALLOWED';
  29. public const SECOND_IN_DAY = 86400;
  30. public const DATE_FORMAT = 'Y/m/d G.i.s O';
  31. public const RIGHT_REG_CONNECTED = 'REG_CONNECTED';
  32. public const RIGHT_GRACE_PERIOD = 'GRACE_PERIOD';
  33. public const RIGHT_ROAMING_ALLOWED = 'ROAMING_ALLOWED';
  34. public const RIGHT_ENCRYPT_ALLOWED = 'ENCRYPT_ALLOWED';
  35. public const RIGHT_USER_GROUPS_ALLOWED = 'USER_GROUPS_ALLOWED';
  36. public const RIGHT_LDAP_ALLOWED = 'LDAP_ALLOWED';
  37. public const RIGHT_FILE_TRANSFER_ALLOWED = 'FILETRANSFER_ALLOWED';
  38. public const RIGHT_SCREEN_SHARING_ALLOWED = 'SCREENSHARING_ALLOWED';
  39. public const RIGHT_VIDEO_RECORDING_ALLOWED = 'VIDEORECORDING_ALLOWED';
  40. public const RIGHT_WHITEBOARD_ALLOWED = 'WHITEBOARD_ALLOWED';
  41. public const RIGHT_SLIDE_SHOW_ALLOWED = 'SLIDESHOW_ALLOWED';
  42. public const RIGHT_ASYMMETRIC_CONF_ALLOWED = 'ASYMMETRICCONF_ALLOWED';
  43. public const RIGHT_ROLE_CONF_ALLOWED = 'ROLECONF_ALLOWED';
  44. public const RIGHT_UDP_MULTICAST_ALLOWED = 'UDPMULTICAST_ALLOWED';
  45. public const RIGHT_HD_ALLOWED = 'HD_ALLOWED';
  46. public const RIGHT_MULTI_GATEWAY_ALLOWED = 'MULTIGATEWAY_ALLOWED';
  47. public const RIGHT_WEB_RTC_BROADCAST_ALLOWED = 'WEBRTC_BROADCAST_ALLOWED';
  48. public const RIGHT_IMPROVED_SECURITY = 'IMPROVED_SECURITY';
  49. public const RIGHT_DIRECTORY = 'DIRECTORY';
  50. public const RIGHT_PAID_SERVER = 'PAID_SERVER';
  51. public const RIGHT_ENABLE_WEBINARS = 'ENABLE_WEBINARS';
  52. public const RIGHT_ENABLE_SUPPORT = 'ENABLE_SUPPORT';
  53. public const RIGHT_BROADCAST_ENABLED = 'BROADCAST_ENABLED';
  54. public const RIGHT_TRUECONF_SDK = 'TRUECONF_SDK';
  55. public const RIGHT_ENTERPRISE_MASTER = 'ENTERPRISE_MASTER';
  56. public const RIGHT_ENTERPRISE_SLAVE = 'ENTERPRISE_SLAVE';
  57.  
  58. static public $reset_session = false;
  59. static public $trial_ban = [
  60. ['module' => 'users', 'action' => 'storage'],
  61. ['module' => 'group', 'action' => 'list']
  62. ];
  63. static public $no_reg_modules = ['reg', 'service', 'help'];
  64. public $error = null;
  65. public $error_certificate = null;
  66. public $error_license = null;
  67. public $conferences = null;
  68. public $online_users = null;
  69. public $mobileusers = null;
  70. public $symmetricparticipants = null;
  71. public $maxguests = null;
  72. public $gateways = null;
  73. public $restrictions = null;
  74. public $restrictions_rights = null;
  75. public $limited = null;
  76. public $trial_time = null;
  77. public $valid_until = null;
  78. public $reload_date = null;
  79. public $shutdown_time = null;
  80. public $terminalprousers = null;
  81. protected $linkBuilder = null;
  82. static private $instance = null;
  83.  
  84. public function __construct()
  85. {
  86. $this->restrictions_rights = [
  87. [
  88. 'name' => static::RIGHT_REG_CONNECTED,
  89. 'value' => 0,
  90. 'ban_pages' => [],
  91. 'description' => _('Connection to registration server'),
  92. 'desc_value' => [
  93. ['class' => 'green', 'desc' => _('Not required')],
  94. ['class' => 'brown', 'desc' => _('Required')]
  95. ],
  96. 'link' => ''
  97. ],
  98. [
  99. 'name' => static::RIGHT_GRACE_PERIOD,
  100. 'value' => 0,
  101. 'ban_pages' => [],
  102. 'description' => _('Grace Period'),
  103. 'link' => ''
  104. ],
  105. [
  106. 'name' => static::RIGHT_ROAMING_ALLOWED,
  107. 'value' => 0,
  108. 'ban_pages' => [
  109. ['module' => 'network', 'action' => 'federation']
  110. ],
  111. 'description' => _('Federation'),
  112. 'link' => 'federation'
  113. ],
  114. [
  115. 'name' => static::RIGHT_ENCRYPT_ALLOWED,
  116. 'value' => 0,
  117. 'ban_pages' => [],
  118. 'description' => _('Stream Encryption'),
  119. 'link' => ''
  120. ],
  121. [
  122. 'name' => static::RIGHT_USER_GROUPS_ALLOWED,
  123. 'value' => 0,
  124. 'ban_pages' => [],
  125. 'description' => _('User Groups'),
  126. 'link' => ''
  127. ],
  128. [
  129. 'name' => static::RIGHT_LDAP_ALLOWED,
  130. 'value' => 0,
  131. 'ban_pages' => [
  132. ['module' => 'users', 'action' => 'storage'],
  133. ['module' => 'ldap', 'action' => 'settings']
  134. ],
  135. 'description' => _('LDAP / Active Directory'),
  136. 'link' => 'ldap'
  137. ],
  138. [
  139. 'name' => static::RIGHT_FILE_TRANSFER_ALLOWED,
  140. 'value' => 0,
  141. 'ban_pages' => [],
  142. 'description' => _('File Transfer'),
  143. 'link' => 'file-transfer'
  144. ],
  145. [
  146. 'name' => static::RIGHT_SCREEN_SHARING_ALLOWED,
  147. 'value' => 0,
  148. 'ban_pages' => [],
  149. 'description' => _('Screen Sharing'),
  150. 'link' => 'screen-sharing'
  151. ],
  152. [
  153. 'name' => static::RIGHT_VIDEO_RECORDING_ALLOWED,
  154. 'value' => 0,
  155. 'ban_pages' => [],
  156. 'description' => _('Video Recording'),
  157. 'link' => 'recording'
  158. ],
  159. [
  160. 'name' => static::RIGHT_WHITEBOARD_ALLOWED,
  161. 'value' => 0,
  162. 'ban_pages' => [],
  163. 'description' => _('Whiteboard'),
  164. 'link' => ''
  165. ],
  166. [
  167. 'name' => static::RIGHT_SLIDE_SHOW_ALLOWED,
  168. 'value' => 0,
  169. 'ban_pages' => [],
  170. 'description' => _('Slideshow'),
  171. 'link' => 'slideshow'
  172. ],
  173. [
  174. 'name' => static::RIGHT_ASYMMETRIC_CONF_ALLOWED,
  175. 'value' => 0,
  176. 'ban_pages' => [],
  177. 'description' => _('Asymmetric Conferences'),
  178. 'link' => ''
  179. ],
  180. [
  181. 'name' => static::RIGHT_ROLE_CONF_ALLOWED,
  182. 'value' => 0,
  183. 'ban_pages' => [],
  184. 'description' => _('Role-based Conferences'),
  185. 'link' => ''
  186. ],
  187. [
  188. 'name' => static::RIGHT_UDP_MULTICAST_ALLOWED,
  189. 'value' => 0,
  190. 'ban_pages' => [],
  191. 'description' => _('UDP Multicast Conferences'),
  192. 'link' => 'udp-multicast'
  193. ],
  194. [
  195. 'name' => static::RIGHT_HD_ALLOWED,
  196. 'value' => 0,
  197. 'ban_pages' => [],
  198. 'description' => _('HD Quality'),
  199. 'link' => ''
  200. ],
  201. [
  202. 'name' => static::RIGHT_MULTI_GATEWAY_ALLOWED,
  203. 'value' => 0,
  204. 'ban_pages' => [
  205. ['module' => 'network', 'action' => 'sip'],
  206. ['module' => 'network', 'action' => 'h323']
  207. ],
  208. 'description' => _('SIP/H.323 Gateway'),
  209. 'link' => 'multigateway'
  210. ],
  211. [
  212. 'name' => static::RIGHT_WEB_RTC_BROADCAST_ALLOWED,
  213. 'value' => 0,
  214. 'ban_pages' => [],
  215. 'description' => _('WebRTC'),
  216. 'link' => ''
  217. ],
  218. [
  219. 'name' => static::RIGHT_IMPROVED_SECURITY,
  220. 'value' => 0,
  221. 'ban_pages' => [],
  222. 'description' => _('Improved Security')
  223. ],
  224. [
  225. 'name' => static::RIGHT_DIRECTORY,
  226. 'value' => 0,
  227. 'ban_pages' => [
  228. ['module' => 'addons', 'action' => 'directory']
  229. ],
  230. 'description' => \Core\Settings::getDirectoryName(),
  231. 'link' => 'directory'
  232. ],
  233. [
  234. 'name' => static::RIGHT_PAID_SERVER,
  235. 'value' => 0,
  236. 'ban_pages' => [],
  237. 'description' => _('Server Type'),
  238. 'desc_value' => [
  239. ['desc' => _('Free')],
  240. ['class' => 'green', 'desc' => _('Paid')]
  241. ],
  242. 'link' => ''
  243. ],
  244. [
  245. 'name' => static::RIGHT_ENABLE_WEBINARS,
  246. 'value' => 0,
  247. 'ban_pages' => [],
  248. 'description' => _('Public Web Conferences'),
  249. 'link' => 'webinars'
  250. ],
  251. [
  252. 'name' => static::RIGHT_ENABLE_SUPPORT,
  253. 'value' => 0,
  254. 'ban_pages' => [],
  255. 'description' => _('Technical support'),
  256. 'desc_value' => [
  257. ['class' => 'red', 'desc' => _('Basic')],
  258. ['class' => 'green', 'desc' => _('Extended')]
  259. ],
  260. 'link' => 'support'
  261. ],
  262. [
  263. 'name' => static::RIGHT_BROADCAST_ENABLED,
  264. 'value' => 0,
  265. 'ban_pages' => [
  266. ['module' => 'conferences', 'action' => 'streaming']
  267. ],
  268. 'description' => \_pgettext('Extension for video conference streaming', 'Streaming'),
  269. 'link' => 'streaming'
  270. ],
  271. [
  272. 'name' => static::RIGHT_TRUECONF_SDK,
  273. 'value' => 0,
  274. 'ban_pages' => [],
  275. 'description' => _('Support for SDK Applications'),
  276. 'link' => 'sdk'
  277. ],
  278. [
  279. 'name' => static::RIGHT_ENTERPRISE_MASTER,
  280. 'value' => 0,
  281. 'ban_pages' => [
  282. ['module' => 'enterprise', 'action' => '']
  283. ],
  284. 'description' => _('Shared license pool role'),
  285. 'link' => 'enterprise',
  286. 'desc_value' => [
  287. ['class' => 'red', 'desc' => _('N/A')],
  288. ['class' => 'green', 'desc' => _('Manager')]
  289. ]
  290. ],
  291. [
  292. 'name' => static::RIGHT_ENTERPRISE_SLAVE,
  293. 'value' => 0,
  294. 'ban_pages' => [],
  295. 'description' => _('Shared license pool role'),
  296. 'link' => 'enterprise',
  297. 'desc_value' => [
  298. ['class' => 'red', 'desc' => _('N/A')],
  299. ['class' => '', 'desc' => _('Consumer')]
  300. ]
  301. ]
  302. ];
  303. \Core\Registry::read(static::getPath(), $this);
  304. $this->prepareValidUntil();
  305. $this->prepareReloadDate();
  306. $this->restrictions = $this->decodeRestrictions();
  307.  
  308. foreach ($this->restrictions_rights as $key => $val) {
  309. if ($val['name'] == 'MULTIGATEWAY_ALLOWED') {
  310. $this->restrictions_rights[$key]['value'] = (!$this->restrictions[$key] || !$this->gateways ? 0 : 1);
  311. }
  312. else {
  313. $this->restrictions_rights[$key]['value'] = $this->restrictions[$key];
  314. }
  315. }
  316.  
  317. $this->linkBuilder = \TCS\Application\DependencyContainer::getInstance()->get('TCS\\Application\\Service\\Restriction\\License\\Link\\LicenseLinkBuilderInterface');
  318. }
  319.  
  320. static public function getPath()
  321. {
  322. return static::REGISTRY_PATH;
  323. }
  324.  
  325. protected function prepareValidUntil()
  326. {
  327. if (is_null($this->valid_until)) {
  328. $this->setValidUntilFromCertificate();
  329. return NULL;
  330. }
  331.  
  332. if ($this->isUnlimitedLicense()) {
  333. $this->valid_until = NULL;
  334. }
  335. }
  336.  
  337. public function setValidUntilFromCertificate()
  338. {
  339. $valid_until = Configuration::getCertUntilTimestamp();
  340. ......................................................................
  341. ..........................................
  342. ..............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement