Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PoC] Allow to uplod avatars via a public API #20072

Closed
wants to merge 1 commit into from

Conversation

rullzer
Copy link
Member

@rullzer rullzer commented Mar 20, 2020

Fixes #10549

  • Avatar must be sqaure
  • POST must be done using a mutlipart form
  • Key is avatar

Signed-off-by: Roeland Jago Douma roeland@famdouma.nl

Fixes #10549

* Avatar must be sqaure
* POST must be done using a mutlipart form
* Key is avatar

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@rullzer rullzer added this to the Nextcloud 19 milestone Mar 20, 2020
@rullzer rullzer requested a review from nickvergessen March 20, 2020 21:49
// TODO: Return link to avatar?
}

public function deleteAvatar(string $userId): DataResponse {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NoAdminRequired

$currentLoggedInUser = $this->userSession->getUser();

$targetUser = $this->userManager->get($userId);
if ($targetUser === null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be needed as you have to be logged in?

$currentLoggedInUser = $this->userSession->getUser();

$targetUser = $this->userManager->get($userId);
if ($targetUser === null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments from above method

This was referenced Apr 4, 2020
@rullzer rullzer modified the milestones: Nextcloud 19, Nextcloud 20 Apr 10, 2020

$file = $this->request->getUploadedFile('avatar');

if ($file['size'] > 20 * 1024 * 1024) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would love to have this as a const somewhere :)

* @NoAdminRequired
*/
public function getAvatar(string $userId): DataResponse {
// TODO: Return link to avatar?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes! Cleaner :)
Optional parameter with size?

@MorrisJobke MorrisJobke mentioned this pull request Aug 11, 2020
57 tasks
@rullzer rullzer modified the milestones: Nextcloud 20, Nextcloud 21 Aug 11, 2020
@rullzer rullzer closed this Nov 9, 2020
@skjnldsv skjnldsv deleted the enh/ocs_avatar_api branch March 14, 2024 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "public" OCS endpoint to manage the avatar
3 participants