Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

recovery.php-disabled 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. /*
  3. phpVirtualBox admin password recovery.
  4. Rename recovery.php-disabled to recovery.php, navigate to it in your web
  5. browser and follow the instructions presented.
  6. */
  7. # Turn off PHP errors
  8. error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_WARNING);
  9. //Set no caching
  10. header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
  11. header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
  12. header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
  13. header("Pragma: no-cache");
  14. require_once(dirname(__FILE__).'/endpoints/lib/config.php');
  15. require_once(dirname(__FILE__).'/endpoints/lib/utils.php');
  16. require_once(dirname(__FILE__).'/endpoints/lib/vboxconnector.php');
  17. /*
  18. * Clean request
  19. */
  20. $vboxRequest = clean_request();
  21. /* Check for recovery */
  22. if($vboxRequest['recover']) {
  23. try {
  24. // Use main / auth server
  25. $vbox = new vboxconnector(true);
  26. $vbox->skipSessionCheck = true;
  27. $vbox->connect();
  28. $vbox->vbox->setExtraData('phpvb/users/admin/pass', hash('sha512', 'admin'));
  29. $vbox->vbox->setExtraData('phpvb/users/admin/admin', '1');
  30. echo("Admin account updated. Please rename this file to <b>recovery.php-disabled</b>. phpVirtualBox will refuse to run if this has not been done.");
  31. } catch (Exception $e) {
  32. echo("<pre>");
  33. print_r($e);
  34. echo("</pre>");
  35. }
  36. return;
  37. }
  38. ?>
  39. <html>
  40. <head>
  41. <title>Admin Account Recovery</title>
  42. </head>
  43. <body>
  44. <h3>Admin Account Recovery</h3>
  45. <p>This form will add the default user <b>admin</b> with a default password of <b>admin</b>. If the user <b>admin</b> already exists, its password will be changed to <b>admin</b>.</p>
  46. <p>Click the Recover button to add / update this user.</p>
  47. <form method='POST'>
  48. <p>
  49. <input type='hidden' name='recover' value='1' />
  50. <input type='submit' value='Recover' />
  51. </p>
  52. </form>
  53. </body>
  54. </html>