Skip to content

Commit

Permalink
DEV: Изменение max длины пароля, slug в пространствах
Browse files Browse the repository at this point in the history
  • Loading branch information
evgip committed May 28, 2021
1 parent 639c37e commit 56edfe8
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions app/Controllers/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ public function registerHandler()
redirect($url);
}

if (Base::getStrlen($password) < 8 || Base::getStrlen($password) > 24)
if (Base::getStrlen($password) < 8 || Base::getStrlen($password) > 32)
{
Base::addMsg('Длина пароля должна быть от 8 до 24 знаков', 'error');
Base::addMsg('Длина пароля должна быть от 8 до 32 знаков', 'error');
$url = ($inv_code) ? '/register/invite/'.$inv_code : '/register';
redirect($url);
}
Expand Down Expand Up @@ -384,9 +384,9 @@ public function RemindPageNew()
return false;
}

if (Base::getStrlen($password) < 8 || Base::getStrlen($password) > 24)
if (Base::getStrlen($password) < 8 || Base::getStrlen($password) > 32)
{
Base::addMsg('Длина пароля должна быть от 8 до 24 знаков', 'error');
Base::addMsg('Длина пароля должна быть от 8 до 32 знаков', 'error');
redirect('/recover/remind/' . $code );
}

Expand Down
8 changes: 4 additions & 4 deletions app/Controllers/SpaceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,13 @@ public function spaceAdd()
$space_tl = \Request::getPostInt('space_tl');

$redirect = '/space/add';
if (!preg_match('/^[a-zA-Z0-9]+$/u', $space_slug)) {
if (!preg_match('/^[a-zA-Z0-9_]+$/u', $space_slug)) {
Base::addMsg(lang('url-latin'), 'error');
redirect($redirect);
}

Base::Limits($space_name, lang('titles'), '4', '20', $redirect);
Base::Limits($space_slug, 'slug (URL)', '4', '10', $redirect);
Base::Limits($space_slug, 'slug (URL)', '3', '10', $redirect);

if (preg_match('/\s/', $space_slug) || strpos($space_slug,' ')) {
Base::addMsg(lang('url-gaps'), 'error');
Expand Down Expand Up @@ -321,14 +321,14 @@ public function spaceEdit()
$space_short_text = \Request::getPost('space_short_text');

$redirect = '/space/' . $space['space_slug'] . '/edit';
if (!preg_match('/^[a-zA-Z0-9]+$/u', $space_slug)) {
if (!preg_match('/^[a-zA-Z0-9_]+$/u', $space_slug)) {
Base::addMsg(lang('url-latin'), 'error');
redirect($redirect);
}

Base::Limits($space_name, lang('titles'), '4', '20', $redirect);
Base::Limits($space_description, 'Meta-', '60', '190', $redirect);
Base::Limits($space_slug, 'SLUG', '4', '10', $redirect);
Base::Limits($space_slug, 'SLUG', '3', '10', $redirect);
Base::Limits($space_short_text, 'TEXT', '20', '250', $redirect);

$space_color = \Request::getPost('color');
Expand Down
2 changes: 1 addition & 1 deletion app/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ function settingSecurityEdit()
redirect($redirect);
}

if (Base::getStrlen($password2) < 8 || Base::getStrlen($password2) > 24) {
if (Base::getStrlen($password2) < 8 || Base::getStrlen($password2) > 32) {
Base::addMsg(lang('pass-length-err'), 'error');
redirect($redirect);
}
Expand Down
2 changes: 1 addition & 1 deletion app/Language/en/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
/* MSG */
'about-info-err' => 'About me should be less characters long',
'name-info-err' => 'Name must be between 3 and ~ 10 characters long',
'pass-length-err' => 'The password must be between 8 and 24 characters long',
'pass-length-err' => 'The password must be between 8 and 32 characters long',
'old-password-err' => 'The old password is not correct',
'pass-match-err' => 'Passwords don*t match',
'pass-gap-err' => 'The password cannot contain spaces',
Expand Down
2 changes: 1 addition & 1 deletion app/Language/ru/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
'Avatar changed' => '«Аватарка» изменена',
'Cover changed' => '«Обложка» изменена',
'Password changed' => 'Пароль успешно изменен',
'pass-length-err' => 'Длина пароля должна быть от 8 до 24 знаков',
'pass-length-err' => 'Длина пароля должна быть от 8 до 32 знаков',
'old-password-err' => 'Старый пароль не верен',
'pass-match-err' => 'Пароли не совпадают',
'pass-gap-err' => 'Пароль не может содержать пробелов',
Expand Down
16 changes: 8 additions & 8 deletions routes/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,19 @@

// Подписываемся, отписываемся / изменяем пространство
Route::type('post')->get('/space/hide')->controller('SpaceController@hide');
Route::get('/space/{slug}/edit')->controller('SpaceController@spaceForma')->where(['slug' => '[A-Za-z0-9]+']);
Route::get('/space/{slug}/edit/logo')->controller('SpaceController@spaceFormaLogo')->where(['slug' => '[A-Za-z0-9]+']);
Route::get('/space/{slug}/tags')->controller('SpaceController@spaceTagsInfo')->where(['slug' => '[A-Za-z0-9]+']);
Route::get('/space/{slug}/tags/add')->controller('SpaceController@spaceTagsAddPage')->where(['slug' => '[A-Za-z0-9]+']);
Route::get('/space/{slug}/edit')->controller('SpaceController@spaceForma')->where(['slug' => '[A-Za-z0-9_]+']);
Route::get('/space/{slug}/edit/logo')->controller('SpaceController@spaceFormaLogo')->where(['slug' => '[A-Za-z0-9_]+']);
Route::get('/space/{slug}/tags')->controller('SpaceController@spaceTagsInfo')->where(['slug' => '[A-Za-z0-9_]+']);
Route::get('/space/{slug}/tags/add')->controller('SpaceController@spaceTagsAddPage')->where(['slug' => '[A-Za-z0-9_]+']);
Route::type('post')->protect()->get('/space/editspace')->controller('SpaceController@spaceEdit');
Route::type('post')->protect()->get('/space/editspace/logo')->controller('SpaceController@spaceEditLogo');
Route::get('/space/{slug}/delete/cover')->controller('SpaceController@spaceCoverRemove')->where(['slug' => '[A-Za-z0-9]+']);
Route::get('/space/{slug}/delete/cover')->controller('SpaceController@spaceCoverRemove')->where(['slug' => '[A-Za-z0-9_]+']);
Route::get('/space/add')->controller('SpaceController@addSpacePage');
Route::type('post')->protect()->get('/space/addspace')->controller('SpaceController@spaceAdd');
Route::get('/space/my')->controller('SpaceController@spaseUser');

// Работа с метками (тегами)
Route::get('/s/{slug}/{tags?}/edit')->controller('SpaceController@editTagSpacePage')->where(['slug' => '[A-Za-z0-9]+', 'tags' => '[0-9]+']);
Route::get('/s/{slug}/{tags?}/edit')->controller('SpaceController@editTagSpacePage')->where(['slug' => '[A-Za-z0-9_]+', 'tags' => '[0-9]+']);
Route::type('post')->protect()->get('/space/tag/edit')->controller('SpaceController@editTagSpace');
Route::type('post')->protect()->get('/space/tag/add')->controller('SpaceController@addTagSpace');

Expand Down Expand Up @@ -156,8 +156,8 @@

// Пространства
Route::get('/space')->controller('SpaceController');
Route::get('/s/{slug}/{tags?}')->controller('SpaceController@spacePosts', ['feed'])->where(['slug' => '[A-Za-z0-9]+', 'tags' => '[0-9]+']);
Route::get('/s/{slug}/top/{tags?}')->controller('SpaceController@spacePosts', ['top'])->where(['slug' => '[A-Za-z0-9]+', 'tags' => '[0-9]+']);
Route::get('/s/{slug}/{tags?}')->controller('SpaceController@spacePosts', ['feed'])->where(['slug' => '[A-Za-z0-9_]+', 'tags' => '[0-9]+']);
Route::get('/s/{slug}/top/{tags?}')->controller('SpaceController@spacePosts', ['top'])->where(['slug' => '[A-Za-z0-9_]+', 'tags' => '[0-9]+']);

// Вызов формы комментария
Route::type('post')->get('/comments/addform')->controller('CommentController@addFormComm');
Expand Down

0 comments on commit 56edfe8

Please sign in to comment.