Jelajahi Sumber

Add support for terms of service

This feature is optional. It is based on the presence of a
`data/tos.html` file that an administrator can create. If this file
exists, FreshRSS will automatically add a "ToS" checkbox on the
registration page that users must check to be able to create their
account.
Marien Fressinaud 6 tahun lalu
induk
melakukan
a2ed6626c2
52 mengubah file dengan 274 tambahan dan 0 penghapusan
  1. 1 0
      app/Controllers/authController.php
  2. 17 0
      app/Controllers/indexController.php
  3. 10 0
      app/Controllers/userController.php
  4. 1 0
      app/i18n/cz/gen.php
  5. 3 0
      app/i18n/cz/index.php
  6. 5 0
      app/i18n/cz/user.php
  7. 1 0
      app/i18n/de/gen.php
  8. 3 0
      app/i18n/de/index.php
  9. 5 0
      app/i18n/de/user.php
  10. 1 0
      app/i18n/en/gen.php
  11. 3 0
      app/i18n/en/index.php
  12. 5 0
      app/i18n/en/user.php
  13. 1 0
      app/i18n/es/gen.php
  14. 3 0
      app/i18n/es/index.php
  15. 5 0
      app/i18n/es/user.php
  16. 1 0
      app/i18n/fr/gen.php
  17. 3 0
      app/i18n/fr/index.php
  18. 5 0
      app/i18n/fr/user.php
  19. 1 0
      app/i18n/he/gen.php
  20. 3 0
      app/i18n/he/index.php
  21. 5 0
      app/i18n/he/user.php
  22. 1 0
      app/i18n/it/gen.php
  23. 3 0
      app/i18n/it/index.php
  24. 5 0
      app/i18n/it/user.php
  25. 1 0
      app/i18n/kr/gen.php
  26. 3 0
      app/i18n/kr/index.php
  27. 5 0
      app/i18n/kr/user.php
  28. 1 0
      app/i18n/nl/gen.php
  29. 3 0
      app/i18n/nl/index.php
  30. 5 0
      app/i18n/nl/user.php
  31. 1 0
      app/i18n/oc/gen.php
  32. 3 0
      app/i18n/oc/index.php
  33. 5 0
      app/i18n/oc/user.php
  34. 1 0
      app/i18n/pt-br/gen.php
  35. 3 0
      app/i18n/pt-br/index.php
  36. 5 0
      app/i18n/pt-br/user.php
  37. 1 0
      app/i18n/ru/gen.php
  38. 3 0
      app/i18n/ru/index.php
  39. 5 0
      app/i18n/ru/user.php
  40. 1 0
      app/i18n/sk/gen.php
  41. 3 0
      app/i18n/sk/index.php
  42. 37 0
      app/i18n/sk/user.php
  43. 1 0
      app/i18n/tr/gen.php
  44. 3 0
      app/i18n/tr/index.php
  45. 5 0
      app/i18n/tr/user.php
  46. 1 0
      app/i18n/zh-cn/gen.php
  47. 3 0
      app/i18n/zh-cn/index.php
  48. 5 0
      app/i18n/zh-cn/user.php
  49. 9 0
      app/views/auth/register.phtml
  50. 13 0
      app/views/index/tos.phtml
  51. 1 0
      data/.gitignore
  52. 56 0
      data/tos.example.html

+ 1 - 0
app/Controllers/authController.php

@@ -205,6 +205,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController {
 			Minz_Error::error(403);
 		}
 
+		$this->view->show_tos_checkbox = file_exists(join_path(DATA_PATH, 'tos.html'));
 		$this->view->show_email_field = FreshRSS_Context::$system_conf->force_email_validation;
 		Minz_View::prependTitle(_t('gen.auth.registration.title') . ' · ');
 	}

+ 17 - 0
app/Controllers/indexController.php

@@ -259,6 +259,23 @@ class FreshRSS_index_Controller extends Minz_ActionController {
 		Minz_View::prependTitle(_t('index.about.title') . ' · ');
 	}
 
