]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Admin/Blocklist/Contact.php
post/thread views are renamed, search bugs fixed
[friendica.git] / src / Module / Admin / Blocklist / Contact.php
index 8893623234dfadc8af5d59646fb534a9e6f6f974..73cb16819004ed4c0aaf828c6c14d2e9ca8eb4bd 100644 (file)
@@ -32,19 +32,19 @@ class Contact extends BaseAdmin
 {
        public static function post(array $parameters = [])
        {
-               parent::post($parameters);
+               self::checkAdminAccess();
+
+               self::checkFormSecurityTokenRedirectOnError('/admin/blocklist/contact', 'admin_contactblock');
 
                $contact_url  = $_POST['contact_url'] ?? '';
                $block_reason = $_POST['contact_block_reason'] ?? '';
                $contacts     = $_POST['contacts'] ?? [];
 
-               parent::checkFormSecurityTokenRedirectOnError('/admin/blocklist/contact', 'admin_contactblock');
-
                if (!empty($_POST['page_contactblock_block'])) {
                        $contact_id = Model\Contact::getIdForURL($contact_url);
                        if ($contact_id) {
                                Model\Contact::block($contact_id, $block_reason);
-                               notice(DI::l10n()->t('The contact has been blocked from the node'));
+                               info(DI::l10n()->t('The contact has been blocked from the node'));
                        } else {
                                notice(DI::l10n()->t('Could not find any contact entry for this URL (%s)', $contact_url));
                        }
@@ -54,7 +54,7 @@ class Contact extends BaseAdmin
                        foreach ($contacts as $uid) {
                                Model\Contact::unblock($uid);
                        }
-                       notice(DI::l10n()->tt('%s contact unblocked', '%s contacts unblocked', count($contacts)));
+                       info(DI::l10n()->tt('%s contact unblocked', '%s contacts unblocked', count($contacts)));
                }
 
                DI::baseUrl()->redirect('admin/blocklist/contact');
@@ -89,7 +89,7 @@ class Contact extends BaseAdmin
                        '$h_newblock'  => DI::l10n()->t('Block New Remote Contact'),
                        '$th_contacts' => [DI::l10n()->t('Photo'), DI::l10n()->t('Name'), DI::l10n()->t('Reason')],
 
-                       '$form_security_token' => parent::getFormSecurityToken('admin_contactblock'),
+                       '$form_security_token' => self::getFormSecurityToken('admin_contactblock'),
 
                        // values //
                        '$baseurl'    => DI::baseUrl()->get(true),