diff --git a/Web/Presenters/UserPresenter.php b/Web/Presenters/UserPresenter.php index 42bb4f1d..9cfa3654 100644 --- a/Web/Presenters/UserPresenter.php +++ b/Web/Presenters/UserPresenter.php @@ -334,11 +334,14 @@ final class UserPresenter extends OpenVKPresenter $post->setFlags($flags); $post->save(); $post->attach($photo); - - $this->returnJson([ - "url" => $photo->getURL(), - "id" => $photo->getPrettyId() - ]); + if($this->postParam("ava", true) == (int)1) { + $this->returnJson([ + "url" => $photo->getURL(), + "id" => $photo->getPrettyId() + ]); + } else { + $this->flashFail("succ", tr("photo_saved"), tr("photo_saved_comment")); + } } function renderSettings(): void diff --git a/Web/Presenters/templates/Group/View.xml b/Web/Presenters/templates/Group/View.xml index 15c03145..6cfca77b 100644 --- a/Web/Presenters/templates/Group/View.xml +++ b/Web/Presenters/templates/Group/View.xml @@ -98,17 +98,17 @@ {var $avatarLink = ((is_null($avatarPhoto) ? FALSE : $avatarPhoto->isAnonymous()) ? "/photo" . ("s/" . base_convert((string) $avatarPhoto->getId(), 10, 32)) : $club->getAvatarLink())}
${tr('troubles_avatar')}
-${tr("deleting_avatar_sure")}
@@ -516,7 +517,7 @@ function deleteAvatar(avatar, hash) location.reload() } xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); - xhr.send("hash="+hash) + xhr.send("hash="+u("meta[name=csrf]").attr("value")) }), (function() { u("#tmpPhDelF").remove();