فهرست منبع

Improvement: config registration form settings (#3932)

* wip

* wip

* i18n en-us

* phpcs fixes

* wip i18n

* wip i18n

* i18n ignore en-us

* delete registration.help

* i18n de

* JS Syntax fixed for config.js

* JavaScript lint fixes config.js

* fix typo in i18n/de

* improve the JS

* improve HTML

* phpcs fixes

* update main.js from edge

* fix i18n comments

* Update app/i18n/fr/admin.php

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
maTh 4 سال پیش
والد
کامیت
ba1259bb21

+ 13 - 1
app/i18n/cz/admin.php

@@ -168,8 +168,20 @@ return array(
 		'max-categories' => 'Maximální počet kategorií na uživatele',
 		'max-categories' => 'Maximální počet kategorií na uživatele',
 		'max-feeds' => 'Maximální počet kanálů na uživatele',
 		'max-feeds' => 'Maximální počet kanálů na uživatele',
 		'registration' => array(
 		'registration' => array(
-			'help' => '0 znamená žádná omezení účtu',
 			'number' => 'Maximální počet účtů',
 			'number' => 'Maximální počet účtů',
+			'select' => array(
+				'label' => 'Registration form',	// TODO
+				'option' => array(
+					'noform' => 'Disabled: No registration form',	// TODO
+					'nolimit' => 'Enabled: No limit of accounts',	// TODO
+					'setaccountsnumber' => 'Set max. number of accounts',	// TODO
+				),
+			),
+			'status' => array(
+				'disabled' => 'Form disabled',	// TODO
+				'enabled' => 'Form enabled',	// TODO
+			),
+			'title' => 'User registration form',	// TODO
 		),
 		),
 	),
 	),
 	'update' => array(
 	'update' => array(

+ 13 - 1
app/i18n/de/admin.php

@@ -168,8 +168,20 @@ return array(
 		'max-categories' => 'Anzahl erlaubter Kategorien pro Benutzer',
 		'max-categories' => 'Anzahl erlaubter Kategorien pro Benutzer',
 		'max-feeds' => 'Anzahl erlaubter Feeds pro Benutzer',
 		'max-feeds' => 'Anzahl erlaubter Feeds pro Benutzer',
 		'registration' => array(
 		'registration' => array(
-			'help' => '0 heißt, dass es kein Account Limit gibt',
 			'number' => 'Maximale Anzahl von Accounts',
 			'number' => 'Maximale Anzahl von Accounts',
+			'select' => array(
+				'label' => 'Registrierungsformular',
+				'option' => array(
+					'noform' => 'Deaktiviert: Keine Registrierung möglich',
+					'nolimit' => 'Aktiviert: Registrierung möglich',
+					'setaccountsnumber' => 'Anzahl maximaler Benutzer-Acounts festlegen',
+				),
+			),
+			'status' => array(
+				'disabled' => 'Formular deaktiviert',
+				'enabled' => 'Formular aktiviert',
+			),
+			'title' => 'Benutzer-Registrierungsformular',
 		),
 		),
 	),
 	),
 	'update' => array(
 	'update' => array(

+ 13 - 1
app/i18n/en-us/admin.php

@@ -168,8 +168,20 @@ return array(
 		'max-categories' => 'Max number of categories per user',	// IGNORE
 		'max-categories' => 'Max number of categories per user',	// IGNORE
 		'max-feeds' => 'Max number of feeds per user',	// IGNORE
 		'max-feeds' => 'Max number of feeds per user',	// IGNORE
 		'registration' => array(
 		'registration' => array(
-			'help' => '0 means that there is no account limit',	// IGNORE
 			'number' => 'Max number of accounts',	// IGNORE
 			'number' => 'Max number of accounts',	// IGNORE
+			'select' => array(
+				'label' => 'Registration form',	// IGNORE
+				'option' => array(
+					'noform' => 'Disabled: No registration form',	// IGNORE
+					'nolimit' => 'Enabled: No limit of accounts',	// IGNORE
+					'setaccountsnumber' => 'Set max. number of accounts',	// IGNORE
+				),
+			),
+			'status' => array(
+				'disabled' => 'Form disabled',	// IGNORE
+				'enabled' => 'Form enabled',	// IGNORE
+			),
+			'title' => 'User registration form',	// IGNORE
 		),
 		),
 	),
 	),
 	'update' => array(
 	'update' => array(

+ 13 - 1
app/i18n/en/admin.php

@@ -168,8 +168,20 @@ return array(
 		'max-categories' => 'Max number of categories per user',
 		'max-categories' => 'Max number of categories per user',
 		'max-feeds' => 'Max number of feeds per user',
 		'max-feeds' => 'Max number of feeds per user',
 		'registration' => array(
 		'registration' => array(
-			'help' => '0 means that there is no account limit',
 			'number' => 'Max number of accounts',
 			'number' => 'Max number of accounts',
+			'select' => array(
+				'label' => 'Registration form',
+				'option' => array(
+					'noform' => 'Disabled: No registration form',
+					'nolimit' => 'Enabled: No limit of accounts',
+					'setaccountsnumber' => 'Set max. number of accounts',
+				),
+			),
+			'status' => array(
+				'disabled' => 'Form disabled',
+				'enabled' => 'Form enabled',
+			),
+			'title' => 'User registration form',
 		),
 		),
 	),
 	),
 	'update' => array(
 	'update' => array(

+ 13 - 1
app/i18n/es/admin.php

@@ -168,8 +168,20 @@ return array(
 		'max-categories' => 'Límite de categorías por usuario',
 		'max-categories' => 'Límite de categorías por usuario',
 		'max-feeds' => 'Límite de fuentes por usuario',
 		'max-feeds' => 'Límite de fuentes por usuario',
 		'registration' => array(
 		'registration' => array(
-			'help' => '0 significa que no hay límite en la cuenta',
 			'number' => 'Número máximo de cuentas',
 			'number' => 'Número máximo de cuentas',
+			'select' => array(
+				'label' => 'Registration form',	// TODO
+				'option' => array(
+					'noform' => 'Disabled: No registration form',	// TODO
+					'nolimit' => 'Enabled: No limit of accounts',	// TODO
+					'setaccountsnumber' => 'Set max. number of accounts',	// TODO
+				),
+			),
+			'status' => array(
+				'disabled' => 'Form disabled',	// TODO
+				'enabled' => 'Form enabled',	// TODO
+			),
+			'title' => 'User registration form',	// TODO
 		),
 		),
 	),
 	),
 	'update' => array(
 	'update' => array(

+ 13 - 1
app/i18n/fr/admin.php

@@ -168,8 +168,20 @@ return array(
 		'max-categories' => 'Limite de catégories par utilisateur',
 		'max-categories' => 'Limite de catégories par utilisateur',
 		'max-feeds' => 'Limite de flux par utilisateur',
 		'max-feeds' => 'Limite de flux par utilisateur',
 		'registration' => array(
 		'registration' => array(
-			'help' => 'Un chiffre de 0 signifie que l’on peut créer un nombre infini de comptes',
 			'number' => 'Nombre max de comptes',
 			'number' => 'Nombre max de comptes',
+			'select' => array(
+				'label' => 'Formulaire d’inscription',
+				'option' => array(
+					'noform' => 'Désactivé : Pas de formulaire d’inscription',
+					'nolimit' => 'Activé : Pas de limite au nombre d’utilisateurs',
+					'setaccountsnumber' => 'Nombre d’utilisateurs limités',
+				),
+			),
+			'status' => array(
+				'disabled' => 'Formulaire désactivé',
+				'enabled' => 'Formulaire activé',
+			),
+			'title' => 'Formulaire d’inscription utilisateur',
 		),
 		),
 	),
 	),
 	'update' => array(
 	'update' => array(

+ 13 - 1
app/i18n/he/admin.php

@@ -168,8 +168,20 @@ return array(
 		'max-categories' => 'Max number of categories per user',	// TODO
 		'max-categories' => 'Max number of categories per user',	// TODO
 		'max-feeds' => 'Max number of feeds per user',	// TODO
 		'max-feeds' => 'Max number of feeds per user',	// TODO
 		'registration' => array(
 		'registration' => array(
-			'help' => '0 means that there is no account limit',	// TODO
 			'number' => 'Max number of accounts',	// TODO
 			'number' => 'Max number of accounts',	// TODO
+			'select' => array(
+				'label' => 'Registration form',	// TODO
+				'option' => array(
+					'noform' => 'Disabled: No registration form',	// TODO
+					'nolimit' => 'Enabled: No limit of accounts',	// TODO
+					'setaccountsnumber' => 'Set max. number of accounts',	// TODO
+				),
+			),
+			'status' => array(
+				'disabled' => 'Form disabled',	// TODO
+				'enabled' => 'Form enabled',	// TODO
+			),
+			'title' => 'User registration form',	// TODO
 		),
 		),
 	),
 	),
 	'update' => array(
 	'update' => array(

+ 13 - 1
app/i18n/it/admin.php

@@ -168,8 +168,20 @@ return array(
 		'max-categories' => 'Limite categorie per utente',
 		'max-categories' => 'Limite categorie per utente',
 		'max-feeds' => 'Limite feeds per utente',
 		'max-feeds' => 'Limite feeds per utente',
 		'registration' => array(
 		'registration' => array(
-			'help' => '0 significa che non esiste limite sui profili',
 			'number' => 'Numero massimo di profili',
 			'number' => 'Numero massimo di profili',
+			'select' => array(
+				'label' => 'Registration form',	// TODO
+				'option' => array(
+					'noform' => 'Disabled: No registration form',	// TODO
+					'nolimit' => 'Enabled: No limit of accounts',	// TODO
+					'setaccountsnumber' => 'Set max. number of accounts',	// TODO
+				),
+			),
+			'status' => array(
+				'disabled' => 'Form disabled',	// TODO
+				'enabled' => 'Form enabled',	// TODO
+			),
+			'title' => 'User registration form',	// TODO
 		),
 		),
 	),
 	),
 	'update' => array(
 	'update' => array(

+ 13 - 1
app/i18n/ja/admin.php

@@ -168,8 +168,20 @@ return array(
 		'max-categories' => '1ユーザーごとのカテゴリの最大値',
 		'max-categories' => '1ユーザーごとのカテゴリの最大値',
 		'max-feeds' => '1ユーザーごとのフィードの最大値',
 		'max-feeds' => '1ユーザーごとのフィードの最大値',
 		'registration' => array(
 		'registration' => array(
-			'help' => '0 はアカウントの上限がないことを意味しています',
 			'number' => 'アカウントの最大値',
 			'number' => 'アカウントの最大値',
+			'select' => array(
+				'label' => 'Registration form',	// TODO
+				'option' => array(
+					'noform' => 'Disabled: No registration form',	// TODO
+					'nolimit' => 'Enabled: No limit of accounts',	// TODO
+					'setaccountsnumber' => 'Set max. number of accounts',	// TODO
+				),
+			),
+			'status' => array(
+				'disabled' => 'Form disabled',	// TODO
+				'enabled' => 'Form enabled',	// TODO
+			),
+			'title' => 'User registration form',	// TODO
 		),
 		),
 	),
 	),
 	'update' => array(
 	'update' => array(

+ 13 - 1
app/i18n/ko/admin.php

@@ -168,8 +168,20 @@ return array(
 		'max-categories' => '사용자별 카테고리 개수 제한',
 		'max-categories' => '사용자별 카테고리 개수 제한',
 		'max-feeds' => '사용자별 피드 개수 제한',
 		'max-feeds' => '사용자별 피드 개수 제한',
 		'registration' => array(
 		'registration' => array(
-			'help' => '0: 제한 없음',
 			'number' => '계정 최대 개수',
 			'number' => '계정 최대 개수',
+			'select' => array(
+				'label' => 'Registration form',	// TODO
+				'option' => array(
+					'noform' => 'Disabled: No registration form',	// TODO
+					'nolimit' => 'Enabled: No limit of accounts',	// TODO
+					'setaccountsnumber' => 'Set max. number of accounts',	// TODO
+				),
+			),
+			'status' => array(
+				'disabled' => 'Form disabled',	// TODO
+				'enabled' => 'Form enabled',	// TODO
+			),
+			'title' => 'User registration form',	// TODO
 		),
 		),
 	),
 	),
 	'update' => array(
 	'update' => array(

+ 13 - 1
app/i18n/nl/admin.php

@@ -168,8 +168,20 @@ return array(
 		'max-categories' => 'Categorielimiet per gebruiker',
 		'max-categories' => 'Categorielimiet per gebruiker',
 		'max-feeds' => 'Feedlimiet per gebruiker',
 		'max-feeds' => 'Feedlimiet per gebruiker',
 		'registration' => array(
 		'registration' => array(
-			'help' => '0 betekent geen account limiet',
 			'number' => 'Maximum aantal accounts',
 			'number' => 'Maximum aantal accounts',
+			'select' => array(
+				'label' => 'Registration form',	// TODO
+				'option' => array(
+					'noform' => 'Disabled: No registration form',	// TODO
+					'nolimit' => 'Enabled: No limit of accounts',	// TODO
+					'setaccountsnumber' => 'Set max. number of accounts',	// TODO
+				),
+			),
+			'status' => array(
+				'disabled' => 'Form disabled',	// TODO
+				'enabled' => 'Form enabled',	// TODO
+			),
+			'title' => 'User registration form',	// TODO
 		),
 		),
 	),
 	),
 	'update' => array(
 	'update' => array(

+ 13 - 1
app/i18n/oc/admin.php

@@ -168,8 +168,20 @@ return array(
 		'max-categories' => 'Limita de categoria per utilizaire',
 		'max-categories' => 'Limita de categoria per utilizaire',
 		'max-feeds' => 'Limita de fluxes per utilizaire',
 		'max-feeds' => 'Limita de fluxes per utilizaire',
 		'registration' => array(
 		'registration' => array(
-			'help' => '0 vòl dire qu’i a pas cap de limita de compte',
 			'number' => 'Nombre max de comptes',
 			'number' => 'Nombre max de comptes',
+			'select' => array(
+				'label' => 'Registration form',	// TODO
+				'option' => array(
+					'noform' => 'Disabled: No registration form',	// TODO
+					'nolimit' => 'Enabled: No limit of accounts',	// TODO
+					'setaccountsnumber' => 'Set max. number of accounts',	// TODO
+				),
+			),
+			'status' => array(
+				'disabled' => 'Form disabled',	// TODO
+				'enabled' => 'Form enabled',	// TODO
+			),
+			'title' => 'User registration form',	// TODO
 		),
 		),
 	),
 	),
 	'update' => array(
 	'update' => array(

+ 13 - 1
app/i18n/pl/admin.php

@@ -168,8 +168,20 @@ return array(
 		'max-categories' => 'Maksymalna liczba kategorii na użytkownika',
 		'max-categories' => 'Maksymalna liczba kategorii na użytkownika',
 		'max-feeds' => 'Maksymalna liczba kanałów na użytkownika',
 		'max-feeds' => 'Maksymalna liczba kanałów na użytkownika',
 		'registration' => array(
 		'registration' => array(
-			'help' => '0 oznacza brak limitu liczby kont',
 			'number' => 'Maksymalna liczba kont',
 			'number' => 'Maksymalna liczba kont',
+			'select' => array(
+				'label' => 'Registration form',	// TODO
+				'option' => array(
+					'noform' => 'Disabled: No registration form',	// TODO
+					'nolimit' => 'Enabled: No limit of accounts',	// TODO
+					'setaccountsnumber' => 'Set max. number of accounts',	// TODO
+				),
+			),
+			'status' => array(
+				'disabled' => 'Form disabled',	// TODO
+				'enabled' => 'Form enabled',	// TODO
+			),
+			'title' => 'User registration form',	// TODO
 		),
 		),
 	),
 	),
 	'update' => array(
 	'update' => array(

+ 13 - 1
app/i18n/pt-br/admin.php

@@ -168,8 +168,20 @@ return array(
 		'max-categories' => 'Limite de categorias por usuário',
 		'max-categories' => 'Limite de categorias por usuário',
 		'max-feeds' => 'Limite de Feeds por usuário',
 		'max-feeds' => 'Limite de Feeds por usuário',
 		'registration' => array(
 		'registration' => array(
-			'help' => '0 significa que não há limite para a conta',
 			'number' => 'Máximo número de contas',
 			'number' => 'Máximo número de contas',
+			'select' => array(
+				'label' => 'Registration form',	// TODO
+				'option' => array(
+					'noform' => 'Disabled: No registration form',	// TODO
+					'nolimit' => 'Enabled: No limit of accounts',	// TODO
+					'setaccountsnumber' => 'Set max. number of accounts',	// TODO
+				),
+			),
+			'status' => array(
+				'disabled' => 'Form disabled',	// TODO
+				'enabled' => 'Form enabled',	// TODO
+			),
+			'title' => 'User registration form',	// TODO
 		),
 		),
 	),
 	),
 	'update' => array(
 	'update' => array(

+ 13 - 1
app/i18n/ru/admin.php

@@ -168,8 +168,20 @@ return array(
 		'max-categories' => 'Максимальное количество категорий на пользователя',
 		'max-categories' => 'Максимальное количество категорий на пользователя',
 		'max-feeds' => 'Максимальное количество лент на пользователя',
 		'max-feeds' => 'Максимальное количество лент на пользователя',
 		'registration' => array(
 		'registration' => array(
-			'help' => '0 означает неограниченное количество пользователей',
 			'number' => 'Максимальное количество пользователей',
 			'number' => 'Максимальное количество пользователей',
+			'select' => array(
+				'label' => 'Registration form',	// TODO
+				'option' => array(
+					'noform' => 'Disabled: No registration form',	// TODO
+					'nolimit' => 'Enabled: No limit of accounts',	// TODO
+					'setaccountsnumber' => 'Set max. number of accounts',	// TODO
+				),
+			),
+			'status' => array(
+				'disabled' => 'Form disabled',	// TODO
+				'enabled' => 'Form enabled',	// TODO
+			),
+			'title' => 'User registration form',	// TODO
 		),
 		),
 	),
 	),
 	'update' => array(
 	'update' => array(

+ 13 - 1
app/i18n/sk/admin.php

@@ -168,8 +168,20 @@ return array(
 		'max-categories' => 'Limit počtu kategórií pre používateľa',
 		'max-categories' => 'Limit počtu kategórií pre používateľa',
 		'max-feeds' => 'Limit počtu kanálov pre používateľov',
 		'max-feeds' => 'Limit počtu kanálov pre používateľov',
 		'registration' => array(
 		'registration' => array(
-			'help' => '0 znamená žiadny limit počtu účtov',
 			'number' => 'Maximálny počt účtov',
 			'number' => 'Maximálny počt účtov',
+			'select' => array(
+				'label' => 'Registration form',	// TODO
+				'option' => array(
+					'noform' => 'Disabled: No registration form',	// TODO
+					'nolimit' => 'Enabled: No limit of accounts',	// TODO
+					'setaccountsnumber' => 'Set max. number of accounts',	// TODO
+				),
+			),
+			'status' => array(
+				'disabled' => 'Form disabled',	// TODO
+				'enabled' => 'Form enabled',	// TODO
+			),
+			'title' => 'User registration form',	// TODO
 		),
 		),
 	),
 	),
 	'update' => array(
 	'update' => array(

+ 13 - 1
app/i18n/tr/admin.php

@@ -168,8 +168,20 @@ return array(
 		'max-categories' => 'Kullanıcı başına kategori limiti',
 		'max-categories' => 'Kullanıcı başına kategori limiti',
 		'max-feeds' => 'Kullanıcı başına akış limiti',
 		'max-feeds' => 'Kullanıcı başına akış limiti',
 		'registration' => array(
 		'registration' => array(
-			'help' => '0 sınır yok anlamındadır',
 			'number' => 'En fazla hesap sayısı',
 			'number' => 'En fazla hesap sayısı',
+			'select' => array(
+				'label' => 'Registration form',	// TODO
+				'option' => array(
+					'noform' => 'Disabled: No registration form',	// TODO
+					'nolimit' => 'Enabled: No limit of accounts',	// TODO
+					'setaccountsnumber' => 'Set max. number of accounts',	// TODO
+				),
+			),
+			'status' => array(
+				'disabled' => 'Form disabled',	// TODO
+				'enabled' => 'Form enabled',	// TODO
+			),
+			'title' => 'User registration form',	// TODO
 		),
 		),
 	),
 	),
 	'update' => array(
 	'update' => array(

+ 13 - 1
app/i18n/zh-cn/admin.php

@@ -168,8 +168,20 @@ return array(
 		'max-categories' => '各用户分类数限制',
 		'max-categories' => '各用户分类数限制',
 		'max-feeds' => '各用户订阅源数限制',
 		'max-feeds' => '各用户订阅源数限制',
 		'registration' => array(
 		'registration' => array(
-			'help' => '0 表示无用户数限制',
 			'number' => '最大用户数',
 			'number' => '最大用户数',
+			'select' => array(
+				'label' => 'Registration form',	// TODO
+				'option' => array(
+					'noform' => 'Disabled: No registration form',	// TODO
+					'nolimit' => 'Enabled: No limit of accounts',	// TODO
+					'setaccountsnumber' => 'Set max. number of accounts',	// TODO
+				),
+			),
+			'status' => array(
+				'disabled' => 'Form disabled',	// TODO
+				'enabled' => 'Form enabled',	// TODO
+			),
+			'title' => 'User registration form',	// TODO
 		),
 		),
 	),
 	),
 	'update' => array(
 	'update' => array(

+ 42 - 29
app/views/configure/system.phtml

@@ -30,61 +30,72 @@
 		</div>
 		</div>
 
 
 		<div class="form-group">
 		<div class="form-group">
-			<label class="group-name" for="max-registrations"><?= _t('admin.system.registration.number') ?></label>
+			<label class="group-name" for="max-feeds"><?= _t('admin.system.max-feeds') ?></label>
 			<div class="group-controls">
 			<div class="group-controls">
-				<input type="number" id="max-registrations" name="max-registrations" value="<?= FreshRSS_Context::$system_conf->limits['max_registrations'] ?>" min="0"
-					data-leave-validation="<?= FreshRSS_Context::$system_conf->limits['max_registrations'] ?>"/>
-				<p class="help"><?= _i('help') ?> <?= _t('admin.system.registration.help') ?></p>
+				<input type="number" id="max-feeds" name="max-feeds" value="<?= FreshRSS_Context::$system_conf->limits['max_feeds'] ?>" min="1"
+					data-leave-validation="<?= FreshRSS_Context::$system_conf->limits['max_feeds'] ?>"/>
 			</div>
 			</div>
 		</div>
 		</div>
 
 
 		<div class="form-group">
 		<div class="form-group">
+			<label class="group-name" for="max-categories"><?= _t('admin.system.max-categories') ?></label>
 			<div class="group-controls">
 			<div class="group-controls">
-				<?php
-					$number = count(listUsers());
-					echo ($number > 1 ? _t('admin.user.numbers', $number) : _t('admin.user.number', $number));
-				?>
+				<input type="number" id="max-categories" name="max-categories" value="<?= FreshRSS_Context::$system_conf->limits['max_categories'] ?>" min="1"
+					data-leave-validation="<?= FreshRSS_Context::$system_conf->limits['max_categories'] ?>"/>
 			</div>
 			</div>
 		</div>
 		</div>
 
 
 		<div class="form-group">
 		<div class="form-group">
+			<label class="group-name" for="cookie-duration"><?= _t('admin.system.cookie-duration.number') ?></label>
 			<div class="group-controls">
 			<div class="group-controls">
-				<label class="checkbox" for="force-email-validation">
-					<input
-						type="checkbox"
-						name="force-email-validation"
-						id="force-email-validation"
-						value="1"
-						<?= FreshRSS_Context::$system_conf->force_email_validation ? 'checked="checked"' : '' ?>
-						data-leave-validation="<?= FreshRSS_Context::$system_conf->force_email_validation ?>"
-					/>
-					<?= _t('admin.system.force_email_validation') ?>
-				</label>
+				<input type="number" id="cookie-duration" name="cookie-duration" value="<?= FreshRSS_Context::$system_conf->limits['cookie_duration'] ?>" min="0"
+					data-leave-validation="<?= FreshRSS_Context::$system_conf->limits['cookie_duration'] ?>"/>
+				<p class="help"><?= _i('help') ?> <?= _t('admin.system.cookie-duration.help') ?></p>
 			</div>
 			</div>
 		</div>
 		</div>
 
 
+		<legend><?= _t('admin.system.registration.title') ?></legend>
+
 		<div class="form-group">
 		<div class="form-group">
-			<label class="group-name" for="max-feeds"><?= _t('admin.system.max-feeds') ?></label>
+			<label class="group-name" for="max-registrations-select"><?= _t('admin.system.registration.select.label') ?></label>	
 			<div class="group-controls">
 			<div class="group-controls">
-				<input type="number" id="max-feeds" name="max-feeds" value="<?= FreshRSS_Context::$system_conf->limits['max_feeds'] ?>" min="1"
-					data-leave-validation="<?= FreshRSS_Context::$system_conf->limits['max_feeds'] ?>"/>
+				<select class="select-input-changer" name="" data-name="max-registrations">
+					<option value="1" <?= FreshRSS_Context::$system_conf->limits['max_registrations'] == 1 ? 'selected = "selected"' : ''; ?> data-input-visible="false"><?= _t('admin.system.registration.select.option.noform') ?></option>
+					<option value="0" <?= FreshRSS_Context::$system_conf->limits['max_registrations'] == 0 ? 'selected = "selected"' : ''; ?> data-input-visible="false"><?= _t('admin.system.registration.select.option.nolimit') ?></option>
+					<option value="2" <?= FreshRSS_Context::$system_conf->limits['max_registrations'] > 1 ? 'selected = "selected"' : ''; ?> data-input-visible="true"><?= _t('admin.system.registration.select.option.setaccountsnumber') ?></option>
+				</select>
+			</div>
+		</div>
+
+		<div class="form-group" id="max-registrations-block">
+			<label class="group-name" for="max-registrations"><?= _t('admin.system.registration.number') ?></label>
+			<div class="group-controls">
+				<?php $number = count(listUsers()); ?>
+				<input type="number" id="max-registrations-input" name="" value="<?= FreshRSS_Context::$system_conf->limits['max_registrations'] > 1 ? FreshRSS_Context::$system_conf->limits['max_registrations'] : $number + 1; ?>" min="2"
+					data-leave-validation="<?= FreshRSS_Context::$system_conf->limits['max_registrations'] ?>" data-number="<?= $number ?>"/>
+				<span id="max-registrations-status-disabled">(= <?= _t('admin.system.registration.status.disabled') ?>)</span><span id="max-registrations-status-enabled">(= <?= _t('admin.system.registration.status.enabled') ?>)</span>
 			</div>
 			</div>
 		</div>
 		</div>
 
 
 		<div class="form-group">
 		<div class="form-group">
-			<label class="group-name" for="max-categories"><?= _t('admin.system.max-categories') ?></label>
 			<div class="group-controls">
 			<div class="group-controls">
-				<input type="number" id="max-categories" name="max-categories" value="<?= FreshRSS_Context::$system_conf->limits['max_categories'] ?>" min="1"
-					data-leave-validation="<?= FreshRSS_Context::$system_conf->limits['max_categories'] ?>"/>
+				<?= ($number > 1 ? _t('admin.user.numbers', $number) : _t('admin.user.number', $number)); ?>
 			</div>
 			</div>
 		</div>
 		</div>
 
 
 		<div class="form-group">
 		<div class="form-group">
-			<label class="group-name" for="cookie-duration"><?= _t('admin.system.cookie-duration.number') ?></label>
 			<div class="group-controls">
 			<div class="group-controls">
-				<input type="number" id="cookie-duration" name="cookie-duration" value="<?= FreshRSS_Context::$system_conf->limits['cookie_duration'] ?>" min="0"
-					data-leave-validation="<?= FreshRSS_Context::$system_conf->limits['cookie_duration'] ?>"/>
-				<p class="help"><?= _i('help') ?> <?= _t('admin.system.cookie-duration.help') ?></p>
+				<label class="checkbox" for="force-email-validation">
+					<input
+						type="checkbox"
+						name="force-email-validation"
+						id="force-email-validation"
+						value="1"
+						<?= FreshRSS_Context::$system_conf->force_email_validation ? 'checked="checked"' : '' ?>
+						data-leave-validation="<?= FreshRSS_Context::$system_conf->force_email_validation ?>"
+					/>
+					<?= _t('admin.system.force_email_validation') ?>
+				</label>
 			</div>
 			</div>
 		</div>
 		</div>
 
 
@@ -96,3 +107,5 @@
 		</div>
 		</div>
 	</form>
 	</form>
 </main>
 </main>
+
+<script src="../scripts/config.js?<?= @filemtime(PUBLIC_PATH . '/scripts/config.js') ?>"></script>

+ 56 - 0
p/scripts/config.js

@@ -0,0 +1,56 @@
+// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-3.0
+'use strict';
+
+function init_selectInputChanger() {
+	const select = document.getElementsByClassName('select-input-changer');
+
+	for (let i = 0; i < select.length; i++) {
+		select[i].addEventListener('change', updateSelectInput);
+		select[i].dispatchEvent(new Event('change', {
+			bubbles: true,
+			cancelable: true,
+		}));
+	}
+}
+
+function updateSelectInput(ev) {
+	const elem = ev.target;
+	const formGroup = document.getElementById(elem.dataset.name + '-block');
+	const input = document.getElementById(elem.dataset.name + '-input');
+	if (elem.selectedOptions[0].dataset.inputVisible == 'false') {
+		formGroup.style.display = 'none';
+		input.name = '';
+		elem.name = elem.dataset.name;
+	} else {
+		formGroup.style.display = '';
+		input.name = elem.dataset.name;
+		elem.name = '';
+	}
+}
+
+function init_maxNumbersOfAccountsStatus() {
+	const input = document.getElementById('max-registrations-input');
+	if (input) {
+		input.addEventListener('change', onchange_maxNumbersOfAccounts);
+		input.dispatchEvent(new Event('change', {
+			bubbles: true,
+			cancelable: true,
+		}));
+	}
+}
+
+function onchange_maxNumbersOfAccounts(ev) {
+	const elem = ev.target;
+	if (elem.value > elem.dataset.number) {
+		document.getElementById('max-registrations-status-disabled').style.display = 'none';
+		document.getElementById('max-registrations-status-enabled').style.display = '';
+	} else {
+		document.getElementById('max-registrations-status-disabled').style.display = '';
+		document.getElementById('max-registrations-status-enabled').style.display = 'none';
+	}
+}
+
+init_selectInputChanger();
+init_maxNumbersOfAccountsStatus();
+
+// @license-end