X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fadmin.php;h=d73ac23fd0ef9fb954b095622d8e00519164b1c7;hb=3359f3f5c7ecc4b6a34c4fcfc095ab4dd5fab0f1;hp=83ef15f4a03e483e3e8f2c956bb4740c692fbb94;hpb=843ec842c3703a82a2450b6d8c114f2fd356dad2;p=friendica.git diff --git a/mod/admin.php b/mod/admin.php index 83ef15f4a0..d73ac23fd0 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -11,7 +11,6 @@ use Friendica\Core\Config; use Friendica\Core\Worker; use Friendica\Database\DBM; use Friendica\Model\User; -use Friendica\Network\Probe; use Friendica\Object\Contact; require_once 'include/enotify.php'; @@ -33,8 +32,6 @@ require_once 'include/items.php'; */ function admin_post(App $a) { - - if (!is_site_admin()) { return; } @@ -381,17 +378,12 @@ function admin_page_contactblock_post(App $a) check_form_security_token_redirectOnErr('/admin/contactblock', 'admin_contactblock'); if (x($_POST, 'page_contactblock_block')) { - $net = Probe::uri($contact_url); - if (in_array($net['network'], array(NETWORK_PHANTOM, NETWORK_MAIL))) { - notice(t('This contact doesn\'t seem to exist.')); - } - $nurl = normalise_link($net['url']); - $r = dba::select('contact', ['id'], ['nurl' => $nurl, 'uid' => 0], ['limit' => 1]); - if (DBM::is_result($r)) { - Contact::block($r['id']); + $contact_id = Contact::getIdForURL($contact_url, 0); + if ($contact_id) { + Contact::block($contact_id); notice(t('The contact has been blocked from the node')); } else { - notice(t('Could not find any contact entry for this URL (%s)', $nurl)); + notice(t('Could not find any contact entry for this URL (%s)', $contact_url)); } } if (x($_POST, 'page_contactblock_unblock')) { @@ -428,7 +420,7 @@ function admin_page_contactblock(App $a) // strings // '$title' => t('Administration'), '$page' => t('Remote Contact Blocklist'), - '$description' => t('This page allows you to prevent any message from a remote contact to reach your node. However, your node must have knowledge of the contact before you can block it.'), + '$description' => t('This page allows you to prevent any message from a remote contact to reach your node.'), '$submit' => t('Block Remote Contact'), '$select_all' => t('select all'), '$select_none' => t('select none'), @@ -446,6 +438,7 @@ function admin_page_contactblock(App $a) '$baseurl' => System::baseUrl(true), '$contacts' => $contacts, + '$total_contacts' => tt('%s total blocked contact', '%s total blocked contacts', $total), '$paginate' => paginate($a), '$contacturl' => ['contact_url', t("Profile URL"), '', t("URL of the remote contact to block.")], )); @@ -1286,7 +1279,7 @@ function admin_page_site(App $a) '$banner' => array('banner', t("Banner/Logo"), $banner, ""), '$shortcut_icon' => array('shortcut_icon', t("Shortcut icon"), Config::get('system','shortcut_icon'), t("Link to an icon that will be used for browsers.")), '$touch_icon' => array('touch_icon', t("Touch icon"), Config::get('system','touch_icon'), t("Link to an icon that will be used for tablets and mobiles.")), - '$info' => array('info', t('Additional Info'), $info, sprintf(t('For public servers: you can add additional information here that will be listed at %s/siteinfo.'), get_server())), + '$info' => array('info', t('Additional Info'), $info, sprintf(t('For public servers: you can add additional information here that will be listed at %s/servers.'), get_server())), '$language' => array('language', t("System language"), Config::get('system','language'), "", $lang_choices), '$theme' => array('theme', t("System theme"), Config::get('system','theme'), t("Default system theme - may be over-ridden by user profiles - change theme settings"), $theme_choices), '$theme_mobile' => array('theme_mobile', t("Mobile system theme"), Config::get('system', 'mobile-theme', '---'), t("Theme for mobile devices"), $theme_choices_mobile),