]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Admin/Tos.php
Merge pull request #10309 from fabrixxm/feature/advanced-logsview
[friendica.git] / src / Module / Admin / Tos.php
index 811a0eb25c0a7d10e8e666ff20540fa2694b6bb9..282e5daf1deb8a0e272b2c35cb1dfa290eb3f679 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -29,14 +29,14 @@ class Tos extends BaseAdmin
 {
        public static function post(array $parameters = [])
        {
-               parent::post($parameters);
-
-               parent::checkFormSecurityTokenRedirectOnError('/admin/tos', 'admin_tos');
+               self::checkAdminAccess();
 
                if (empty($_POST['page_tos'])) {
                        return;
                }
 
+               self::checkFormSecurityTokenRedirectOnError('/admin/tos', 'admin_tos');
+
                $displaytos = !empty($_POST['displaytos']);
                $displayprivstatement = !empty($_POST['displayprivstatement']);
                $tostext = (!empty($_POST['tostext']) ? strip_tags(trim($_POST['tostext'])) : '');
@@ -45,8 +45,6 @@ class Tos extends BaseAdmin
                DI::config()->set('system', 'tosprivstatement', $displayprivstatement);
                DI::config()->set('system', 'tostext', $tostext);
 
-               info(DI::l10n()->t('The Terms of Service settings have been updated.'));
-
                DI::baseUrl()->redirect('admin/tos');
        }
 
@@ -64,7 +62,7 @@ class Tos extends BaseAdmin
                        '$preview' => DI::l10n()->t('Privacy Statement Preview'),
                        '$privtext' => $tos->privacy_complete,
                        '$tostext' => ['tostext', DI::l10n()->t('The Terms of Service'), DI::config()->get('system', 'tostext'), DI::l10n()->t('Enter the Terms of Service for your node here. You can use BBCode. Headers of sections should be [h2] and below.')],
-                       '$form_security_token' => parent::getFormSecurityToken('admin_tos'),
+                       '$form_security_token' => self::getFormSecurityToken('admin_tos'),
                        '$submit' => DI::l10n()->t('Save Settings'),
                ]);
        }