mirror of
https://github.com/humhub/humhub.git
synced 2025-01-17 06:08:21 +01:00
Merge pull request #3670 from githubjeka/trim-username
Trim function for username
This commit is contained in:
commit
897a28afd1
@ -74,6 +74,7 @@ class Profile extends ActiveRecord
|
||||
public function rules()
|
||||
{
|
||||
$rules = [
|
||||
[['firstname', 'lastname'], 'trim'],
|
||||
[['user_id'], 'required'],
|
||||
[['user_id'], 'integer'],
|
||||
];
|
||||
@ -206,7 +207,10 @@ class Profile extends ActiveRecord
|
||||
'elements' => [],
|
||||
];
|
||||
|
||||
foreach (ProfileField::find()->orderBy('sort_order')->where(['profile_field_category_id' => $profileFieldCategory->id])->all() as $profileField) {
|
||||
foreach (
|
||||
ProfileField::find()->orderBy('sort_order')
|
||||
->where(['profile_field_category_id' => $profileFieldCategory->id])->all() as $profileField
|
||||
) {
|
||||
/** @var ProfileField $profileField */
|
||||
$profileField->editable = true;
|
||||
|
||||
@ -293,8 +297,8 @@ class Profile extends ActiveRecord
|
||||
|
||||
if ($this->user !== null) {
|
||||
$query = ProfileField::find()
|
||||
->where(['visible' => 1])
|
||||
->orderBy('sort_order');
|
||||
->where(['visible' => 1])
|
||||
->orderBy('sort_order');
|
||||
|
||||
if ($category !== null) {
|
||||
$query->andWhere(['profile_field_category_id' => $category->id]);
|
||||
|
@ -93,7 +93,7 @@ class User extends ContentContainerActiveRecord implements IdentityInterface, Se
|
||||
|
||||
/**
|
||||
* A initial group for the user assigned while registration.
|
||||
* @var type
|
||||
* @var string|int
|
||||
*/
|
||||
public $registrationGroupId = null;
|
||||
|
||||
@ -109,7 +109,7 @@ class User extends ContentContainerActiveRecord implements IdentityInterface, Se
|
||||
|
||||
/**
|
||||
*
|
||||
* @var type
|
||||
* @var string
|
||||
*/
|
||||
public $defaultRoute = '/user/profile';
|
||||
|
||||
@ -130,6 +130,7 @@ class User extends ContentContainerActiveRecord implements IdentityInterface, Se
|
||||
$userModule = Yii::$app->getModule('user');
|
||||
|
||||
return [
|
||||
[['username', 'email'], 'trim'],
|
||||
[['username'], 'required'],
|
||||
[['status', 'created_by', 'updated_by', 'visibility'], 'integer'],
|
||||
[['status', 'visibility'], 'integer'],
|
||||
@ -170,7 +171,6 @@ class User extends ContentContainerActiveRecord implements IdentityInterface, Se
|
||||
*/
|
||||
public function __get($name)
|
||||
{
|
||||
|
||||
if ($name == 'super_admin') {
|
||||
/**
|
||||
* Replacement for old super_admin flag version
|
||||
@ -440,6 +440,7 @@ class User extends ContentContainerActiveRecord implements IdentityInterface, Se
|
||||
/**
|
||||
* Before Save Addons
|
||||
*
|
||||
* @param bool $insert
|
||||
* @return bool
|
||||
*/
|
||||
public function beforeSave($insert)
|
||||
@ -472,6 +473,7 @@ class User extends ContentContainerActiveRecord implements IdentityInterface, Se
|
||||
|
||||
/**
|
||||
* After Save Addons
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function afterSave($insert, $changedAttributes)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user