Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.03 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Loader)
  6. *
  7. * @ Version : 2.0.0.4
  8. * @ Author : DeZender
  9. * @ Release on : 21.10.2015
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. namespace MGModule\cpanel_extended_functions\controllers\admin {
  15.  
  16. class functions extends MGModule\cpanel_extended_functions\controllers\abstractController {
  17.  
  18. private static $features = array("emails" => array(0 => "emails", 1 => "emails_forwarders", 2 => "mx"), "login" => array(0 => "cpanel_login", 1 => "webmail_login", 2 => "phpmyadmin", 3 => "rvsitebuilderlogin", 4 => "fileslogin"), "domains" => array(0 => "forward_domains", 1 => "addon_domains", 2 => "subdomains", 3 => "parked_domains"), "statistics" => array(0 => "webalizer", 1 => "awstats", 2 => "analog", 3 => "lastvisitors"), "files" => array(0 => "ftp", 1 => "files", 2 => "backups", 3 => "automaticbackups"), "security" => array(0 => "manage_ssl", 1 => "ssh", 2 => "bans", 3 => "unbanonlogin", 4 => "change_password"), "others" => array(0 => "databases", 1 => "cron"));
  19. public function indexHTML($input, $vars = array()) {
  20.  
  21. $vars["products"] = MGModule\cpanel_extended_functions\mgLibs\MySQL::query("SELECT cpanel_extended_functions_settings.*, tblproducts.id AS pid, tblproducts.name AS product_name, tblproductgroups.name AS product_group FROM tblproducts
  22. INNER JOIN tblproductgroups ON tblproductgroups.id = tblproducts.gid
  23. LEFT JOIN cpanel_extended_functions_settings ON tblproducts.id = cpanel_extended_functions_settings.product_id
  24. WHERE tblproducts.servertype = \"cpanelExtended\"")->fetchAll();
  25. foreach ($vars["products"] as &$product)
  26. {
  27. $features_count = 0;
  28. foreach (self::$features as $items)
  29. {
  30. foreach ($items as $item)
  31. {
  32. if (($product[$item] == "on"))
  33. {
  34. ++$features_count;
  35. continue;
  36. }
  37. continue;
  38. }
  39. continue;
  40. }
  41. $product["features_count"] = $features_count;
  42. continue;
  43. }
  44. $vars["apps"] = MGModule\cpanel_extended_functions\mgLibs\custom\AppsHelper::getApps();
  45. return array("tpl" => "functions", "vars" => $vars);
  46. }
  47.  
  48. public function downloadHTML($input, $vars = array()) {
  49.  
  50. $temp_dir = sys_get_temp_dir();
  51. $iname = (int)$_GET["apps_list"] == 1 ? "softaculous.txt" : "installatron.txt";
  52. $apps = (int)$_GET["apps_list"] == 1 ? (MGModule\cpanel_extended_functions\mgLibs\custom\AppsHelper::getSoftaculousApps()) : (MGModule\cpanel_extended_functions\mgLibs\custom\AppsHelper::getInstallatronApps());
  53. $list = (int)$_GET["apps_list"] == 1 ? "SOFTACULPUS APPLICATIONS LIST\r
  54. " : "INSTALLATRON APPLICATIONS LIST\r
  55. ";
  56. $list .= "If you want to automatically install the latest version of the application then you have to use only application name without version number.\r
  57. ";
  58. $list .= "Please note that Option Name of Configurable Options must be \"Installation App\". In other case the entire functionality will not work (http://www.docs.modulesgarden.com/CPanel_Extended_For_WHMCS#Configurable_Options_For_Application_Auto_Install).\r
  59. \r
  60. ";
  61. $list .= str_pad("APP NAME WITH VERSION NUMBER", 40) . " | APP NAME WITHOUT VERSION NUMBER\r
  62. ";
  63. foreach ($apps as $l)
  64. {
  65. $lines[] = str_pad($l["name"] . " " . $l["version"], 40) . " | " . $l["name"] . "\r\n";
  66. continue;
  67. }
  68. sort($lines);
  69. foreach ($lines as $l)
  70. {
  71. $list .= $l;
  72. continue;
  73. }
  74. $tmpfname = tempnam($temp_dir, "al");
  75. $fp = fopen($tmpfname, "w");
  76. fwrite($fp, $list);
  77. fclose($fp);
  78. if (file_exists($tmpfname))
  79. {
  80. header("Content-Description: File Transfer");
  81. header("Content-Type: application/octet-stream");
  82. header("Content-Disposition: attachment; filename=\"" . $iname);
  83. header("Content-Transfer-Encoding: binary");
  84. header("Expires: 0");
  85. header("Cache-Control: must-revalidate");
  86. header("Pragma: public");
  87. header("Content-Length: " . filesize($tmpfname));
  88. ob_clean();
  89. flush();
  90. ..............................................................
  91. ........................
  92. .......
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement