Dont use `coverPhotoHash` or `coverPhotoExtension` anymore
authorCyperghost <olaf_schmitz_1@t-online.de>
Fri, 29 Nov 2024 12:32:07 +0000 (13:32 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Fri, 29 Nov 2024 12:32:07 +0000 (13:32 +0100)
wcfsetup/install/files/lib/acp/form/UserEditForm.class.php
wcfsetup/install/files/lib/data/user/User.class.php
wcfsetup/install/files/lib/system/condition/UserCoverPhotoCondition.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 50e531f08d0238a023e7d5578084d560c53370f8..35d66985d96d82d92b86d2049c0952ff99f27cdc 100755 (executable)
@@ -480,15 +480,6 @@ class UserEditForm extends UserAddForm
             $data['data']['disableCoverPhoto'] = $this->disableCoverPhoto;
             $data['data']['disableCoverPhotoReason'] = $this->disableCoverPhotoReason;
             $data['data']['disableCoverPhotoExpires'] = $this->disableCoverPhotoExpires;
-
-            if ($this->deleteCoverPhoto) {
-                UserProfileRuntimeCache::getInstance()->getObject($this->userID)->getCoverPhoto()->delete();
-
-                $data['data']['coverPhotoHash'] = null;
-                $data['data']['coverPhotoExtension'] = '';
-
-                UserProfileRuntimeCache::getInstance()->removeObject($this->userID);
-            }
         }
 
         $this->objectAction = new UserAction([$this->userID], 'update', $data);
index 64b22a8d899569577a7b25ae696a0de79e7e25ef..a3acdba37c206e993229bbb7311a47b1b9104c7e 100644 (file)
@@ -66,9 +66,6 @@ use wcf\util\UserUtil;
  * @property-read   string $authData           data of the third party used for authentication
  * @property-read   int $likesReceived          cumulative result of likes (counting +1) the user's contents have received
  * @property-read   int|null $coverPhotoFileID
- * @property-read       string $coverPhotoHash                 hash of the user's cover photo
- * @property-read   string $coverPhotoExtension        extension of the user's cover photo file
- * @property-read int $coverPhotoHasWebP is `1` if a webp variant of the cover photo and its thumbnail exists, otherwise `0`
  * @property-read       int $disableCoverPhoto              is `1` if the user's cover photo has been disabled, otherwise `0`
  * @property-read   string $disableCoverPhotoReason    reason why the user's cover photo is disabled
  * @property-read   int $disableCoverPhotoExpires   timestamp at which the user's cover photo will automatically be enabled again
index a47fe00a792a5aec9d2a32347ae4bca621094550..c48dc5e492e552cb5a601ff7bf3f6520721bae04 100644 (file)
@@ -58,15 +58,13 @@ class UserCoverPhotoCondition extends AbstractSelectCondition implements
         switch ($conditionData['userCoverPhoto']) {
             case self::NO_COVER_PHOTO:
                 $objectList->getConditionBuilder()->add(
-                    '(user_table.coverPhotoHash = ? OR user_table.coverPhotoHash IS NULL)',
-                    ['']
+                    '(user_table.coverPhotoFileID IS NULL)',
                 );
                 break;
 
             case self::COVER_PHOTO:
                 $objectList->getConditionBuilder()->add(
-                    '(user_table.coverPhotoHash <> ? AND user_table.coverPhotoHash IS NOT NULL)',
-                    ['']
+                    '(user_table.coverPhotoFileID IS NOT NULL)',
                 );
                 break;
         }
@@ -79,11 +77,11 @@ class UserCoverPhotoCondition extends AbstractSelectCondition implements
     {
         switch ($condition->userCoverPhoto) {
             case self::NO_COVER_PHOTO:
-                return $user->coverPhotoExtension === '' || $user->coverPhotoExtension === null;
+                return $user->coverPhotoFileID === null;
                 break;
 
             case self::COVER_PHOTO:
-                return $user->coverPhotoExtension !== '' && $user->coverPhotoExtension !== null;
+                return $user->coverPhotoFileID !== null;
                 break;
         }
     }
index 66cabdb7b47f6a9c41e5e41a46ba4834d2d05959..015b2dbabdee47b09953c1292f10b2073acf72eb 100644 (file)
@@ -5268,7 +5268,7 @@ Sobald {if LANGUAGE_USE_INFORMAL_VARIANT}dein{else}Ihr{/if} Benutzerkonto freige
                <item name="wcf.user.coverPhoto.delete"><![CDATA[Titelbild löschen]]></item>
                <item name="wcf.user.coverPhoto.delete.confirmMessage"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Willst du dein{else}Wollen Sie Ihr{/if} Titelbild wirklich löschen? Nach dem Löschen wird wieder das Standard-Bild angezeigt.]]></item>
                <item name="wcf.user.coverPhoto.edit"><![CDATA[Titelbild bearbeiten]]></item>
