Skip to content

Instantly share code, notes, and snippets.

@niraj-shah
Last active December 21, 2015 00:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save niraj-shah/6221692 to your computer and use it in GitHub Desktop.
Save niraj-shah/6221692 to your computer and use it in GitHub Desktop.
Hide sensitive information from the default User class and returns data in json format
<?php
require_once( 'parse/parse.php' );
$parseQuery = new parseQuery('_User');
$result = $parseQuery->find();
foreach ( $result->results as $user ) {
unset( $user->email );
if ( isset( $user->authData->facebook ) ) {
unset( $user->authData->facebook->access_token );
}
}
// display the final data in json format
echo json_encode( $result );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment