Remove Gravatar support
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 19 May 2022 12:10:00 +0000 (14:10 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Fri, 5 Aug 2022 12:19:57 +0000 (14:19 +0200)
Resolves #3894

22 files changed:
com.woltlab.wcf/option.xml
com.woltlab.wcf/templates/avatarEdit.tpl
constants.php
wcfsetup/install/files/acp/database/update_com.woltlab.wcf_5.6.php
wcfsetup/install/files/acp/templates/userAdd.tpl
wcfsetup/install/files/lib/acp/action/UserExportGdprAction.class.php
wcfsetup/install/files/lib/acp/form/UserEditForm.class.php
wcfsetup/install/files/lib/action/GravatarDownloadAction.class.php [deleted file]
wcfsetup/install/files/lib/data/user/User.class.php
wcfsetup/install/files/lib/data/user/UserProfile.class.php
wcfsetup/install/files/lib/data/user/UserProfileAction.class.php
wcfsetup/install/files/lib/data/user/avatar/Gravatar.class.php [deleted file]
wcfsetup/install/files/lib/data/user/avatar/UserAvatarAction.class.php
wcfsetup/install/files/lib/data/user/follow/UserFollowerList.class.php
wcfsetup/install/files/lib/data/user/profile/visitor/UserProfileVisitorList.class.php
wcfsetup/install/files/lib/form/AvatarEditForm.class.php
wcfsetup/install/files/lib/form/RegisterForm.class.php
wcfsetup/install/files/lib/system/WCF.class.php
wcfsetup/install/files/lib/system/condition/UserAvatarCondition.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml
wcfsetup/setup/db/install.sql

index cf9b740e208a8be54e7d4b9eaf5eb088cc9b6784..ac5ce8dd271fbc2a7ef61ca1ff6b60d6480c98a2 100644 (file)
                                <optiontype>boolean</optiontype>
                                <defaultvalue>1</defaultvalue>
                        </option>
-                       <option name="module_gravatar">
-                               <categoryname>module.user</categoryname>
-                               <optiontype>boolean</optiontype>
-                               <defaultvalue>0</defaultvalue>
-                       </option>
                        <option name="module_users_online">
                                <categoryname>module.user</categoryname>
                                <optiontype>boolean</optiontype>
@@ -1188,17 +1183,6 @@ XING</selectoptions>
                                <defaultvalue>initials</defaultvalue>
                                <selectoptions>initials:wcf.acp.option.avatar_default_type.initials
 silhouette:wcf.acp.option.avatar_default_type.silhouette</selectoptions>
-                       </option>
-                       <option name="gravatar_default_type">
-                               <categoryname>user.avatar</categoryname>
-                               <optiontype>select</optiontype>
-                               <defaultvalue>404</defaultvalue>
-                               <options>module_gravatar</options>
-                               <selectoptions>404:wcf.acp.option.gravatar_default_type.404
-identicon:wcf.acp.option.gravatar_default_type.identicon
-wavatar:wcf.acp.option.gravatar_default_type.wavatar
-monsterid:wcf.acp.option.gravatar_default_type.monsterid
-retro:wcf.acp.option.gravatar_default_type.retro</selectoptions>
                        </option>
                        <!-- /user.avatar -->
                        <!-- user.signature -->
@@ -1642,5 +1626,7 @@ DESC:wcf.global.sortOrder.descending</selectoptions>
                <option name="desktop_notification_package_id"/>
                <option name="http_send_x_frame_options"/>
                <option name="cache_source_memcached_host"/>
+               <option name="module_gravatar"/>
+               <option name="gravatar_default_type"/>
        </delete>
 </data>
index 8b32e76e495f2f91d729b452abe89b0c5b891102..3fa2e7ee1c168a238c1ca4463fa20d49afdc56b4 100644 (file)
                        </dl>
                {/if}
                
-               {if MODULE_GRAVATAR}
-                       <dl class="avatarType{if $errorField == 'gravatar'} formError{/if}">
-                               <dt><img src="https://secure.gravatar.com/avatar/{@$__wcf->user->email|strtolower|md5}?s=96{if GRAVATAR_DEFAULT_TYPE != '404'}&amp;d={@GRAVATAR_DEFAULT_TYPE}{/if}" alt="" class="userAvatarImage icon96"></dt>
-                               <dd>
-                                       <label><input type="radio" name="avatarType" value="gravatar"{if $avatarType == 'gravatar'} checked{/if}> {lang}wcf.user.avatar.type.gravatar{/lang}</label>
-                                       {if $errorField == 'gravatar'}
-                                               <small class="innerError">
-                                                       {if $errorType == 'notFound'}{lang}wcf.user.avatar.type.gravatar.error.notFound{/lang}{/if}
-                                               </small>
-                                       {/if}
-                                       <small>{lang}wcf.user.avatar.type.gravatar.description{/lang}</small>
-                               </dd>
-                       </dl>
-               {/if}
-               
                {event name='avatarFields'}
        </div>
                
index 59ab3ba6cbc2c039f333b14345cca18e4b7a0037..7448e7fb6192c2e5491d530f03cd6c2cf86e43b3 100644 (file)
@@ -29,7 +29,6 @@
 \define('MODULE_COOKIE_POLICY_PAGE', 1);
 \define('MODULE_ATTACHMENT', 1);
 \define('MODULE_SMILEY', 1);
-\define('MODULE_GRAVATAR', 1);
 \define('MODULE_USERS_ONLINE', 1);
 \define('MODULE_USER_RANK', 1);
 \define('MODULE_USER_SIGNATURE', 1);
 \define('FACEBOOK_PRIVATE_KEY', '');
 \define('GOOGLE_PUBLIC_KEY', '');
 \define('GOOGLE_PRIVATE_KEY', '');
-\define('GRAVATAR_DEFAULT_TYPE', '404');
 \define('SIGNATURE_MAX_IMAGE_HEIGHT', 150);
 \define('USER_TITLE_MAX_LENGTH', 25);
 \define('USER_FORBIDDEN_TITLES', '');
index 71e99b617172dbd48dfd571bba0051e9c6482fdd..90fcdb3f7ca8cd6e96679adb96959418e1304b30 100644 (file)
@@ -51,4 +51,11 @@ return [
         ->columns([
             NotNullInt10DatabaseTableColumn::create('packageID'),
         ]),
+    PartialDatabaseTable::create('wcf1_user')
+        ->columns([
+            TinyintDatabaseTableColumn::create('enableGravatar')
+                ->drop(),
+            VarcharDatabaseTableColumn::create('gravatarFileExtension')
+                ->drop(),
+        ]),
 ];
index 8e074d6de93bb87ae1a40a74ec4867dd6c5a3faa..11ab69555b25c6f11b4cb231a8b7d8a5172c3f88 100644 (file)
                                                </dd>
                                        </dl>
 
-                                       {if MODULE_GRAVATAR}
-                                               <dl class="avatarType{if $errorType[gravatar]|isset} formError{/if}">
-                                                       <dt><img src="https://secure.gravatar.com/avatar/{@$user->email|strtolower|md5}?s=96{if GRAVATAR_DEFAULT_TYPE != '404'}&amp;d={@GRAVATAR_DEFAULT_TYPE}{/if}" alt="" class="userAvatarImage icon96"></dt>
-                                                       <dd>
-                                                               <label><input type="radio" name="avatarType" value="gravatar"{if $avatarType == 'gravatar'} checked{/if}> {lang}wcf.user.avatar.type.gravatar{/lang}</label>
-
-                                                               {if $errorType[gravatar]|isset}
-                                                                       <small class="innerError">
-                                                                               {if $errorType[gravatar] == 'notFound'}{lang}wcf.user.avatar.type.gravatar.error.notFound{/lang}{/if}
-                                                                       </small>
-                                                               {/if}
-                                                       </dd>
-                                               </dl>
-                                       {/if}
-
                                        {event name='avatarFields'}
                                </section>
 
index 299a19cf7a117d6f8bdc61cb5c0a0b2903dfab2e..cbe3df275543b8afdfb5fea3324d123ea0467dc9 100644 (file)
@@ -351,7 +351,7 @@ class UserExportGdprAction extends AbstractAction
             }
         }
 
