Advertisement
Guest User

Untitled

a guest
Dec 13th, 2023
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.00 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP8 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 8.1.0.9
  8. * @ Author : DeZender
  9. * @ Release on : 27.10.2023
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. function azuracast_MetaData()
  15. {
  16. return ['DisplayName' => 'Azuracast', 'APIVersion' => '1.2', 'RequiresServer' => true, 'DefaultNonSSLPort' => '1111', 'DefaultSSLPort' => '1112', 'ServiceSingleSignOnLabel' => 'Login to Panel as User', 'AdminSingleSignOnLabel' => 'Login to Panel as Admin'];
  17. }
  18.  
  19. /**
  20. * Define product configuration options.
  21. *
  22. * The values you return here define the configuration options that are
  23. * presented to a user when configuring a product for use with the module. These
  24. * values are then made available in all module function calls with the key name
  25. * configoptionX - with X being the index number of the field from 1 to 24.
  26. *
  27. * You can specify up to 24 parameters, with field types:
  28. * * text
  29. * * password
  30. * * yesno
  31. * * dropdown
  32. * * radio
  33. * * textarea
  34. *
  35. * Examples of each and their possible configuration parameters are provided in
  36. * this sample function.
  37. *
  38. * @see https://developers.whmcs.com/provisioning-modules/config-options/
  39. *
  40. * @return array
  41. */
  42. function azuracast_ConfigOptions()
  43. {
  44. return [
  45. 'Transmission Type' => [
  46. 'Type' => 'dropdown',
  47. 'Options' => ['shoutcast2' => 'Shoutcast 2', 'icecast' => 'Icecast'],
  48. 'Description' => 'Choose one'
  49. ],
  50. 'Transmission Bitrate' => [
  51. 'Type' => 'dropdown',
  52. 'Options' => [32 => '32 Kbps', 48 => '48 Kbps', 64 => '64 Kbps', 96 => '96 Kbps', 128 => '128 Kbps', 192 => '192 Kbps', 256 => '256 Kbps', 320 => '320 Kbps'],
  53. 'Description' => 'In Kbps'
  54. ],
  55. 'Media Storage' => ['Type' => 'text', 'Default' => '2 GB', 'Description' => 'Size in GB'],
  56. 'Recording Storage' => ['Type' => 'text', 'Default' => '2 GB', 'Description' => 'Size in GB'],
  57. 'Podcast Storage' => ['Type' => 'text', 'Default' => '2 GB', 'Description' => 'Size in GB'],
  58. 'Max listeners' => ['Type' => 'text', 'Default' => '64', 'Description' => 'Size per unit'],
  59. 'Audio Type' => [
  60. 'Type' => 'dropdown',
  61. 'Options' => ['mp3' => 'MP3', 'ogg' => 'OGG Vorbis', 'opus' => 'OGG Opus', 'aac' => 'AAC+ (MPEG4 HE-AAC v2)', 'flac' => 'FLAC (OGG FLAC)'],
  62. 'Description' => 'Select an audio protocol'
  63. ],
  64. 'Permissions' => ['Type' => 'textarea', 'Rows' => '6', 'Cols' => '60', 'Description' => join('<br>', ['(Copy and paste the permissions for this product into the text box above, one per line.)', 'Manage Station Automation', 'Manage Station Broadcasting', 'Manage Station Media', 'Manage Station Podcasts', 'Manage Station Streamers', 'Manage Station Web Hooks', 'View Station Logs', 'View Station Reports', 'View Station Management', 'Manage Station Profile', 'Manage Station Mounts', 'Manage Station Remotes'])]
  65. ];
  66. }
  67.  
  68. /**
  69. * Provision a new instance of a product/service.
  70. *
  71. * Attempt to provision a new instance of a given product/service. This is
  72. * called any time provisioning is requested inside of WHMCS. Depending upon the
  73. * configuration, this can be any of:
  74. * * When a new order is placed
  75. * * When an invoice for a new order is paid
  76. * * Upon manual request by an admin user
  77. *
  78. * @param array $params common module parameters
  79. *
  80. * @see https://developers.whmcs.com/provisioning-modules/module-parameters/
  81. *
  82. * @return string "success" or an error message
  83. */
  84. function azuracast_CreateAccount(array $params)
  85. {
  86. try {
  87. explodeIfInvalidLicense($params);
  88. $endpoint = $params['serverhostname'];
  89. $token = $params['serverpassword'];
  90. $station_name = $params['customfields']['name'];
  91. $transmission_type = useUserFieldIfPresent($params['customfields']['transmissionType'], $params['configoption1']);
  92. $permissions = $params['configoption8'];
  93. $permissions = strtolower($permissions);
  94. ................................................................
  95. .......................................
  96. .................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement