Przeglądaj źródła

Merge branch 'warning_agreement'

emanuele 12 lat temu
rodzic
commit
4e12593eea
2 zmienionych plików z 12 dodań i 3 usunięć
  1. 10 2
      Sources/Subs.php
  2. 2 1
      Themes/default/languages/index.english.php

+ 10 - 2
Sources/Subs.php

@@ -3113,12 +3113,16 @@ function template_header()
 			secureDirectory($path, true);
 			secureDirectory($cachedir);
 
-			if (!empty($securityFiles) || (!empty($modSettings['cache_enable']) && !is_writable($cachedir)))
+			// If agreement is enabled, at least the english version shall exists
+			if ($modSettings['requireAgreement'])
+				$agreement = !file_exists($boarddir . '/agreement.txt');
+
+			if (!empty($securityFiles) || (!empty($modSettings['cache_enable']) && !is_writable($cachedir)) || !empty($agreement))
 			{
 				echo '
 		<div class="errorbox">
 			<p class="alert">!!</p>
-			<h3>', empty($securityFiles) ? $txt['cache_writable_head'] : $txt['security_risk'], '</h3>
+			<h3>', empty($securityFiles) ? $txt['generic_warning'] : $txt['security_risk'], '</h3>
 			<p>';
 
 				foreach ($securityFiles as $securityFile)
@@ -3135,6 +3139,10 @@ function template_header()
 					echo '
 				<strong>', $txt['cache_writable'], '</strong><br />';
 
+				if (!empty($agreement))
+					echo '
+				<strong>', $txt['agreement_missing'], '</strong><br />';
+
 				echo '
 			</p>
 		</div>';

+ 2 - 1
Themes/default/languages/index.english.php

@@ -443,8 +443,9 @@ $txt['search_advanced'] = 'Advanced search';
 $txt['security_risk'] = 'MAJOR SECURITY RISK:';
 $txt['not_removed'] = 'You have not removed ';
 $txt['not_removed_extra'] = '%1$s is a backup of %2$s that was not generated by SMF. It can be accessed directly and used to gain unauthorised access to your forum. You should delete it immediately.';
+$txt['generic_warning'] = 'Warning';
+$txt['agreement_missing'] = 'Even though you are requiring to accept the registration agreement, the file (agreement.txt) doesn\'t exists!';
 
-$txt['cache_writable_head'] = 'Performance Warning';
 $txt['cache_writable'] = 'The cache directory is not writable - this will adversely affect the performance of your forum.';
 
 $txt['page_created'] = 'Page created in ';