Teknik is a suite of services with attractive and functional interfaces. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

delete_account.php 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. require_once('config.php');
  3. //check to see that the form has been submitted
  4. if(isset($_POST))
  5. {
  6. //delete user from mail-server
  7. $obBaseApp = new COM("hMailServer.Application");
  8. $obBaseApp->Connect();
  9. $obBaseApp->Authenticate($CONF['mail_admin_user'], $CONF['mail_admin_pass']);
  10. $domain = $obBaseApp->Domains->ItemByName($CONF['host']);
  11. $email = $user->username . "@" . $CONF['host'];
  12. $account = $domain->Accounts->ItemByAddress($email);
  13. $account->Delete();
  14. // delete user from git database
  15. $result = CallAPI("POST", get_page_url('git', $CONF)."/user/settings/delete", $user->username, $user->password, array("_csrf" => $CONF['git_csrf']));
  16. if($result)
  17. {
  18. echo $result;
  19. }
  20. /*
  21. $r = new minecraftRcon($CONF['minecraft_server'], $CONF['rcon_port'], $CONF['rcon_pass']);
  22. // Authenticate, and if so, execute command(s)
  23. if ( $r->Auth() ) {
  24. $r->mcRconCommand('pex user '.$user->minecraft_user." group remove Member");
  25. }
  26. */
  27. //delete the user from the main database
  28. $user->delete($db);
  29. //log the user out
  30. $userTools->logout($CONF);
  31. echo "true";
  32. }
  33. else
  34. {
  35. echo "false";
  36. }
  37. ?>