-        if ($this->user->avatarID || $this->user->enableGravatar) {
+        if ($this->user->avatarID) {
             $data['avatarURL'] = $this->user->getAvatar()->getURL();
         }
 
index 71fc12bed59271ec4a14f6b922bf0582ec2c583f..a2c92cd2c31219120e5cb9f06e9a26680cd85e14 100755 (executable)
@@ -3,7 +3,6 @@
 namespace wcf\acp\form;
 
 use wcf\data\style\Style;
-use wcf\data\user\avatar\Gravatar;
 use wcf\data\user\avatar\UserAvatar;
 use wcf\data\user\avatar\UserAvatarAction;
 use wcf\data\user\cover\photo\UserCoverPhoto;
@@ -340,8 +339,6 @@ class UserEditForm extends UserAddForm
 
         if ($this->user->avatarID) {
             $this->avatarType = 'custom';
-        } elseif (MODULE_GRAVATAR && $this->user->enableGravatar) {
-            $this->avatarType = 'gravatar';
         }
     }
 
@@ -394,26 +391,10 @@ class UserEditForm extends UserAddForm
         }
 
         $avatarData = [];
-        switch ($this->avatarType) {
-            case 'none':
-                $avatarData = [
-                    'avatarID' => null,
-                    'enableGravatar' => 0,
-                ];
-                break;
-
-            case 'custom':
-                $avatarData = [
-                    'enableGravatar' => 0,
-                ];
-                break;
-
-            case 'gravatar':
-                $avatarData = [
-                    'avatarID' => null,
-                    'enableGravatar' => 1,
-                ];
-                break;
+        if ($this->avatarType === 'none') {
+            $avatarData = [
+                'avatarID' => null,
+            ];
         }
 
         $this->additionalFields = \array_merge($this->additionalFields, $avatarData);
@@ -597,7 +578,7 @@ class UserEditForm extends UserAddForm
      */
     protected function validateAvatar()
     {
-        if ($this->avatarType != 'custom' && $this->avatarType != 'gravatar') {
+        if ($this->avatarType != 'custom') {
             $this->avatarType = 'none';
         }
 
@@ -608,17 +589,6 @@ class UserEditForm extends UserAddForm
                         throw new UserInputException('customAvatar');
                     }
                     break;
-
-                case 'gravatar':
-                    if (!MODULE_GRAVATAR) {
-                        $this->avatarType = 'none';
-                        break;
-                    }
-
-                    // test gravatar
-                    if (!Gravatar::test($this->user->email)) {
-                        throw new UserInputException('gravatar', 'notFound');
-                    }
             }
         } catch (UserInputException $e) {
             $this->errorType[$e->getField()] = $e->getType();
diff --git a/wcfsetup/install/files/lib/action/GravatarDownloadAction.class.php b/wcfsetup/install/files/lib/action/GravatarDownloadAction.class.php
deleted file mode 100644 (file)
index ea4e6b3..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-<?php
-
-namespace wcf\action;
-
-use wcf\data\user\avatar\Gravatar;
-use wcf\data\user\avatar\UserAvatar;
-use wcf\data\user\User;
-use wcf\data\user\UserEditor;
-use wcf\system\exception\IllegalLinkException;
-use wcf\system\exception\SystemException;
-use wcf\util\FileUtil;
-use wcf\util\HTTPRequest;
-
-/**
- * Downloads and caches gravatars.
- *
- * @author  Marcel Werk
- * @copyright   2001-2019 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package WoltLabSuite\Core\Action
- * @deprecated 5.4 Gravatar is questionable from a privacy perspective.
- */
-class GravatarDownloadAction extends AbstractAction
-{
-    /**
-     * user id
-     * @var int
-     */
-    public $userID = 0;
-
-    /**
-     * user object
-     * @var User
-     */
-    public $user;
-
-    /**
-     * avatar size
-     * @var int
-     */
-    public $size = UserAvatar::AVATAR_SIZE;
-
-    /**
-     * @inheritDoc
-     */
-    public function readParameters()
-    {
-        parent::readParameters();
-
-        if (isset($_REQUEST['userID'])) {
-            $this->userID = \intval($_REQUEST['userID']);
-        }
-        $this->user = new User($this->userID);
-        if (!$this->user->userID) {
-            throw new IllegalLinkException();
-        }
-    }
-
-    /**
-     * @inheritDoc
-     */
-    public function execute()
-    {
-        parent::execute();
-
-        if ($this->user->enableGravatar && MODULE_GRAVATAR) {
-            $fileExtension = ($this->user->gravatarFileExtension ?: 'png');
-
-            // try to use cached gravatar
-            $cachedFilename = \sprintf(
-                Gravatar::GRAVATAR_CACHE_LOCATION,
-                \md5(\mb_strtolower($this->user->email)),
-                $this->size,
-                $fileExtension
-            );
-            if (\file_exists(WCF_DIR . $cachedFilename) && \filemtime(WCF_DIR . $cachedFilename) > (TIME_NOW - (Gravatar::GRAVATAR_CACHE_EXPIRE * 86400))) {
-                @\header('Content-Type: image/png');
-                @\readfile(WCF_DIR . $cachedFilename);
-
-                exit;
-            }
-
-            // try to download new version
-            $gravatarURL = \sprintf(
-                Gravatar::GRAVATAR_BASE,
-                \md5(\mb_strtolower($this->user->email)),
-                $this->size,
-                GRAVATAR_DEFAULT_TYPE
-            );
-            try {
-                $request = new HTTPRequest($gravatarURL);
-                $request->execute();
-                $reply = $request->getReply();
-
-                // get mime type and file extension
-                $fileExtension = 'png';
-                $mimeType = 'image/png';
-                if (isset($reply['headers']['Content-Type'])) {
-                    switch ($reply['headers']['Content-Type']) {
-                        case 'image/jpeg':
-                            $mimeType = 'image/jpeg';
-                            $fileExtension = 'jpg';
-                            break;
-                        case 'image/gif':
-                            $mimeType = 'image/gif';
-                            $fileExtension = 'gif';
-                            break;
-                    }
-                }
-
-                // save file
-                $cachedFilename = \sprintf(
-                    Gravatar::GRAVATAR_CACHE_LOCATION,
-                    \md5(\mb_strtolower($this->user->email)),
-                    $this->size,
-                    $fileExtension
-                );
-                \file_put_contents(WCF_DIR . $cachedFilename, $reply['body']);
-                FileUtil::makeWritable(WCF_DIR . $cachedFilename);
-
-                // update file extension
-                if ($fileExtension != $this->user->gravatarFileExtension) {
-                    $editor = new UserEditor($this->user);
-                    $editor->update([
-                        'gravatarFileExtension' => $fileExtension,
-                    ]);
-                }
-
-                @\header('Content-Type: ' . $mimeType);
-                @\readfile(WCF_DIR . $cachedFilename);
-
-                exit;
-            } catch (SystemException $e) {
-                // disable gravatar
-                $editor = new UserEditor($this->user);
-                $editor->update([
-                    'enableGravatar' => 0,
-                ]);
-            }
-        }
-
-        // fallback to default avatar
-        @\header('Content-Type: image/svg+xml');
-        @\readfile(WCF_DIR . 'images/avatars/avatar-default.svg');
-
-        exit;
-    }
-}
index 97c8227651133744972cefb7cbc81cb6a835fbb5..6929146e63d4d5791a919e276e8379af63ae0a4f 100644 (file)
@@ -52,8 +52,6 @@ use wcf\util\UserUtil;
  * @property-read   int $disableAvatar          is `1` if the user's avatar has been disabled, otherwise `0`
  * @property-read   string $disableAvatarReason        reason why the user's avatar is disabled
  * @property-read   int $disableAvatarExpires       timestamp at which the user's avatar will automatically be enabled again
- * @property-read   int $enableGravatar         is `1` if the user uses a gravatar as avatar, otherwise `0`
- * @property-read   string $gravatarFileExtension      extension of the user's gravatar file
  * @property-read   string $signature          text of the user's signature
  * @property-read   int $signatureEnableHtml        is `1` if HTML will rendered in the user's signature, otherwise `0`
  * @property-read   int $disableSignature       is `1` if the user's signature has been disabled, otherwise `0`
index 700d7085d7025af0fa60c86c13097b06b98280c5..cda14553dba807301fe89a9f0ab77c271a6cc035 100644 (file)
@@ -8,7 +8,6 @@ use wcf\data\trophy\Trophy;
 use wcf\data\trophy\TrophyCache;
 use wcf\data\user\avatar\AvatarDecorator;
 use wcf\data\user\avatar\DefaultAvatar;
-use wcf\data\user\avatar\Gravatar;
 use wcf\data\user\avatar\IUserAvatar;
 use wcf\data\user\avatar\UserAvatar;
 use wcf\data\user\cover\photo\DefaultUserCoverPhoto;
@@ -363,12 +362,6 @@ class UserProfile extends DatabaseObjectDecorator implements ITitledLinkObject
                         } else {
                             $this->avatar = new UserAvatar(null, $this->getDecoratedObject()->data);
                         }
-                    } elseif (MODULE_GRAVATAR && $this->enableGravatar) {
-                        $this->avatar = new Gravatar(
-                            $this->userID,
-                            $this->email,
-                            ($this->gravatarFileExtension ?: 'png')
-                        );
                     } else {
                         $parameters = ['avatar' => null];
                         EventHandler::getInstance()->fireAction($this, 'getAvatar', $parameters);
index 250a933b023e61963409321748d79e2c3515da9c..7243279ad39adb580fef331aecea9c2e75d2e0fb 100644 (file)
@@ -636,7 +636,6 @@ class UserProfileAction extends UserAction implements IPopoverAction
             $userEditor = new UserEditor($user->getDecoratedObject());
             $userEditor->update([
                 'avatarID' => $avatar->avatarID,
-                'enableGravatar' => 0,
             ]);
         } catch (\Exception $e) {
             $editor = new UserAvatarEditor($avatar);
diff --git a/wcfsetup/install/files/lib/data/user/avatar/Gravatar.class.php b/wcfsetup/install/files/lib/data/user/avatar/Gravatar.class.php
deleted file mode 100644 (file)
index 8b3d5fb..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-<?php
-
-namespace wcf\data\user\avatar;
-
-use GuzzleHttp\Psr7\Request;
-use Psr\Http\Client\ClientExceptionInterface;
-use wcf\system\io\HttpFactory;
-use wcf\system\request\LinkHandler;
-use wcf\system\WCF;
-
-/**
- * Represents a gravatar.
- *
- * @author  Marcel Werk
- * @copyright   2001-2019 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package WoltLabSuite\Core\Data\User\Avatar
- * @see     http://www.gravatar.com
- * @deprecated 5.4 Gravatar is questionable from a privacy perspective.
- */
-class Gravatar extends DefaultAvatar
-{
-    /**
-     * gravatar base url
-     * @var string
-     */
-    const GRAVATAR_BASE = 'http://gravatar.com/avatar/%s?s=%d&r=g&d=%s';
-
-    /**
-     * gravatar local cache location
-     * @var string
-     */
-    const GRAVATAR_CACHE_LOCATION = 'images/avatars/gravatars/%s-%s.%s';
-
-    /**
-     * gravatar expire time (days)
-     * @var int
-     */
-    const GRAVATAR_CACHE_EXPIRE = 7;
-
-    /**
-     * user id
-     * @var int
-     */
-    public $userID = 0;
-
-    /**
-     * gravatar e-mail address
-     * @var string
-     */
-    public $gravatar = '';
-
-    /**
-     * file extension of the gravatar image
-     * @var string
-     */
-    public $fileExtension = 'png';
-
-    /**
-     * urls of this gravatar
-     * @var string
-     */
-    protected $url = '';
-
-    /**
-     * Creates a new Gravatar object.
-     *
-     * @param int $userID
-     * @param string $gravatar
-     * @param string $fileExtension
-     */
-    public function __construct($userID, $gravatar, $fileExtension = 'png')
-    {
-        $this->userID = $userID;
-        $this->gravatar = $gravatar;
-        $this->fileExtension = $fileExtension;
-    }
-
-    /**
-     * @inheritDoc
-     */
-    public function getURL($size = null)
-    {
-        if (empty($this->url)) {
-            // try to use cached gravatar
-            $cachedFilename = \sprintf(
-                self::GRAVATAR_CACHE_LOCATION,
-                \md5(\mb_strtolower($this->gravatar)),
-                $this->size,
-                $this->fileExtension
-            );
-            if (\file_exists(WCF_DIR . $cachedFilename) && \filemtime(WCF_DIR . $cachedFilename) > (TIME_NOW - (self::GRAVATAR_CACHE_EXPIRE * 86400))) {
-                $this->url = WCF::getPath() . $cachedFilename;
-            } else {
-                $this->url = LinkHandler::getInstance()->getLink('GravatarDownload', [
-                    'forceFrontend' => true,
-                ], 'userID=' . $this->userID);
-            }
-        }
-
-        return $this->url;
-    }
-
-    /**
-     * @inheritDoc
-     */
-    public function getSafeURL(?int $size = null): string
-    {
-        return $this->getURL($size);
-    }
-
-    /**
-     * Checks a given email address for gravatar support.
-     *
-     * @param string $email
-     * @return  bool
-     */
-    public static function test($email)
-    {
-        $gravatarURL = \sprintf(self::GRAVATAR_BASE, \md5(\mb_strtolower($email)), 80, GRAVATAR_DEFAULT_TYPE);
-        $client = HttpFactory::getDefaultClient();
-        $request = new Request('GET', $gravatarURL);
-
-        try {
-            $response = $client->send($request);
-
-            if ($response->getStatusCode() === 200) {
-                return true;
-            }
-        } catch (ClientExceptionInterface $e) {
-            // Ignore exception, because we return false anyways.
-        }
-
-        return false;
-    }
-}
index cba1f615256e2209af6e3d3e09fd069330b36d8d..7d93a9768e335e4d6e259299eea925dd4536c965 100644 (file)
@@ -214,7 +214,6 @@ class UserAvatarAction extends AbstractDatabaseObjectAction
 
             $userEditor->update([
                 'avatarID' => $avatarID,
-                'enableGravatar' => 0,
             ]);
 
             // delete old avatar
index 0c0669e0029da3a50a6629faf341910c8859042f..6f44ea59938813b5efc9444afda5e9654084678f 100644 (file)
@@ -48,7 +48,7 @@ class UserFollowerList extends UserFollowList
     {
         parent::__construct();
 
-        $this->sqlSelects .= "user_table.username, user_table.email, user_table.disableAvatar, user_table.enableGravatar, user_table.gravatarFileExtension";
+        $this->sqlSelects .= "user_table.username, user_table.email, user_table.disableAvatar";
         $this->sqlSelects .= ", user_avatar.*";
 
         $this->sqlJoins .= "
index f27481597eee48a58c288c8f9d16a6407b2756bf..a40654fc51f0ada54aed119e5614c23853de2cc0 100644 (file)
@@ -44,7 +44,7 @@ class UserProfileVisitorList extends DatabaseObjectList
     {
         parent::__construct();
 
-        $this->sqlSelects .= "user_table.username, user_table.email, user_table.disableAvatar, user_table.enableGravatar, user_table.gravatarFileExtension";
+        $this->sqlSelects .= "user_table.username, user_table.email, user_table.disableAvatar";
         $this->sqlSelects .= ", user_avatar.*";
 
         $this->sqlJoins .= "
index b2383d9728ed914261ef4a81e7710d7b1c9d6053..90049830029b641bd7369938147ca978a05be655 100644 (file)
@@ -2,7 +2,6 @@
 
 namespace wcf\form;
 
-use wcf\data\user\avatar\Gravatar;
 use wcf\data\user\avatar\UserAvatarAction;
 use wcf\data\user\UserAction;
 use wcf\system\exception\PermissionDeniedException;
@@ -61,7 +60,7 @@ class AvatarEditForm extends AbstractForm
             throw new PermissionDeniedException();
         }
 
-        if ($this->avatarType != 'custom' && $this->avatarType != 'gravatar') {
+        if ($this->avatarType != 'custom') {
             $this->avatarType = 'none';
         }
 
@@ -71,18 +70,6 @@ class AvatarEditForm extends AbstractForm
                     throw new UserInputException('custom');
                 }
                 break;
-
-            case 'gravatar':
-                if (!MODULE_GRAVATAR) {
-                    $this->avatarType = 'none';
-                    break;
-                }
-
-                // test gravatar
-                if (!Gravatar::test(WCF::getUser()->email)) {
-                    throw new UserInputException('gravatar', 'notFound');
-                }
-                break;
         }
     }
 
