Advertisement
Newbie4rt-ID

Script cPanel Account Creator

Oct 21st, 2014
829
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.01 KB | None | 0 0
  1. <?php
  2.  
  3. ###################################################################################################
  4. # cPanel Account Creator 1.1
  5. ###################################################################################################
  6. # Visit http://jamvanhax0r.heck.in/ and http://wap-jamvan.us.to/ Kalo Mau Tau Update'an Selanjut'y
  7. ###################################################################################################
  8. # Required parameters:
  9. # - domain - new account domain
  10. # - user - new account username
  11. # - password - new account password
  12. # - package - new account hosting package (plan)
  13. # - email - contact email
  14. #
  15. # Sample run: namafileente.php?domain=domainwhm.com&user=usernamewhm&password=passwhm&package=packagewhm_ente
  16. #
  17. # If no parameters passed then input form will be shown to enter data.
  18. #
  19. # This script can also be run from another PHP script. This may
  20. # be helpful if you have some user interface already in place and
  21. # want to automatically create WHM accounts from there.
  22. # In this case you have to setup following variables instead of
  23. # passing them as parameters:
  24. # - $user_domain - new account domain
  25. # - $user_name - new account username
  26. # - $user_pass - new account password
  27. # - $user_plan - new account hosting package (plan)
  28. # - $user_email - contact email
  29. #
  30. ###############################################################
  31.  
  32. ///////  YOUR WHM LOGIN DATA
  33. $whm_user   = "ISI DENGAN USER WHM";      // reseller username
  34. $whm_pass   = "ISI DENGAN PASS WHM";  // the password you use to login to WHM
  35.  
  36. #####################################################################################
  37. ##############          END OF SETTINGS. DO NOT EDIT BELOW    #######################
  38. #####################################################################################
  39.  
  40. $whm_host   = $_SERVER['HTTP_HOST'];
  41.  
  42. function getVar($name, $def = '') {
  43.   if (isset($_REQUEST[$name]))
  44.     return $_REQUEST[$name];
  45.   else
  46.     return $def;
  47. }
  48.  
  49. // Domain name of new hosting account
  50. // To create subdomain just pass full subdomain name
  51. // Contoh: jamvan.hax0r.com
  52. if (!isset($user_domain)) {
  53.   $user_domain = getVar('domain');
  54. }
  55.  
  56. // Username of the new hosting account
  57. if (!isset($user_name)) {
  58.   $user_name = getVar('user');
  59. }
  60.  
  61. // Password for the new hosting account
  62. if (!isset($user_pass)) {
  63.   $user_pass = getVar('password');
  64. }
  65.  
  66. // New hosting account Package
  67. if (!isset($user_plan)) {
  68.   $user_plan = getVar('package');
  69. }
  70.  
  71. // Contact email
  72. if (!isset($user_email)) {
  73.   $user_email = getVar('email');
  74. }
  75.  
  76. // if parameters passed then create account
  77. if (!empty($user_name)) {
  78.  
  79.   // create account on the cPanel server
  80.   $script = "http://{$whm_user}:{$whm_pass}@{$whm_host}:2086/scripts/wwwacct";
  81.   $params = "?plan={$user_plan}&domain={$user_domain}&username={$user_name}&password={$user_pass}&contactemail={$user_email}";
  82.   $result = file_get_contents($script.$params);
  83.  
  84.   // output result
  85.   echo "RESULT: " . $result;
  86. }
  87. // otherwise show input form
  88. else {
  89. $frm = <<<EOD
  90. <html>
  91. <head>
  92.   <title>cPanel Account Creator</title>
  93.   <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
  94.   <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
  95. </head>
  96. <body>
  97.   <style>
  98.     input { border: 1px solid black; }
  99.   </style>
  100. <form method="post">
  101. <h3>cPanel Account Creator</h3>
  102. <table border="0">
  103. <tr><td>Domain:</td><td><input name="domain" size="30"></td><td>Masukan Domain Tanpa http:// and [ www ]</td></tr>
  104. <tr><td>Username:</td><td><input name="user" size="30"></td><td>Username cPanel Ente</td></tr>
  105. <tr><td>Password:</td><td><input name="password" size="30"></td><td>Bebas [ Pakai Angka, Symbol, etc... ]</td></tr>
  106. <tr><td></td><td><input type="hidden" name="package" size="30"value="ISI DENGAN PACKAGE WHM ENTE"></td><td></td></tr>
  107. <tr><td>Contact Email:</td><td><input name="email" size="30"value="emailente@yahoo.com"></td><td>Jangan Lupa, Email :v</td></tr>
  108. <tr><td colspan="3"><br /><input type="submit" value="Hajar Cok !"></td></tr>
  109. </table>
  110. </form>
  111. </body>
  112. </html>
  113. EOD;
  114. echo $frm;
  115. }
  116.  
  117. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement