Last active
December 21, 2015 00:39
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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