@@ -103,26 +90,10 @@ class AvatarEditForm extends AbstractForm
 
         // update user
         $data = [];
-        switch ($this->avatarType) {
-            case 'none':
-                $data = [
-                    'avatarID' => null,
-                    'enableGravatar' => 0,
-                ];
-                break;
-
-            case 'custom':
-                $data = [
-                    'enableGravatar' => 0,
-                ];
-                break;
-
-            case 'gravatar':
-                $data = [
-                    'avatarID' => null,
-                    'enableGravatar' => 1,
-                ];
-                break;
+        if ($this->avatarType === 'none') {
+            $data = [
+                'avatarID' => null,
+            ];
         }
         $this->objectAction = new UserAction([WCF::getUser()], 'update', [
             'data' => \array_merge($this->additionalFields, $data),
@@ -133,22 +104,6 @@ class AvatarEditForm extends AbstractForm
         // because of the changed avatar
         UserGroupAssignmentHandler::getInstance()->checkUsers([WCF::getUser()->userID]);
 
-        // reset gravatar cache
-        if ($this->avatarType == 'gravatar') {
-            $pattern = WCF_DIR . \sprintf(
-                Gravatar::GRAVATAR_CACHE_LOCATION,
-                \md5(\mb_strtolower(WCF::getUser()->email)),
-                '*',
-                '*'
-            );
-            $files = \glob($pattern);
-            if (!empty($files)) {
-                foreach ($files as $file) {
-                    @\unlink($file);
-                }
-            }
-        }
-
         UserProfileHandler::getInstance()->reloadUserProfile();
 
         $this->saved();
@@ -165,8 +120,6 @@ class AvatarEditForm extends AbstractForm
         if (empty($_POST)) {
             if (WCF::getUser()->avatarID) {
                 $this->avatarType = 'custom';
-            } elseif (MODULE_GRAVATAR && WCF::getUser()->enableGravatar) {
-                $this->avatarType = 'gravatar';
             }
         }
     }
index 5a5ca64d46b99c963c95a36bd28966738918ef58..7780865a39ee46094ba8f2b97c27c1a23fbf751f 100644 (file)
@@ -6,7 +6,6 @@ use ParagonIE\ConstantTime\Hex;
 use wcf\acp\form\UserAddForm;
 use wcf\data\blacklist\entry\BlacklistEntry;
 use wcf\data\object\type\ObjectType;
-use wcf\data\user\avatar\Gravatar;
 use wcf\data\user\group\UserGroup;
 use wcf\data\user\User;
 use wcf\data\user\UserAction;
@@ -419,11 +418,6 @@ class RegisterForm extends UserAddForm
             $this->groupIDs = UserGroup::getGroupIDsByType([UserGroup::EVERYONE, UserGroup::GUESTS]);
         }
 
-        // check gravatar support
-        if (MODULE_GRAVATAR && Gravatar::test($this->email)) {
-            $this->additionalFields['enableGravatar'] = 1;
-        }
-
         // create user
         $data = [
             'data' => \array_merge($this->additionalFields, [
index 6ea10c88d243b41dbeb8ba660900866f555c055e..6b58ccd6f770965f1a12d9d495d30332a630e5f2 100644 (file)
@@ -497,6 +497,10 @@ class WCF
 
         // Multi-domain setups were removed in 5.6.
         \define('DESKTOP_NOTIFICATION_PACKAGE_ID', 1);
+
+        // Gravatars were removed in 6.0.
+        \define('MODULE_GRAVATAR', 0);
+        \define('GRAVATAR_DEFAULT_TYPE', '404');
     }
 
     /**
index 9ad1705d33250df4889cfca65b051da02bcb8e97..0566e26bd79660625f4875b017cbeadaf7a93805 100644 (file)
@@ -47,8 +47,7 @@ class UserAvatarCondition extends AbstractSelectCondition implements
     const AVATAR = 1;
 
     /**
-     * value of the "user has a gravatar" option
-     * @var int
+     * @deprecated 6.0 This value is reserved for backwards compatibility with existing conditions.
      */
     const GRAVATAR = 2;
 
@@ -72,7 +71,7 @@ class UserAvatarCondition extends AbstractSelectCondition implements
                 break;
 
             case self::GRAVATAR:
-                $objectList->getConditionBuilder()->add('user_table.enableGravatar = ?', [1]);
+                $objectList->getConditionBuilder()->add('1 = 0');
                 break;
         }
     }
@@ -84,16 +83,13 @@ class UserAvatarCondition extends AbstractSelectCondition implements
     {
         switch ($condition->userAvatar) {
             case self::NO_AVATAR:
-                return !$user->avatarID && !$user->enableGravatar;
-                break;
+                return !$user->avatarID;
 
             case self::AVATAR:
                 return $user->avatarID != 0;
-                break;
 
             case self::GRAVATAR:
-                return $user->enableGravatar;
-                break;
+                return false;
         }
     }
 
@@ -107,9 +103,6 @@ class UserAvatarCondition extends AbstractSelectCondition implements
             self::NO_AVATAR => 'wcf.user.condition.avatar.noAvatar',
             self::AVATAR => 'wcf.user.condition.avatar.avatar',
         ];
