Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.91 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP7 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 4.0.8.9
  8. * @ Author : DeZender
  9. * @ Release on : 10.05.2019
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. define('IEM_NO_CONTROLLER', true);
  15. define('IEM_CLI_MODE', true);
  16. error_reporting(32767);
  17. ini_set('display_errors', 1);
  18. require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/index.php';
  19. require_once IEM_PUBLIC_PATH . '/functions/api/settings.php';
  20. $settings_api = new Settings_API();
  21.  
  22. if ($settings_api->NeedDatabaseUpgrade()) {
  23. exit();
  24. }
  25.  
  26. unset($settings_api);
  27. if (!SENDSTUDIO_SAFE_MODE && (strpos(SENDSTUDIO_DISABLED_FUNCTIONS, 'set_time_limit') === false)) {
  28. set_time_limit(0);
  29. }
  30. if (!defined('SENDSTUDIO_IS_SETUP') || !SENDSTUDIO_IS_SETUP) {
  31. exit();
  32. }
  33.  
  34. require_once SENDSTUDIO_FUNCTION_DIRECTORY . '/sendstudio_functions.php';
  35. $path = IEM_ADDONS_PATH . '/installer/api/installer.php';
  36.  
  37. if (!is_file($path)) {
  38. return false;
  39. }
  40.  
  41. require_once $path;
  42. $options = CommandLine::parseArgs($argv);
  43.  
  44. if (isset($options['flush-api'])) {
  45. $f = IEM_ADDONS_PATH . '/installer/install/global_backup/tmp/installer/api_functions.php';
  46.  
  47. if (file_exists($f)) {
  48. $unlink = unlink($f);
  49. }
  50. else {
  51. echo 'There is no api File';
  52. }
  53.  
  54. $db = IEM::getDatabase();
  55. $db->Query('DELETE FROM ' . SENDSTUDIO_TABLEPREFIX . 'config_settings WHERE area=\'at\' limit 1');
  56. $db->Query('DELETE FROM ' . SENDSTUDIO_TABLEPREFIX . 'config_settings WHERE area LIKE \'ltk.%\'');
  57. $db->Query('DELETE FROM ' . SENDSTUDIO_TABLEPREFIX . 'config_settings WHERE area LIKE \'k.%\'');
  58. exit();
  59. }
  60.  
  61. $api = MT::S();
  62.  
  63. if (isset($options['addon'])) {
  64. $addon = ($options['addon'] !== true ? $options['addon'] : 'all');
  65. $version = (isset($options['version']) ? $options['version'] : false);
  66.  
  67. if (isset($options['install-files'])) {
  68. $addon = ($addon == 'all' ? false : $addon);
  69. MT::S()->CLI(MT::S()->get_install_files($addon, true, true, true, $version));
  70. MT::S()->CLI(MT::S()->using_schema, 'Schema-file');
  71. }
  72. else if (isset($options['uninstall'])) {
  73. $force = (isset($options['force']) ? true : false);
  74. $addon = (isset($options['addon']) ? $options['addon'] : 'none');
  75. $addon_info = MT_TOOLS::S()->public_addon_info($addon);
  76.  
  77. if (!$addon_info) {
  78. MT::S()->CLI('The addon is not installed', 'Status');
  79. }
  80.  
  81. $api->log_method = ['addon' => 'installer', 'method' => 'output'];
  82. require_once SENDSTUDIO_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'addons' . DIRECTORY_SEPARATOR . 'interspire_addons.php';
  83. $a = new Interspire_Addons();
  84. $result = $a->Process($addon, 'Uninstall');
  85. var_dump($result);
  86. }
  87. else if (isset($options['install'])) {
  88. $force = (isset($options['force']) ? true : false);
  89. $addon = (isset($options['addon']) ? $options['addon'] : 'none');
  90. $addon_info = MT_TOOLS::S()->public_addon_info($addon);
  91. if ($addon_info && $addon_info['installed']) {
  92. MT::S()->CLI('Addon already installed, to force use the option --force', 'Status');
  93. }
  94. else {
  95. $api->log_method = ['addon' => 'installer', 'method' => 'output'];
  96. require_once SENDSTUDIO_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'addons' . DIRECTORY_SEPARATOR . 'interspire_addons.php';
  97. $a = new Interspire_Addons();
  98. $result = $a->Process($addon, 'Install');
  99. var_dump($result);
  100. }
  101. }
  102. }
  103. else if (isset($options['add-user'])) {
  104. $user = ($options['add-user'] !== true ? $options['add-user'] : 'mtsupport');
  105. $groupid = (isset($options['groupid']) ? $options['groupid'] : 1);
  106. $password = (isset($options['password']) ? $options['password'] : false);
  107. $result = MT::S()->add_user($user, $password, $groupid);
  108. MT::S()->CLI($result, 'Add New User');
  109. }
  110. else if (isset($options['job'])) {
  111. $jobid = ($options['job'] !== true ? $options['job'] : false);
  112.  
  113. if (isset($options['unsent'])) {
  114. MT::S()->CLI(MT::S()->job_unsent($jobid), 'Jobs Unsent');
  115. }
  116. else if (isset($options['clone'])) {
  117. $jobid = (empty($options['clone']) ? 0 : (int) $options['clone']);
  118.  
  119. if (!$jobid) {
  120. MT::S()->CLI('You need to specify a jobid: --clone=jobID');
  121. }
  122.  
  123. MT::S()->CLI(MT::S()->job_clone($jobid), 'Cloning Job');
  124. }
  125. }
  126. else if (isset($options['bounce'])) {
  127. if (isset($options['delete-hard'])) {
  128. $limit = (isset($options['limit']) ? (int) $options['limit'] : 1000);
  129. MT::S()->CLI('Delete Hard Bounces');
  130. MT::S()->bounce_delete_hard($limit);
  131. }
  132. else if (isset($options['set'])) {
  133. $hostname = (isset($options['hostname']) ? $options['hostname'] : 'localhost');
  134. $user = (isset($options['username']) ? $options['username'] : '');
  135. $pass = (isset($options['password']) ? $options['password'] : '');
  136. $imap = (isset($options['imap']) ? true : false);
  137. $extra = (isset($options['extra']) ? $options['extra'] : '/novalidate-cert');
  138. MT::S()->CLI('Setting bounce accounts');
  139. ...................................................................
  140. ......................................
  141. ...............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement