1
0
mirror of https://github.com/flarum/core.git synced 2025-08-17 22:01:44 +02:00

Remove user bio feature (#1214)

The feature is very limited in scope, and we hope for community
extensions to take over this feature and make it much better.
This commit is contained in:
Franz Liedke
2017-11-02 01:12:49 +01:00
committed by GitHub
parent 1b7cb3bec2
commit 914b94b62d
10 changed files with 2 additions and 358 deletions

View File

@@ -40,7 +40,6 @@ class UserSerializer extends UserBasicSerializer
$canEdit = $gate->allows('edit', $user);
$attributes += [
'bio' => $user->bio,
'joinTime' => $this->formatDate($user->join_time),
'discussionsCount' => (int) $user->discussions_count,
'commentsCount' => (int) $user->comments_count,

View File

@@ -114,14 +114,6 @@ class EditUserHandler
$validate['password'] = $attributes['password'];
}
if (isset($attributes['bio'])) {
if (! $isSelf) {
$this->assertPermission($canEdit);
}
$user->changeBio($attributes['bio']);
}
if (! empty($attributes['readTime'])) {
$this->assertPermission($isSelf);
$user->markAllAsRead();

View File

@@ -22,7 +22,6 @@ use Flarum\Event\GetDisplayName;
use Flarum\Event\PostWasDeleted;
use Flarum\Event\PrepareUserGroups;
use Flarum\Event\UserAvatarWasChanged;
use Flarum\Event\UserBioWasChanged;
use Flarum\Event\UserEmailChangeWasRequested;
use Flarum\Event\UserEmailWasChanged;
use Flarum\Event\UserPasswordWasChanged;
@@ -42,7 +41,6 @@ use Symfony\Component\HttpFoundation\Session\SessionInterface;
* @property bool $is_activated
* @property string $password
* @property string $locale
* @property string $bio
* @property string|null $avatar_path
* @property string $avatar_url
* @property array $preferences
@@ -263,21 +261,6 @@ class User extends AbstractModel
$this->attributes['password'] = $value ? static::$hasher->make($value) : '';
}
/**
* Change the user's bio.
*
* @param string $bio
* @return $this
*/
public function changeBio($bio)
{
$this->bio = $bio;
$this->raise(new UserBioWasChanged($this));
return $this;
}
/**
* Mark all discussions as read.
*

View File

@@ -1,37 +0,0 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\Event;
use Flarum\Core\User;
class UserBioWasChanged
{
/**
* @var User
*/
public $user;
/**
* @var User
*/
public $actor;
/**
* @param User $user
* @param User $actor
*/
public function __construct(User $user, User $actor = null)
{
$this->user = $user;
$this->actor = $actor;
}
}