-        if (MODULE_GRAVATAR) {
-            $options[self::GRAVATAR] = 'wcf.user.condition.avatar.gravatar';
-        }
 
         return $options;
     }
index 221f857e3fb7c66d6e9e9d3eed4bd1707b7169d7..9c989cae36971ec315ced8c781e49cc16cb4d6e3 100644 (file)
@@ -1441,8 +1441,6 @@ ACHTUNG: Die oben genannten Meldungen sind stark gekürzt. Sie können Details z
                <item name="wcf.acp.option.category.user.password"><![CDATA[Kennwort]]></item>
                <item name="wcf.acp.option.category.user.ban"><![CDATA[Filter]]></item>
                <item name="wcf.acp.option.category.user.3rdPartyAuth"><![CDATA[Authentifizierung über Drittanbieter]]></item>
-               <item name="wcf.acp.option.module_gravatar"><![CDATA[Gravatare (veraltet / nicht empfohlen)]]></item>
-               <item name="wcf.acp.option.module_gravatar.description"><![CDATA[Aus Datenschutzgründen ist die Verwendung von Gravataren nicht empfohlen. Sie wird in einer zukünftigen Version entfernt.]]></item>
                <item name="wcf.acp.option.module_users_online"><![CDATA[„Benutzer online“-Anzeige]]></item>
                <item name="wcf.acp.option.module_user_rank"><![CDATA[Benutzerränge]]></item>
                <item name="wcf.acp.option.module_user_signature"><![CDATA[Signaturen]]></item>
