Saint92

Cpanel Creator with accesshash

Nov 3rd, 2015
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.22 KB | None | 0 0
  1. <?php
  2. set_time_limit(0);
  3. $whm_interface_path = '/usr/local/cpanel/Cpanel/Accounting.php.inc';
  4. function getVar($name, $def = '') {
  5.   if (isset($_REQUEST[$name]))
  6.     return $_REQUEST[$name];
  7.   else
  8.     return $def;
  9. }
  10. ?>
  11.  
  12. <?php
  13. $host = "88.198.6.198";
  14. $user = "tbrfhakd";
  15. $accesshash = 'hash';
  16. require_once $whm_interface_path;
  17. $accts = listpkgs($host,$user,$accesshash,1);
  18. ?>
  19.  
  20. <html>
  21. <title>Cpanel Account Creator</title>
  22. <body style="background-color:black"></body></html>
  23. <head>
  24. <font color=white><b>Cpanel account creator v2.2</b></font>
  25. <br/>
  26. <br/>
  27. <form method="post">
  28.  <table border="0">
  29. <tr><td><font color=white>Domain:</font></td><td><input style="color:lime;background-color:#000000" name="domain" value=""></td></tr>
  30. <tr><td><font color=white>Username:</font></td><td><input style="color:lime;background-color:#000000" name="username" value=""></td></tr>
  31. </table>
  32. <br/><font color=white>Package:</font>
  33. <br/>
  34. <select
  35. style="color:lime;background-color:#000000" name="package">
  36. <?php
  37. foreach ($accts as $key => $value){
  38. echo '<option> '.$key.' </option>';
  39. }
  40. ?>
  41. </select>
  42. <br/><p>
  43. <input style="color:lime;background-color:#000000" type="submit" value="Create Account"></form>
  44.  
  45. <?php
  46. set_time_limit(0);
  47. if (!isset($user_domain)) {
  48.   $user_domain = getVar('domain');
  49. }
  50.  
  51. // Username of the new hosting account
  52. if (!isset($user_name)) {
  53.   $user_name = getVar('username');
  54. }
  55.  
  56. // Password for the new hosting account
  57. if (!isset($user_pass)) {
  58.   $user_pass = getVar('password');
  59. }
  60.  
  61. // Package for the new hosting account
  62. if (!isset($user_plan)) {
  63.   $user_plan = getVar('package');
  64. }
  65.  
  66. if (!file_exists($whm_interface_path)) {
  67.   die($whm_interface_path . " does not exist. Please update program with correct path to your WHM interface file.");
  68. }
  69.  
  70. // if parameters passed then create account
  71. if (!empty($user_name)) {
  72.   // load cPanel WHM interface functions
  73.   require_once $whm_interface_path;
  74.  
  75.   // create account on the cPanel server
  76.   $my = createacct ($host,$user,$accesshash,1,$user_domain,$user_name,$user_pass,$user_plan);
  77. $oke = explode('|', $my);
  78. $gembok = implode('<br/>|', $oke);
  79. $cret = '<br/><font color="lime">'.$gembok.'</font>';
  80.  
  81.   // output result
  82.   echo "$cret";
  83. }
  84. ?>
Advertisement
Add Comment
Please, Sign In to add comment