-               <item name="wcf.user.coverPhoto.error.disabled"><![CDATA[Der Administrator hat{if $__wcf->user->coverPhotoHash} {if LANGUAGE_USE_INFORMAL_VARIANT}dein{else}Ihr{/if} derzeitiges Titelbild gesperrt und{/if} {if LANGUAGE_USE_INFORMAL_VARIANT}dir{else}Ihnen{/if} die weitere Nutzungsberechtigung der Titelbild-Funktion {if !$__wcf->user->disableCoverPhotoReason}entzogen.{else} aus folgenden Gründen entzogen: {$__wcf->user->disableCoverPhotoReason}{/if}]]></item>
+               <item name="wcf.user.coverPhoto.error.disabled"><![CDATA[Der Administrator hat{if $__wcf->user->coverPhotoFileID} {if LANGUAGE_USE_INFORMAL_VARIANT}dein{else}Ihr{/if} derzeitiges Titelbild gesperrt und{/if} {if LANGUAGE_USE_INFORMAL_VARIANT}dir{else}Ihnen{/if} die weitere Nutzungsberechtigung der Titelbild-Funktion {if !$__wcf->user->disableCoverPhotoReason}entzogen.{else} aus folgenden Gründen entzogen: {$__wcf->user->disableCoverPhotoReason}{/if}]]></item>
                <item name="wcf.user.coverPhoto.noImage"><![CDATA[Der Benutzer hat noch kein Titelbild hochgeladen.]]></item>
                <item name="wcf.user.coverPhoto.upload"><![CDATA[Titelbild hochladen]]></item>
                <item name="wcf.user.coverPhoto.upload.description"><![CDATA[Minimale Bildgröße: {$coverPhotoDimensions.min.width} × {$coverPhotoDimensions.min.height} Pixel<br>Maximale Bildgröße: {$coverPhotoDimensions.max.width} × {$coverPhotoDimensions.max.height} Pixel<br>Erlaubte Dateiendungen: gif, jpg, jpeg, png, webp<br>Maximale Dateigröße: {$__wcf->session->getPermission('user.profile.coverPhoto.maxSize')|filesize}]]></item>
index 5a88201f79d200a5fb274de85382748323fa98f8..bc7977e7773d96612246782fdbcf30387424ff5f 100644 (file)
@@ -5267,7 +5267,7 @@ You also received a list of backup codes to use when your second factor becomes
                <item name="wcf.user.coverPhoto.delete"><![CDATA[Delete Cover Photo]]></item>
                <item name="wcf.user.coverPhoto.delete.confirmMessage"><![CDATA[Do you really want to delete your cover photo? This will replace your current photo with the default image.]]></item>
                <item name="wcf.user.coverPhoto.edit"><![CDATA[Edit Cover Photo]]></item>
-               <item name="wcf.user.coverPhoto.error.disabled"><![CDATA[The administrators {if $__wcf->user->coverPhotoHash}have blocked your cover photo and {/if}disallowed you from using a cover photo{if $__wcf->user->disableCoverPhotoReason}: {$__wcf->user->disableCoverPhotoReason}{/if}.]]></item>
+               <item name="wcf.user.coverPhoto.error.disabled"><![CDATA[The administrators {if $__wcf->user->coverPhotoFileID}have blocked your cover photo and {/if}disallowed you from using a cover photo{if $__wcf->user->disableCoverPhotoReason}: {$__wcf->user->disableCoverPhotoReason}{/if}.]]></item>
                <item name="wcf.user.coverPhoto.noImage"><![CDATA[The user has not yet uploaded a cover photo.]]></item>
                <item name="wcf.user.coverPhoto.upload"><![CDATA[Upload Cover Photo]]></item>
                <item name="wcf.user.coverPhoto.upload.description"><![CDATA[Minimum Image Size: {$coverPhotoDimensions.min.width} × {$coverPhotoDimensions.min.height} pixels<br>Maximum Image Size: {$coverPhotoDimensions.max.width} × {$coverPhotoDimensions.max.height} pixels<br>Allowed File Extensions: gif, jpg, jpeg, png, webp<br>Maximum Filesize: {$__wcf->session->getPermission('user.profile.coverPhoto.maxSize')|filesize}]]></item>