@@ -1591,13 +1589,6 @@ Bitte {if LANGUAGE_USE_INFORMAL_VARIANT}befolge{else}befolgen Sie{/if} die Anlei
                <item name="wcf.acp.option.user_authentication_failure_expiration.description"><![CDATA[Legt fest nach welchem Zeitraum protokollierte Anmeldeversuche gelöscht werden.]]></item>
                <item name="wcf.acp.option.signature_secret"><![CDATA[Geheimer Schlüssel]]></item>
                <item name="wcf.acp.option.signature_secret.description"><![CDATA[Ein geheimer Schlüssel, welcher zur Überprüfung von übertragenen Daten bestimmter Funktionen dient. Dieser Schlüssel ist vertraulich zu behandeln! Der Schlüssel wurde bei der Installation zufällig generiert und sollte nur in Ausnahmefällen geändert werden. <strong>Achtung</strong>: Dieser Schlüssel muss mindestens 15 Zeichen lang sein.]]></item>
-               <item name="wcf.acp.option.gravatar_default_type"><![CDATA[Standard Gravatar-Typ]]></item>
-               <item name="wcf.acp.option.gravatar_default_type.description"><![CDATA[Der <a class="externalURL" href="https://de.gravatar.com/site/implement/images/#default-image">Standard-Gravatar-Typ</a>, wenn einer E-Mail kein Gravatar zugeordnet werden kann.]]></item>
-               <item name="wcf.acp.option.gravatar_default_type.404"><![CDATA[Kein Standard-Gravatar]]></item>
-               <item name="wcf.acp.option.gravatar_default_type.identicon"><![CDATA[Identicon]]></item>
-               <item name="wcf.acp.option.gravatar_default_type.wavatar"><![CDATA[Wavatar]]></item>
-               <item name="wcf.acp.option.gravatar_default_type.monsterid"><![CDATA[Monster-ID]]></item>
-               <item name="wcf.acp.option.gravatar_default_type.retro"><![CDATA[Retro]]></item>
                <item name="wcf.acp.option.search_engine"><![CDATA[Suche]]></item>
                <item name="wcf.acp.option.search_engine.mysql"><![CDATA[MySQL FULLTEXT (Standard)]]></item>
                <item name="wcf.acp.option.enable_pluginstore_widget"><![CDATA[Empfohlene Plugins anzeigen]]></item>
@@ -5178,12 +5169,9 @@ Die E-Mail-Adresse des neuen Benutzers lautet: {@$user->email}.
        <category name="wcf.user.avatar">
                <item name="wcf.user.avatar"><![CDATA[Avatar]]></item>
                <item name="wcf.user.avatar.edit"><![CDATA[Avatar verwalten]]></item>
-               <item name="wcf.user.avatar.error.disabled"><![CDATA[Der Administrator hat{if $__wcf->user->avatarID || $__wcf->user->enableGravatar} {if LANGUAGE_USE_INFORMAL_VARIANT}deinen{else}Ihren{/if} derzeitigen Avatar gesperrt und{/if} {if LANGUAGE_USE_INFORMAL_VARIANT}dir{else}Ihnen{/if} die weitere Nutzungsberechtigung der Avatar-Funktion {if !$__wcf->user->disableAvatarReason}entzogen.{else} aus folgenden Gründen entzogen: {$__wcf->user->disableAvatarReason}{/if}]]></item>
+               <item name="wcf.user.avatar.error.disabled"><![CDATA[Der Administrator hat{if $__wcf->user->avatarID} {if LANGUAGE_USE_INFORMAL_VARIANT}deinen{else}Ihren{/if} derzeitigen Avatar gesperrt und{/if} {if LANGUAGE_USE_INFORMAL_VARIANT}dir{else}Ihnen{/if} die weitere Nutzungsberechtigung der Avatar-Funktion {if !$__wcf->user->disableAvatarReason}entzogen.{else} aus folgenden Gründen entzogen: {$__wcf->user->disableAvatarReason}{/if}]]></item>
                <item name="wcf.user.avatar.type.custom"><![CDATA[Eigenen Avatar hochladen]]></item>
                <item name="wcf.user.avatar.type.custom.description"><![CDATA[Eigene Avatare dürfen die Dateiendungen {"\n"|str_replace:', ':$__wcf->session->getPermission('user.profile.avatar.allowedFileExtensions')} und maximal eine Dateigröße von {@$__wcf->session->getPermission('user.profile.avatar.maxSize')|filesize} besitzen. Die Mindestgröße für Avatare liegt bei 128×128 Pixel.]]></item>
