removeuser.php 369 B

123456789101112131415161718
  1. <?php
  2. // Init owncloud
  3. require_once('../../lib/base.php');
  4. OC_JSON::checkAdminUser();
  5. OCP\JSON::callCheck();
  6. $username = $_POST["username"];
  7. // Return Success story
  8. if( OC_User::deleteUser( $username )){
  9. OC_JSON::success(array("data" => array( "username" => $username )));
  10. }
  11. else{
  12. OC_JSON::error(array("data" => array( "message" => "Unable to delete user" )));
  13. }