mirror of
https://github.com/pierre42100/ComunicAPI
synced 2025-06-19 08:35:18 +00:00
Can export user information
This commit is contained in:
@ -277,6 +277,46 @@ class AccountComponent {
|
||||
return crypt(sha1($userPassword), sha1($userPassword));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user account data (full export)
|
||||
*
|
||||
* @param int $userID Target user ID
|
||||
* @return array Information about the user
|
||||
*/
|
||||
public function export(int $userID) : array {
|
||||
|
||||
$data = array();
|
||||
|
||||
//General account information
|
||||
$data["advanced_info"] = components()->user->getUserAdvancedInfo($userID);
|
||||
|
||||
//Posts list (with comments)
|
||||
$data["posts"] = components()->posts->getUserEntirePostsList($userID, TRUE);
|
||||
|
||||
//Comments list
|
||||
$data["comments"] = components()->comments->getAllUser($userID);
|
||||
|
||||
//Likes
|
||||
$data["likes"] = components()->likes->get_all_user($userID);
|
||||
|
||||
//Survey responses
|
||||
$data["survey_responses"] = components()->survey->get_all_responses($userID);
|
||||
|
||||
//User movies
|
||||
$data["movies"] = components()->movies->get_list($userID);
|
||||
|
||||
//Conversation messages
|
||||
$data["conversation_messages"] = components()->conversations->getAllUserMessages($userID);
|
||||
|
||||
//Conversations list
|
||||
$data["conversations_list"] = components()->conversations->getList($userID);
|
||||
|
||||
//Friend list
|
||||
$data["friends_list"] = components()->friends->getList($userID);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete user account
|
||||
*
|
||||
|
Reference in New Issue
Block a user