1
1
Fork 0

use noscrape by default, add opt-out option to disable it

This commit is contained in:
Tobias Diekershoff 2014-10-13 19:19:54 +02:00
parent bff688ef91
commit 56cd536652
4 changed files with 6 additions and 6 deletions

View file

@ -366,7 +366,7 @@ function admin_page_site_post(&$a){
$basepath = ((x($_POST,'basepath')) ? notags(trim($_POST['basepath'])) : '');
$singleuser = ((x($_POST,'singleuser')) ? notags(trim($_POST['singleuser'])) : '');
$proxy_disabled = ((x($_POST,'proxy_disabled')) ? True : False);
$enable_noscrape = ((x($_POST,'enable_noscrape')) ? true : false);
$disable_noscrape = ((x($_POST,'disable_noscrape')) ? true : false);
if($ssl_policy != intval(get_config('system','ssl_policy'))) {
if($ssl_policy == SSL_POLICY_FULL) {
q("update `contact` set
@ -491,7 +491,7 @@ function admin_page_site_post(&$a){
set_config('system','temppath', $temppath);
set_config('system','basepath', $basepath);
set_config('system','proxy_disabled', $proxy_disabled);
set_config('system','enable_noscrape', $enable_noscrape);
set_config('system','disable_noscrape', $disable_noscrape);
info( t('Site settings updated.') . EOL);
goaway($a->get_baseurl(true) . '/admin/site' );
@ -654,7 +654,7 @@ function admin_page_site(&$a) {
'$relocate_url' => array('relocate_url', t("New base url"), $a->get_baseurl(), "Change base url for this server. Sends relocate message to all DFRN contacts of all users."),
'$enable_noscrape'=> array('enable_noscrape', t("Enable noscrape"), get_config('system','enable_noscrape'), t("The noscrape feature speeds up directory submissions by using JSON data instead of HTML scraping.")),
'$disable_noscrape'=> array('disable_noscrape', t("Disable noscrape"), get_config('system','disable_noscrape'), t("The noscrape feature speeds up directory submissions by using JSON data instead of HTML scraping. Disabling it will cause higher load on your server and the directory server.")),
'$form_security_token' => get_form_security_token("admin_site")
));

View file

@ -41,7 +41,7 @@ function friendica_init(&$a) {
);
//Enable noscrape?
if(!!get_config('system','enable_noscrape'))
if(!get_config('system','disable_noscrape'))
$data['no_scrape_url'] = $a->get_baseurl().'/noscrape';
echo json_encode($data);

View file

@ -2,7 +2,7 @@
function noscrape_init(&$a) {
if(!get_config('system','enable_noscrape'))
if(get_config('system','disable_noscrape'))
killme();
if($a->argc > 1)

View file

@ -108,7 +108,7 @@
{{include file="field_checkbox.tpl" field=$suppress_language}}
<h3>{{$performance}}</h3>
{{include file="field_checkbox.tpl" field=$enable_noscrape}}
{{include file="field_checkbox.tpl" field=$disable_noscrape}}
{{include file="field_checkbox.tpl" field=$use_fulltext_engine}}
{{include file="field_input.tpl" field=$itemcache}}
{{include file="field_input.tpl" field=$itemcache_duration}}