mirror of
https://github.com/humhub/humhub.git
synced 2025-03-14 20:19:47 +01:00
Merge pull request #3307 from rekollekt/master
add maximum username length & maximum/minimum space url length
This commit is contained in:
commit
f2bc8fa64f
@ -42,6 +42,18 @@ class Module extends \humhub\components\Module
|
||||
*/
|
||||
public $disableFollow = false;
|
||||
|
||||
/**
|
||||
* @var int maximum space url length
|
||||
* @since 1.3
|
||||
*/
|
||||
public $maximumSpaceUrlLength = 45;
|
||||
|
||||
/**
|
||||
* @var int minimum space url length
|
||||
* @since 1.3
|
||||
*/
|
||||
public $minimumSpaceUrlLength = 2;
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
|
@ -119,7 +119,8 @@ class Space extends ContentContainerActiveRecord implements Searchable
|
||||
[['visibility'], 'in', 'range' => [0, 1, 2]],
|
||||
[['visibility'], 'checkVisibility'],
|
||||
[['url'], 'unique', 'skipOnEmpty' => 'true'],
|
||||
[['guid', 'name', 'url'], 'string', 'max' => 45, 'min' => 2],
|
||||
[['guid', 'name'], 'string', 'max' => 45, 'min' => 2],
|
||||
[['url'], 'string', 'max' => Yii::$app->getModule('space')->maximumSpaceUrlLength, 'min' => Yii::$app->getModule('space')->minimumSpaceUrlLength],
|
||||
[['url'], UrlValidator::class],
|
||||
];
|
||||
|
||||
|
@ -59,6 +59,12 @@ class Module extends \humhub\components\Module
|
||||
*/
|
||||
public $adminCanChangeUserProfileImages = false;
|
||||
|
||||
/**
|
||||
* @var int maximum username length
|
||||
* @since 1.3
|
||||
*/
|
||||
public $maximumUsernameLength = 50;
|
||||
|
||||
/**
|
||||
* @var int minimum username length
|
||||
* @since 1.2
|
||||
|
@ -135,7 +135,7 @@ class User extends ContentContainerActiveRecord implements IdentityInterface, Se
|
||||
[['status', 'visibility'], 'integer'],
|
||||
[['tags'], 'string'],
|
||||
[['guid'], 'string', 'max' => 45],
|
||||
[['username'], 'string', 'max' => 50, 'min' => $userModule->minimumUsernameLength],
|
||||
[['username'], 'string', 'max' => $userModule->maximumUsernameLength, 'min' => $userModule->minimumUsernameLength],
|
||||
[['time_zone'], 'in', 'range' => \DateTimeZone::listIdentifiers()],
|
||||
[['auth_mode'], 'string', 'max' => 10],
|
||||
[['language'], 'string', 'max' => 5],
|
||||
|
Loading…
x
Reference in New Issue
Block a user