From: Chimo Date: Sat, 4 Jun 2016 14:52:49 +0000 (+0000) Subject: WIP: Display error if wrong perms on 'avatar' dir X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c81322d51af47535818e84336c40321602d4dad3;p=quix0rs-gnu-social.git WIP: Display error if wrong perms on 'avatar' dir If the 'avatar' folder isn't writeable, don't let users try to upload/delete one (and fail). Instead, print an error message about the misconfigured folder permission. Ref. #196 --- diff --git a/actions/avatarsettings.php b/actions/avatarsettings.php index f77339ad70..6c9f3fc3d0 100644 --- a/actions/avatarsettings.php +++ b/actions/avatarsettings.php @@ -49,6 +49,20 @@ class AvatarsettingsAction extends SettingsAction var $imagefile = null; var $filename = null; + function prepare(array $args=array()) + { + $avatarpath = Avatar::path(''); + + if (!is_writable($avatarpath)) { + throw new Exception(_("The administrator of your site needs to + add write permissions on the avatar upload folder before + you're able to set one.")); + } + + parent::prepare($args); + return true; + } + /** * Title of the page *