X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Favatarsettings.php;h=ded419dd797a7c88d012a2b9b4a6ca6d0d4a9e25;hb=b55b2fa7d0667a635fad06af793ed00683f188b1;hp=c45514ff607a39b5cd192bd787d905d9e6b1d0d5;hpb=8236037bf0bff51d4bc623646454f39eec4bc6ec;p=quix0rs-gnu-social.git diff --git a/actions/avatarsettings.php b/actions/avatarsettings.php index c45514ff60..ded419dd79 100644 --- a/actions/avatarsettings.php +++ b/actions/avatarsettings.php @@ -1,6 +1,6 @@ . * * @category Settings - * @package Laconica - * @author Evan Prodromou - * @author Zach Copley - * @copyright 2008-2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou + * @author Zach Copley + * @copyright 2008-2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -42,12 +42,12 @@ define('MAX_ORIGINAL', 480); * We use jCrop plugin for jQuery to crop the image after upload. * * @category Settings - * @package Laconica - * @author Evan Prodromou - * @author Zach Copley - * @author Sarven Capadisli + * @package StatusNet + * @author Evan Prodromou + * @author Zach Copley + * @author Sarven Capadisli * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class AvatarsettingsAction extends AccountSettingsAction @@ -362,13 +362,13 @@ class AvatarsettingsAction extends AccountSettingsAction $profile = $user->getProfile(); $avatar = $profile->getOriginalAvatar(); - $avatar->delete(); + if($avatar) $avatar->delete(); $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); - $avatar->delete(); + if($avatar) $avatar->delete(); $avatar = $profile->getAvatar(AVATAR_STREAM_SIZE); - $avatar->delete(); + if($avatar) $avatar->delete(); $avatar = $profile->getAvatar(AVATAR_MINI_SIZE); - $avatar->delete(); + if($avatar) $avatar->delete(); $this->showForm(_('Avatar deleted.'), true); } @@ -399,5 +399,7 @@ class AvatarsettingsAction extends AccountSettingsAction $this->script('js/jcrop/jquery.Jcrop.min.js'); $this->script('js/jcrop/jquery.Jcrop.go.js'); } + + $this->autofocus('avatarfile'); } }