-               <item name="wcf.user.avatar.type.gravatar"><![CDATA[Gravatar verwenden]]></item>
-               <item name="wcf.user.avatar.type.gravatar.description"><![CDATA[Bei einem Gravatar handelt es sich um einen global verfügbaren Avatar (Global Recognized Avatar), welcher mit {if LANGUAGE_USE_INFORMAL_VARIANT}deiner{else}Ihrer{/if} E-Mail-Adresse („{$__wcf->user->email}“) verknüpft ist. Auf der folgenden Website {if LANGUAGE_USE_INFORMAL_VARIANT}kannst du{else}können Sie{/if} einen Gravatar anlegen: <a href="https://www.gravatar.com" class="externalURL"{if EXTERNAL_LINK_TARGET_BLANK} target="_blank"{/if}>www.gravatar.com</a>]]></item>
-               <item name="wcf.user.avatar.type.gravatar.error.notFound"><![CDATA[Zu {if LANGUAGE_USE_INFORMAL_VARIANT}deiner{else}Ihrer{/if} E-Mail-Adresse konnte kein Gravatar gefunden werden.]]></item>
                <item name="wcf.user.avatar.type.none"><![CDATA[Keinen Avatar verwenden]]></item>
                <item name="wcf.user.avatar.type.none.description"><![CDATA[Bereits hochgeladene Avatare werden bei Auswahl dieser Option gelöscht.]]></item>
                <item name="wcf.user.avatar.upload.error.badImage"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Du hast{else}Sie haben{/if} kein gültiges Bild hochgeladen.]]></item>
@@ -5197,7 +5185,6 @@ Die E-Mail-Adresse des neuen Benutzers lautet: {@$user->email}.
                <item name="wcf.user.condition.activityPoints"><![CDATA[Punkte]]></item>
                <item name="wcf.user.condition.avatar"><![CDATA[Avatar]]></item>
                <item name="wcf.user.condition.avatar.avatar"><![CDATA[Eigener Avatar]]></item>
-               <item name="wcf.user.condition.avatar.gravatar"><![CDATA[Gravatar]]></item>
                <item name="wcf.user.condition.avatar.noAvatar"><![CDATA[Kein Avatar]]></item>
                <item name="wcf.user.condition.conditionGroup.contents"><![CDATA[Inhalte]]></item>
                <item name="wcf.user.condition.conditionGroup.general"><![CDATA[Allgemeine Daten]]></item>