+	/**
+	 * This action displays the EULA page of FreshRSS.
+	 * This page is enabled only if admin created a data/tos.html file.
+	 * The content of the page is the content of data/tos.html.
+	 * It returns 404 if there is no EULA.
+	 */
+	public function tosAction() {
+		$terms_of_service = file_get_contents(join_path(DATA_PATH, 'tos.html'));
+		if (!$terms_of_service) {
+			Minz_Error::error(404);
+		}
+
+		$this->view->terms_of_service = $terms_of_service;
+		$this->view->can_register = !max_registrations_reached();
+		Minz_View::prependTitle(_t('index.tos.title') . ' · ');
+	}
+
 	/**
 	 * This action displays logs of FreshRSS for the current user.
 	 */

+ 10 - 0
app/Controllers/userController.php

@@ -281,6 +281,9 @@ class FreshRSS_user_Controller extends Minz_ActionController {
 			$passwordPlain = Minz_Request::param('new_user_passwordPlain', '', true);
 			$new_user_language = Minz_Request::param('new_user_language', FreshRSS_Context::$user_conf->language);
 
+			$tos_enabled = file_exists(join_path(DATA_PATH, 'tos.html'));
+			$accept_tos = Minz_Request::param('accept_tos', false);
+
 			if ($system_conf->force_email_validation && empty($email)) {
 				Minz_Request::bad(
 					_t('user.email.feedback.required'),
@@ -295,6 +298,13 @@ class FreshRSS_user_Controller extends Minz_ActionController {
 				);
 			}
 
+			if ($tos_enabled && !$accept_tos) {
+				Minz_Request::bad(
+					_t('user.tos.feedback.invalid'),
+					array('c' => 'auth', 'a' => 'register')
+				);
+			}
+
 			$ok = self::createUser($new_user_name, $email, $passwordPlain, '', array('language' => $new_user_language));
 			Minz_Request::_param('new_user_passwordPlain');	//Discard plain-text password ASAP
 			$_POST['new_user_passwordPlain'] = '';

+ 1 - 0
app/i18n/cz/gen.php

@@ -23,6 +23,7 @@ return array(
 		'update' => 'Update',	//TODO - Translation
 	),
 	'auth' => array(
+		'accept_tos' => 'I accept the <a href="%s">Terms of Service</a>.', // TODO - Translation
 		'email' => 'Email',
 		'keep_logged_in' => 'Zapamatovat přihlášení <small>(%s dny)</small>',
 		'login' => 'Login',

+ 3 - 0
app/i18n/cz/index.php

@@ -15,6 +15,9 @@ return array(
 		'version' => 'Verze',
 		'website' => 'Webové stránka',
 	),
+	'tos' => array(
+		'title' => 'Terms of Service', // TODO - Translation
+	),
 	'feed' => array(
 		'add' => 'Můžete přidat kanály.',
 		'empty' => 'Žádné články k zobrazení.',

+ 5 - 0
app/i18n/cz/user.php

@@ -22,6 +22,11 @@ return array(
 			'title' => 'Email address validation', //TODO - Translation
 		),
 	),
+	'tos' => array(
+		'feedback' => array(
+			'invalid' => 'You must accept the Terms of Service to be able to register.', // TODO - Translation
+		),
+	),
 	'mailer' => array(
 		'email_need_validation' => array(
 			'title' => 'You need to validate your account', //TODO - Translation

+ 1 - 0
app/i18n/de/gen.php

@@ -23,6 +23,7 @@ return array(
 		'update' => 'Aktualisieren',
 	),
 	'auth' => array(
+		'accept_tos' => 'I accept the <a href="%s">Terms of Service</a>.', // TODO - Translation
 		'email' => 'E-Mail-Adresse',
 		'keep_logged_in' => 'Eingeloggt bleiben <small>(%s Tage)</small>',
 		'login' => 'Anmelden',

+ 3 - 0
app/i18n/de/index.php

@@ -15,6 +15,9 @@ return array(
 		'version' => 'Version',
 		'website' => 'Webseite',
 	),
+	'tos' => array(
+		'title' => 'Terms of Service', // TODO - Translation
+	),
 	'feed' => array(
 		'add' => 'Sie können Feeds hinzufügen.',
 		'empty' => 'Es gibt keinen Artikel zum Anzeigen.',

+ 5 - 0
app/i18n/de/user.php

@@ -22,6 +22,11 @@ return array(
 			'title' => 'Email address validation', //TODO - Translation
 		),
 	),
+	'tos' => array(
+		'feedback' => array(
+			'invalid' => 'You must accept the Terms of Service to be able to register.', // TODO - Translation
+		),
+	),
 	'mailer' => array(
 		'email_need_validation' => array(
 			'title' => 'You need to validate your account', //TODO - Translation

+ 1 - 0
app/i18n/en/gen.php

@@ -23,6 +23,7 @@ return array(
 		'update' => 'Update',
 	),
 	'auth' => array(
+		'accept_tos' => 'I accept the <a href="%s">Terms of Service</a>.',
 		'email' => 'Email address',
 		'keep_logged_in' => 'Keep me logged in <small>(%s days)</small>',
 		'login' => 'Login',

+ 3 - 0
app/i18n/en/index.php

@@ -15,6 +15,9 @@ return array(
 		'version' => 'Version',
 		'website' => 'Website',
 	),
+	'tos' => array(
+		'title' => 'Terms of Service',
+	),
 	'feed' => array(
 		'add' => 'You may add some feeds.',
 		'empty' => 'There is no article to show.',

+ 5 - 0
app/i18n/en/user.php

@@ -22,6 +22,11 @@ return array(
 			'title' => 'Email address validation',
 		),
 	),
+	'tos' => array(
+		'feedback' => array(
+			'invalid' => 'You must accept the Terms of Service to be able to register.',
+		),
+	),
 	'mailer' => array(
 		'email_need_validation' => array(
 			'title' => 'You need to validate your account',

+ 1 - 0
app/i18n/es/gen.php

@@ -23,6 +23,7 @@ return array(
 		'update' => 'Update',	//TODO - Translation
 	),
 	'auth' => array(
+		'accept_tos' => 'I accept the <a href="%s">Terms of Service</a>.', // TODO - Translation
 		'email' => 'Correo electrónico',
 		'keep_logged_in' => 'Mantenerme identificado <small>(%s días)</small>',
 		'login' => 'Conectar',

+ 3 - 0
app/i18n/es/index.php

@@ -15,6 +15,9 @@ return array(
 		'version' => 'Versión',
 		'website' => 'Web',
 	),
+	'tos' => array(
+		'title' => 'Terms of Service', // TODO - Translation
+	),
 	'feed' => array(
 		'add' => 'Puedes añadir fuentes.',
 		'empty' => 'No hay artículos a mostrar.',

+ 5 - 0
app/i18n/es/user.php

@@ -22,6 +22,11 @@ return array(
 			'title' => 'Email address validation', //TODO - Translation
 		),
 	),
+	'tos' => array(
+		'feedback' => array(
+			'invalid' => 'You must accept the Terms of Service to be able to register.', // TODO - Translation
+		),
+	),
 	'mailer' => array(
 		'email_need_validation' => array(
 			'title' => 'You need to validate your account', //TODO - Translation

+ 1 - 0
app/i18n/fr/gen.php

@@ -23,6 +23,7 @@ return array(
 		'update' => 'Mettre à jour',
 	),
 	'auth' => array(
+		'accept_tos' => 'Accepter les <a href="%s">Conditions Générales d’Utilisation</a>.',
 		'email' => 'Adresse courriel',
 		'keep_logged_in' => 'Rester connecté <small>(%s jours)</small>',
 		'login' => 'Connexion',

+ 3 - 0
app/i18n/fr/index.php

@@ -15,6 +15,9 @@ return array(
 		'version' => 'Version',
 		'website' => 'Site Internet',
 	),
+	'tos' => array(
+		'title' => 'Conditions Générales d’Utilisation',
+	),
 	'feed' => array(
 		'add' => 'Vous pouvez ajouter des flux.',
 		'empty' => 'Il n’y a aucun article à afficher.',

+ 5 - 0
app/i18n/fr/user.php

@@ -22,6 +22,11 @@ return array(
 			'title' => 'Validation de l’adresse email',
 		),
 	),
+	'tos' => array(
+		'feedback' => array(
+			'invalid' => 'Vous devez accepter les conditions générales d’utilisation pour pouvoir vous inscrire.',
+		),
+	),
 	'mailer' => array(
 		'email_need_validation' => array(
 			'title' => 'Vous devez valider votre compte',

+ 1 - 0
app/i18n/he/gen.php

@@ -23,6 +23,7 @@ return array(
 		'update' => 'Update',	//TODO - Translation
 	),
 	'auth' => array(
+		'accept_tos' => 'I accept the <a href="%s">Terms of Service</a>.', // TODO - Translation
 		'email' => 'Email address',	//TODO - Translation
 		'keep_logged_in' => 'השאר מחובר <small>חודש</small>',
 		'login' => 'כניסה לחשבון',

+ 3 - 0
app/i18n/he/index.php

@@ -15,6 +15,9 @@ return array(
 		'version' => 'גרסה',
 		'website' => 'אתר',
 	),
+	'tos' => array(
+		'title' => 'Terms of Service', // TODO - Translation
+	),
 	'feed' => array(
 		'add' => 'ניתן להוסיף הזנות חדשות.',
 		'empty' => 'אין מאמר להצגה.',

+ 5 - 0
app/i18n/he/user.php

@@ -22,6 +22,11 @@ return array(
 			'title' => 'Email address validation', //TODO - Translation
 		),
 	),
+	'tos' => array(
+		'feedback' => array(
+			'invalid' => 'You must accept the Terms of Service to be able to register.', // TODO - Translation
+		),
+	),
 	'mailer' => array(
 		'email_need_validation' => array(
 			'title' => 'You need to validate your account', //TODO - Translation

+ 1 - 0
app/i18n/it/gen.php

@@ -23,6 +23,7 @@ return array(
 		'update' => 'Update', // TODO
 	),
 	'auth' => array(
+		'accept_tos' => 'I accept the <a href="%s">Terms of Service</a>.', // TODO - Translation
 		'email' => 'Indirizzo email',
 		'keep_logged_in' => 'Ricorda i dati <small>(%s giorni)</small>',
 		'login' => 'Accedi',

+ 3 - 0
app/i18n/it/index.php

@@ -15,6 +15,9 @@ return array(
 		'version' => 'Versione',
 		'website' => 'Sito',
 	),
+	'tos' => array(
+		'title' => 'Terms of Service', // TODO - Translation
+	),
 	'feed' => array(
 		'add' => 'Aggiungi un Feed RSS',
 		'empty' => 'Non ci sono articoli da mostrare.',

+ 5 - 0
app/i18n/it/user.php

@@ -22,6 +22,11 @@ return array(
 			'title' => 'Email address validation', //TODO - Translation
 		),
 	),
+	'tos' => array(
+		'feedback' => array(
+			'invalid' => 'You must accept the Terms of Service to be able to register.', // TODO - Translation
+		),
+	),
 	'mailer' => array(
 		'email_need_validation' => array(
 			'title' => 'You need to validate your account', //TODO - Translation

+ 1 - 0
app/i18n/kr/gen.php

@@ -23,6 +23,7 @@ return array(
 		'update' => '변경',
 	),
 	'auth' => array(
+		'accept_tos' => 'I accept the <a href="%s">Terms of Service</a>.', // TODO - Translation
 		'email' => '메일 주소',
 		'keep_logged_in' => '로그인 유지 <small>(%s 일)</small>',
 		'login' => '로그인',

+ 3 - 0
app/i18n/kr/index.php

@@ -15,6 +15,9 @@ return array(
 		'version' => '버전',
 		'website' => '웹사이트',
 	),
+	'tos' => array(
+		'title' => 'Terms of Service', // TODO - Translation
+	),
 	'feed' => array(
 		'add' => '피드를 추가하세요.',
 		'empty' => '글이 없습니다.',

+ 5 - 0
app/i18n/kr/user.php

@@ -22,6 +22,11 @@ return array(
 			'title' => 'Email address validation', //TODO - Translation
 		),
 	),
+	'tos' => array(
+		'feedback' => array(
+			'invalid' => 'You must accept the Terms of Service to be able to register.', // TODO - Translation
+		),
+	),
 	'mailer' => array(
 		'email_need_validation' => array(
 			'title' => 'You need to validate your account', //TODO - Translation

+ 1 - 0
app/i18n/nl/gen.php

@@ -23,6 +23,7 @@ return array(
 		'update' => 'Updaten',
 	),
 	'auth' => array(
+		'accept_tos' => 'I accept the <a href="%s">Terms of Service</a>.', // TODO - Translation
 		'email' => 'Email adres',
 		'keep_logged_in' => 'Ingelogd blijven voor <small>(%s dagen)</small>',
 		'login' => 'Log in',

+ 3 - 0
app/i18n/nl/index.php

@@ -15,6 +15,9 @@ return array(
 		'version' => 'Versie',
 		'website' => 'Website',
 	),
+	'tos' => array(
+		'title' => 'Terms of Service', // TODO - Translation
+	),
 	'feed' => array(
 		'add' => 'U kunt wat feeds toevoegen.',
 		'empty' => 'Er is geen artikel om te laten zien.',

+ 5 - 0
app/i18n/nl/user.php

@@ -22,6 +22,11 @@ return array(
 			'title' => 'Email address validation', //TODO - Translation
 		),
 	),
+	'tos' => array(
+		'feedback' => array(
+			'invalid' => 'You must accept the Terms of Service to be able to register.', // TODO - Translation
+		),
+	),
 	'mailer' => array(
 		'email_need_validation' => array(
 			'title' => 'You need to validate your account', //TODO - Translation

+ 1 - 0
app/i18n/oc/gen.php

@@ -23,6 +23,7 @@ return array(
 		'update' => 'Actualizar',
 	),
 	'auth' => array(
+		'accept_tos' => 'I accept the <a href="%s">Terms of Service</a>.', // TODO - Translation
 		'email' => 'Adreça de corrièl',
 		'keep_logged_in' => 'Demorar connectat <small>(%s jorns) </small>',
 		'login' => 'Connexion',

+ 3 - 0
app/i18n/oc/index.php

@@ -15,6 +15,9 @@ return array(
 		'website' => 'Site internet',
 		'version' => 'Version',
 	),
+	'tos' => array(
+		'title' => 'Terms of Service', // TODO - Translation
+	),
 	'feed' => array(
 		'add' => 'Podètz ajustar de fluxes.',
 		'empty' => 'I a pas cap de flux de mostrar.',

+ 5 - 0
app/i18n/oc/user.php

@@ -22,6 +22,11 @@ return array(
 			'title' => 'Validacion de l’adreça electronica',
 		),
 	),
+	'tos' => array(
+		'feedback' => array(
+			'invalid' => 'You must accept the Terms of Service to be able to register.', // TODO - Translation
+		),
+	),
 	'mailer' => array(
 		'email_need_validation' => array(
 			'title' => 'Vos cal validar vòstra adreça electronica',

+ 1 - 0
app/i18n/pt-br/gen.php

@@ -23,6 +23,7 @@ return array(
 		'update' => 'Update',	//TODO - Translation
 	),
 	'auth' => array(
+		'accept_tos' => 'I accept the <a href="%s">Terms of Service</a>.', // TODO - Translation
 		'email' => 'Endereço de e-mail',
 		'keep_logged_in' => 'Mantenha logado por <small>(%s days)</small>',
 		'login' => 'Login',

+ 3 - 0
app/i18n/pt-br/index.php

@@ -15,6 +15,9 @@ return array(
 		'version' => 'Versão',
 		'website' => 'Site',
 	),
+	'tos' => array(
+		'title' => 'Terms of Service', // TODO - Translation
+	),
 	'feed' => array(
 		'add' => 'Você pode adicionar alguns feeds.',
 		'empty' => 'Não há nenhum artigo para mostrar.',

+ 5 - 0
app/i18n/pt-br/user.php

@@ -22,6 +22,11 @@ return array(
 			'title' => 'Email address validation', //TODO - Translation
 		),
 	),
+	'tos' => array(
+		'feedback' => array(
+			'invalid' => 'You must accept the Terms of Service to be able to register.', // TODO - Translation
+		),
+	),
 	'mailer' => array(
 		'email_need_validation' => array(
 			'title' => 'You need to validate your account', //TODO - Translation

+ 1 - 0
app/i18n/ru/gen.php

@@ -23,6 +23,7 @@ return array(
 		'update' => 'Update',	//TODO - Translation
 	),
 	'auth' => array(
+		'accept_tos' => 'I accept the <a href="%s">Terms of Service</a>.', // TODO - Translation
 		'email' => 'Email address',	//TODO - Translation
 		'keep_logged_in' => 'Keep me logged in <small>(%s дней)</small>',	//TODO - Translation
 		'login' => 'Login',	//TODO - Translation

+ 3 - 0
app/i18n/ru/index.php

@@ -15,6 +15,9 @@ return array(
 		'version' => 'Version',	//TODO - Translation
 		'website' => 'Website',	//TODO - Translation
 	),
+	'tos' => array(
+		'title' => 'Terms of Service', // TODO - Translation
+	),
 	'feed' => array(
 		'add' => 'You may add some feeds.',	//TODO - Translation
 		'empty' => 'There is no article to show.',	//TODO - Translation

+ 5 - 0
app/i18n/ru/user.php

@@ -22,6 +22,11 @@ return array(
 			'title' => 'Email address validation', //TODO - Translation
 		),
 	),
+	'tos' => array(
+		'feedback' => array(
+			'invalid' => 'You must accept the Terms of Service to be able to register.', // TODO - Translation
+		),
+	),
 	'mailer' => array(
 		'email_need_validation' => array(
 			'title' => 'You need to validate your account', //TODO - Translation

+ 1 - 0
app/i18n/sk/gen.php

@@ -22,6 +22,7 @@ return array(
 		'update' => 'Aktualizovať',
 	),
 	'auth' => array(
+		'accept_tos' => 'I accept the <a href="%s">Terms of Service</a>.', // TODO - Translation
 		'email' => 'E-mailová adresa',
 		'keep_logged_in' => 'Zostať prihlásený <small>(počet dní: %s)</small>',
 		'login' => 'Prihlásiť',

+ 3 - 0
app/i18n/sk/index.php

@@ -15,6 +15,9 @@ return array(
 		'version' => 'Verzia',
 		'website' => 'Webová stránka',
 	),
+	'tos' => array(
+		'title' => 'Terms of Service', // TODO - Translation
+	),
 	'feed' => array(
 		'add' => 'Môžete pridať kanály.',
 		'empty' => 'Žiadne články.',

+ 37 - 0
app/i18n/sk/user.php

@@ -0,0 +1,37 @@
+<?php
+
+return array(
+	'email' => array(
+		'feedback' => array(
+			'invalid' => 'The email address is invalid.', //TODO - Translation
+			'required' => 'The email address is required.', //TODO - Translation
+		),
+		'validation' => array(
+			'change_email' => 'You can change your email address <a href="%s">on the profile page</a>.', //TODO - Translation
+			'email_sent_to' => 'We sent you an email at <strong>%s</strong>, please follow its indications to validate your address.', //TODO - Translation
+			'feedback' => array(
+				'email_failed' => 'We couldn’t send you an email because of a misconfiguration of the server.', //TODO - Translation
+				'email_sent' => 'An email has been sent to your address.', //TODO - Translation
+				'error' => 'The email address failed to be validated.', //TODO - Translation
+				'ok' => 'The email address has been validated.', //TODO - Translation
+				'unneccessary' => 'The email address was already validated.', //TODO - Translation
+				'wrong_token' => 'The email address failed to be validated due to a wrong token.', //TODO - Translation
+			),
+			'need_to' => 'You need to validate your email address before being able to use %s.', //TODO - Translation
+			'resend_email' => 'Resend the email', //TODO - Translation
+			'title' => 'Email address validation', //TODO - Translation
+		),
+	),
+	'tos' => array(
+		'feedback' => array(
+			'invalid' => 'You must accept the Terms of Service to be able to register.', // TODO - Translation
+		),
+	),
+	'mailer' => array(
+		'email_need_validation' => array(
+			'title' => 'You need to validate your account', //TODO - Translation
+			'welcome' => 'Welcome %s,', //TODO - Translation
+			'body' => 'You’ve just registered on %s but you still need to validate your email. For that, just follow the link:', //TODO - Translation
+		),
+	),
+);

+ 1 - 0
app/i18n/tr/gen.php

@@ -23,6 +23,7 @@ return array(
 		'update' => 'Update',	//TODO - Translation
 	),
 	'auth' => array(
+		'accept_tos' => 'I accept the <a href="%s">Terms of Service</a>.', // TODO - Translation
 		'email' => 'Email adresleri',
 		'keep_logged_in' => '<small>(%s günler)</small> oturumu açık tut',
 		'login' => 'Giriş',

+ 3 - 0
app/i18n/tr/index.php

@@ -15,6 +15,9 @@ return array(
 		'version' => 'Versiyon',
 		'website' => 'Website',
 	),
+	'tos' => array(
+		'title' => 'Terms of Service', // TODO - Translation
+	),
 	'feed' => array(
 		'add' => 'Akış ekleyebilirsin.',
 		'empty' => 'Gösterilecek makale yok.',

+ 5 - 0
app/i18n/tr/user.php

@@ -22,6 +22,11 @@ return array(
 			'title' => 'Email address validation', //TODO - Translation
 		),
 	),
+	'tos' => array(
+		'feedback' => array(
+			'invalid' => 'You must accept the Terms of Service to be able to register.', // TODO - Translation
+		),
+	),
 	'mailer' => array(
 		'email_need_validation' => array(
 			'title' => 'You need to validate your account', //TODO - Translation

+ 1 - 0
app/i18n/zh-cn/gen.php

@@ -23,6 +23,7 @@ return array(
 		'update' => '更新',	//TODO - Translation
 	),
 	'auth' => array(
+		'accept_tos' => 'I accept the <a href="%s">Terms of Service</a>.', // TODO - Translation
 		'email' => 'Email 地址',
 		'keep_logged_in' => '自动登录<small>(%s 天)</small>',
 		'login' => '登录',

+ 3 - 0
app/i18n/zh-cn/index.php

@@ -15,6 +15,9 @@ return array(
 		'version' => '版本',
 		'website' => '网站',
 	),
+	'tos' => array(
+		'title' => 'Terms of Service', // TODO - Translation
+	),
 	'feed' => array(
 		'add' => '你可以添加一些 RSS 源。',
 		'empty' => '暂时没有文章可显示。',

+ 5 - 0
app/i18n/zh-cn/user.php

@@ -22,6 +22,11 @@ return array(
 			'title' => 'Email address validation', //TODO - Translation
 		),
 	),
+	'tos' => array(
+		'feedback' => array(
+			'invalid' => 'You must accept the Terms of Service to be able to register.', // TODO - Translation
+		),
+	),
 	'mailer' => array(
 		'email_need_validation' => array(
 			'title' => 'You need to validate your account', //TODO - Translation

+ 9 - 0
app/views/auth/register.phtml

@@ -26,6 +26,15 @@
 			<noscript><b><?php echo _t('gen.js.should_be_activated'); ?></b></noscript>
 		</div>
 
+		<?php if ($this->show_tos_checkbox) { ?>
+			<div>
+				<label class="checkbox" for="accept-tos">
+					<input type="checkbox" name="accept_tos" id="accept-tos" value="1" required />
+					<?php echo _t('gen.auth.accept_tos', _url('index', 'tos')); ?>
+				</label>
+			</div>
+		<?php } ?>
+
 		<div>
 			<?php
 				$redirect_url = urlencode(Minz_Url::display(

+ 13 - 0
app/views/index/tos.phtml

@@ -0,0 +1,13 @@
+<div class="post content">
+    <?php if ($this->can_register) { ?>
+        <a href="<?php echo _url('auth', 'register'); ?>">
+            <?php echo _t('gen.action.back'); ?>
+        </a>
+    <?php } else { ?>
+        <a href="<?php echo _url('index', 'index'); ?>">
+            <?php echo _t('gen.action.back'); ?>
+        </a>
+    <?php } ?>
+
+    <?php echo $this->terms_of_service; ?>
+</div>

+ 1 - 0
data/.gitignore

@@ -6,3 +6,4 @@ force-https.txt
 last_update.txt
 no-cache.txt
 update.php
+tos.html

+ 56 - 0
data/tos.example.html

@@ -0,0 +1,56 @@
+<h1>Terms of Service</h1>
+
+<h2>Article 1: Lorem ipsum</h2>
+
+<p>
+	Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed fringilla,
+	magna non luctus lobortis, ipsum quam bibendum ipsum, ac rhoncus ipsum
+	velit in dolor. Vivamus quis ultrices sapien. Maecenas imperdiet massa
+	felis, ut ullamcorper arcu fermentum at. Mauris vitae tempor mi. Nullam ut
+	fermentum tortor, a luctus neque. Aenean imperdiet, leo vel blandit
+	molestie, lorem risus suscipit sem, et facilisis tellus elit ut magna. Ut
+	mattis blandit quam vitae interdum. Vestibulum quis pharetra ex, nec
+	efficitur erat. Vivamus hendrerit quam non facilisis lacinia. Sed tincidunt
+	consectetur maximus. Quisque eleifend risus vel felis hendrerit vulputate.
+	Nulla quis dapibus sapien, eget egestas quam. Nulla facilisi. Pellentesque
+	tincidunt elementum ultricies. Praesent mauris ante, ultrices quis dui ut,
+	ornare lacinia lectus. Etiam neque massa, congue in gravida et, mollis
+	egestas eros.
+</p>
+
+<h2>Article 2: Nunc Vel Diam</h2>
+
+<p>
+	Nunc vel diam sollicitudin turpis pharetra lobortis. Donec id mattis ipsum,
+	non porta sem. Maecenas fermentum velit quis sem lacinia egestas. Praesent
+	vulputate nulla in lectus tempus, maximus suscipit felis molestie. Sed ac
+	suscipit mi. Maecenas at pretium nibh, a elementum elit. Ut pretium turpis
+	tempor maximus ullamcorper. Vivamus ipsum velit, volutpat vitae varius ut,
+	dignissim eget mi. Nunc id erat facilisis, vestibulum lacus in, ultricies
+	purus. Mauris id ligula tempor, venenatis dolor at, mattis magna. Duis
+	luctus dui ut est porttitor, id pulvinar enim tempus.
+</p>
+
+<h2>Article 3: Ut Non Leo Commodo</h2>
+
+<p>
+	Ut non leo commodo, tempus mauris ac, pulvinar nunc. Fusce facilisis purus
+	et est ornare, eget tempor purus porttitor. Donec ut leo in diam sodales
+	ullamcorper. Sed efficitur nisl sit amet ante euismod, id dapibus dui
+	mollis. In sagittis eget dolor id pharetra. Suspendisse pellentesque
+	ultricies volutpat. Pellentesque pretium quam quis ligula lobortis
+	convallis. Donec vel erat elementum, varius metus a, egestas turpis.
+	Aliquam porttitor ut dolor et volutpat. Aliquam pretium, enim quis suscipit
+	bibendum, risus diam convallis tellus, et cursus odio felis quis nibh.
+	Vivamus fringilla hendrerit massa, eget varius odio ultrices vestibulum. Ut
+	vehicula eget tortor quis sodales.
+</p>
+
+<p>
+	Pellentesque pulvinar ex vel metus volutpat, a pretium libero aliquet. In
+	fringilla nisi ac lorem hendrerit, non volutpat elit condimentum.
+	Pellentesque congue luctus purus id porta. Suspendisse nec elementum urna.
+	Maecenas sollicitudin a tortor nec finibus. Donec malesuada, lectus
+	blandit sodales egestas, tortor ipsum cursus eros, eget pellentesque erat
+	nunc ut nulla. Vivamus porttitor consectetur felis at luctus.
+</p>