@@ -5567,5 +5554,18 @@ Benachrichtigungen auf <a href="{link isHtmlEmail=true}{/link}">{PAGE_TITLE|phra
        <item name="wcf.acp.option.category.general.cache.memcached"/>
        <item name="wcf.acp.option.category.general.cache.memcached.description"/>
        <item name="wcf.acp.option.cache_source_type.memcached"/>
+       <item name="wcf.acp.option.module_gravatar"/>
+       <item name="wcf.acp.option.module_gravatar.description"/>
+       <item name="wcf.acp.option.gravatar_default_type"/>
+       <item name="wcf.acp.option.gravatar_default_type.description"/>
+       <item name="wcf.acp.option.gravatar_default_type.404"/>
+       <item name="wcf.acp.option.gravatar_default_type.identicon"/>
+       <item name="wcf.acp.option.gravatar_default_type.wavatar"/>
+       <item name="wcf.acp.option.gravatar_default_type.monsterid"/>
+       <item name="wcf.acp.option.gravatar_default_type.retro"/>
+       <item name="wcf.user.avatar.type.gravatar"/>
+       <item name="wcf.user.avatar.type.gravatar.description"/>
+       <item name="wcf.user.avatar.type.gravatar.error.notFound"/>
+       <item name="wcf.user.condition.avatar.gravatar"/>
 </delete>
 </language>
index da5ab6cc2cafdb665fa35464730fd6793b1f23c5..b7172fd06d0fb0d0cc0e5325dc01c5a73f14e991 100644 (file)
@@ -1422,8 +1422,6 @@ ATTENTION: The messages listed above are greatly shortened. You can view details
                <item name="wcf.acp.option.category.user.password"><![CDATA[Password]]></item>
                <item name="wcf.acp.option.category.user.ban"><![CDATA[Filter]]></item>
                <item name="wcf.acp.option.category.user.3rdPartyAuth"><![CDATA[Third-Party Authentication]]></item>
-               <item name="wcf.acp.option.module_gravatar"><![CDATA[Gravatars (Deprecated / Not Recommended)]]></item>
-               <item name="wcf.acp.option.module_gravatar.description"><![CDATA[Enabling Gravatar support is not recommended due to privacy concerns. Gravatar support will be removed in a future version.]]></item>
                <item name="wcf.acp.option.module_users_online"><![CDATA[Users online list]]></item>
                <item name="wcf.acp.option.module_user_rank"><![CDATA[User ranks]]></item>
                <item name="wcf.acp.option.module_user_signature"><![CDATA[Signatures]]></item>
@@ -1577,13 +1575,6 @@ Please follow the instructions described in <a href="https://www.woltlab.com/art
                <item name="wcf.acp.option.user_authentication_failure_expiration.description"><![CDATA[Failed login attempt logs will be removed after the following days. Raising the limit will provide a longer history, but at the expense of increased database storage usage.]]></item>
                <item name="wcf.acp.option.signature_secret"><![CDATA[Secret Key]]></item>
                <item name="wcf.acp.option.signature_secret.description"><![CDATA[A secret key that serves the purpose of validating data to prevent tampering. Keep this key secret! A random key was generated for you during installation, you don’t need to change it. Note: This key must be at least 15 characters long.]]></item>
-               <item name="wcf.acp.option.gravatar_default_type"><![CDATA[Default Gravatar Type]]></item>
-               <item name="wcf.acp.option.gravatar_default_type.description"><![CDATA[The <a class="externalURL" href="https://de.gravatar.com/site/implement/images/#default-image">default Gravatar type</a> used if no matching Gravatar was found.]]></item>
-               <item name="wcf.acp.option.gravatar_default_type.404"><![CDATA[No default Gravatar]]></item>
-               <item name="wcf.acp.option.gravatar_default_type.identicon"><![CDATA[Identicon]]></item>
-               <item name="wcf.acp.option.gravatar_default_type.wavatar"><![CDATA[Wavatar]]></item>
-               <item name="wcf.acp.option.gravatar_default_type.monsterid"><![CDATA[Monster id]]></item>
-               <item name="wcf.acp.option.gravatar_default_type.retro"><![CDATA[Retro]]></item>
                <item name="wcf.acp.option.search_engine"><![CDATA[Search Engine]]></item>
                <item name="wcf.acp.option.search_engine.mysql"><![CDATA[Use MySQL FULLTEXT (default)]]></item>
                <item name="wcf.acp.option.enable_pluginstore_widget"><![CDATA[Display recommended products]]></item>
@@ -5176,12 +5167,9 @@ You also received a list of emergency codes to use when your second factor becom
        <category name="wcf.user.avatar">
                <item name="wcf.user.avatar"><![CDATA[Avatar]]></item>
                <item name="wcf.user.avatar.edit"><![CDATA[Avatar Management]]></item>
-               <item name="wcf.user.avatar.error.disabled"><![CDATA[The administrators {if $__wcf->user->avatarID || $__wcf->user->enableGravatar}have banned your avatar and {/if}disallowed you from using an avatar{if $__wcf->user->disableAvatarReason}: {$__wcf->user->disableAvatarReason}{/if}.]]></item>
+               <item name="wcf.user.avatar.error.disabled"><![CDATA[The administrators {if $__wcf->user->avatarID}have banned your avatar and {/if}disallowed you from using an avatar{if $__wcf->user->disableAvatarReason}: {$__wcf->user->disableAvatarReason}{/if}.]]></item>
                <item name="wcf.user.avatar.type.custom"><![CDATA[Upload Your Avatar]]></item>
                <item name="wcf.user.avatar.type.custom.description"><![CDATA[You may use the following file extensions “{"\n"|str_replace:', ':$__wcf->session->getPermission('user.profile.avatar.allowedFileExtensions')}” for your avatar with a maximum file size of {@$__wcf->session->getPermission('user.profile.avatar.maxSize')|filesize}. The minimum dimensions are 128×128 pixels.]]></item>
-               <item name="wcf.user.avatar.type.gravatar"><![CDATA[Use Gravatar]]></item>
-               <item name="wcf.user.avatar.type.gravatar.description"><![CDATA[Gravatar (Global Recognized Avatar) provides a globally reusable avatar connected with your email address “{$__wcf->user->email}”. Visit <a href="https://www.gravatar.com" class="externalURL"{if EXTERNAL_LINK_TARGET_BLANK} target="_blank"{/if}>www.gravatar.com</a> to set up or change your avatar.]]></item>
-               <item name="wcf.user.avatar.type.gravatar.error.notFound"><![CDATA[Your email address is not connected with a gravatar.]]></item>
                <item name="wcf.user.avatar.type.none"><![CDATA[Do Not Use Avatar]]></item>
                <item name="wcf.user.avatar.type.none.description"><![CDATA[Your current avatar will be deleted.]]></item>
                <item name="wcf.user.avatar.upload.error.badImage"><![CDATA[Your avatar is invalid.]]></item>
@@ -5195,7 +5183,6 @@ You also received a list of emergency codes to use when your second factor becom
                <item name="wcf.user.condition.activityPoints"><![CDATA[Points]]></item>
                <item name="wcf.user.condition.avatar"><![CDATA[Avatar]]></item>
                <item name="wcf.user.condition.avatar.avatar"><![CDATA[Custom Avatar]]></item>
-               <item name="wcf.user.condition.avatar.gravatar"><![CDATA[Gravatar]]></item>
                <item name="wcf.user.condition.avatar.noAvatar"><![CDATA[No Avatar]]></item>
                <item name="wcf.user.condition.conditionGroup.contents"><![CDATA[Contents]]></item>
                <item name="wcf.user.condition.conditionGroup.general"><![CDATA[General Data]]></item>
@@ -5569,5 +5556,18 @@ your notifications on <a href="{link isHtmlEmail=true}{/link}">{PAGE_TITLE|phras
        <item name="wcf.acp.option.category.general.cache.memcached"/>
        <item name="wcf.acp.option.category.general.cache.memcached.description"/>
        <item name="wcf.acp.option.cache_source_type.memcached"/>
+       <item name="wcf.acp.option.module_gravatar"/>
+       <item name="wcf.acp.option.module_gravatar.description"/>
+       <item name="wcf.acp.option.gravatar_default_type"/>
+       <item name="wcf.acp.option.gravatar_default_type.description"/>
+       <item name="wcf.acp.option.gravatar_default_type.404"/>
+       <item name="wcf.acp.option.gravatar_default_type.identicon"/>
+       <item name="wcf.acp.option.gravatar_default_type.wavatar"/>
+       <item name="wcf.acp.option.gravatar_default_type.monsterid"/>
+       <item name="wcf.acp.option.gravatar_default_type.retro"/>
+       <item name="wcf.user.avatar.type.gravatar"/>
+       <item name="wcf.user.avatar.type.gravatar.description"/>
+       <item name="wcf.user.avatar.type.gravatar.error.notFound"/>
+       <item name="wcf.user.condition.avatar.gravatar"/>
 </delete>
 </language>
index 07685b4da6fc52ef630722568b00eda5843026d1..372e1aad25973c8cccf9c5fab9f37ee1c6b81a57 100644 (file)
@@ -1508,8 +1508,6 @@ CREATE TABLE wcf1_user (
        disableAvatar TINYINT(1) NOT NULL DEFAULT 0,
        disableAvatarReason TEXT,
        disableAvatarExpires INT(10) NOT NULL DEFAULT 0,
-       enableGravatar TINYINT(1) NOT NULL DEFAULT 0,
-       gravatarFileExtension VARCHAR(3) NOT NULL DEFAULT '',
        signature TEXT,
        signatureEnableHtml TINYINT(1) NOT NULL DEFAULT 0,
        disableSignature TINYINT(1) NOT NULL DEFAULT 0,