<commit_before><?php
// (c) Copyright 2002-2012 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$

require_once ('tiki-setup.php');
$access->check_script($_SERVER['SCRIPT_NAME'], basename(__FILE__));

if (!empty($_REQUEST['w_use_dir'])) {
	if (substr($_REQUEST['w_use_dir'], -1) != '\\' && substr($_REQUEST['w_use_dir'], -1) != '/') {
		$_REQUEST['w_use_dir'] .= '/';
	}
	simple_set_value('w_use_dir');
}

if (isset($_REQUEST['dump'])) {
	check_ticket('admin-inc-wiki');
	include ('lib/tar.class.php');
	error_reporting(E_ERROR | E_WARNING);
	$adminlib->dump();
}

if (!empty($_REQUEST['moveWikiUp'])) {
	check_ticket('admin-inc-wiki');
	$filegallib = TikiLib::lib('filegal');
	$errorsWikiUp = $feedbacksWikiUp = array();
	$info = $filegallib->get_file_gallery_info($prefs['home_file_gallery']);
	if (empty($info)) {
		$errorsWikiUp[] = tra('You must set a home file gallery');
	} else {
		$filegallib->moveAllWikiUpToFgal($prefs['home_file_gallery'], $errorsWikiUp, $feedbacksWikiUp);
		$smarty->assign_by_ref('feedbacksWikiUp', $feedbacksWikiUp);
		$smarty->assign_by_ref('moveWikiUp', $_REQUEST['moveWikiUp']);
	}
	$smarty->assign_by_ref('errorsWikiUp', $errorsWikiUp);
}

// Included for the forum dropdown
include_once ('lib/comments/commentslib.php');
if (isset($_REQUEST['createtag'])) {
	check_ticket('admin-inc-wiki');
	// Check existance
	if ($adminlib->tag_exists($_REQUEST['tagname'])) {
		$msg = tra('Tag already exists');
		$access->display_error(basename(__FILE__), $msg);
	}
	$adminlib->create_tag($_REQUEST['tagname']);
}

if (isset($_REQUEST['restoretag'])) {
	check_ticket('admin-inc-wiki');
	// Check existance
	if (!$adminlib->tag_exists($_REQUEST['tagname'])) {
		$msg = tra('Tag not found');
		$access->display_error(basename(__FILE__), $msg);
	}
	$adminlib->restore_tag($_REQUEST['tagname']);
}

if (isset($_REQUEST['removetag'])) {
	check_ticket('admin-inc-wiki');
	// Check existance
	$adminlib->remove_tag($_REQUEST['tagname']);
}

if (isset($_REQUEST['rmvunusedpic'])) {
	check_ticket('admin-inc-wiki');
	$adminlib->remove_unused_pictures();
}

if (isset($_REQUEST['wikidiscussprefs'])) {
	check_ticket('admin-inc-wiki');
	simple_set_toggle('feature_wiki_discuss');
	simple_set_value('wiki_forum_id');
}

if (isset($_REQUEST['wikifeatures'])) {
	check_ticket('admin-inc-wiki');
	if ((isset($_REQUEST['feature_backlinks']) && $_REQUEST['feature_backlinks'] == 'on' && $prefs['feature_backlinks'] != 'y')
			|| (empty($_REQUEST['feature_backlinks']) && $prefs['feature_backlinks'] == 'y')
	) {
		$backlinksChange = true;
	}
<commit_msg>[FIX] Make the rebuild backlinks process run when the backlinks feature is enabled<commit_after><?php
// (c) Copyright 2002-2012 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$

require_once ('tiki-setup.php');
$access->check_script($_SERVER['SCRIPT_NAME'], basename(__FILE__));

if (!empty($_REQUEST['w_use_dir'])) {
	if (substr($_REQUEST['w_use_dir'], -1) != '\\' && substr($_REQUEST['w_use_dir'], -1) != '/') {
		$_REQUEST['w_use_dir'] .= '/';
	}
	simple_set_value('w_use_dir');
}

if (isset($_REQUEST['dump'])) {
	check_ticket('admin-inc-wiki');
	include ('lib/tar.class.php');
	error_reporting(E_ERROR | E_WARNING);
	$adminlib->dump();
}

if (!empty($_REQUEST['moveWikiUp'])) {
	check_ticket('admin-inc-wiki');
	$filegallib = TikiLib::lib('filegal');
	$errorsWikiUp = $feedbacksWikiUp = array();
	$info = $filegallib->get_file_gallery_info($prefs['home_file_gallery']);
	if (empty($info)) {
		$errorsWikiUp[] = tra('You must set a home file gallery');
	} else {
		$filegallib->moveAllWikiUpToFgal($prefs['home_file_gallery'], $errorsWikiUp, $feedbacksWikiUp);
		$smarty->assign_by_ref('feedbacksWikiUp', $feedbacksWikiUp);
		$smarty->assign_by_ref('moveWikiUp', $_REQUEST['moveWikiUp']);
	}
	$smarty->assign_by_ref('errorsWikiUp', $errorsWikiUp);
}

// Included for the forum dropdown
include_once ('lib/comments/commentslib.php');
if (isset($_REQUEST['createtag'])) {
	check_ticket('admin-inc-wiki');
	// Check existance
	if ($adminlib->tag_exists($_REQUEST['tagname'])) {
		$msg = tra('Tag already exists');
		$access->display_error(basename(__FILE__), $msg);
	}
	$adminlib->create_tag($_REQUEST['tagname']);
}

if (isset($_REQUEST['restoretag'])) {
	check_ticket('admin-inc-wiki');
	// Check existance
	if (!$adminlib->tag_exists($_REQUEST['tagname'])) {
		$msg = tra('Tag not found');
		$access->display_error(basename(__FILE__), $msg);
	}
	$adminlib->restore_tag($_REQUEST['tagname']);
}

if (isset($_REQUEST['removetag'])) {
	check_ticket('admin-inc-wiki');
	// Check existance
	$adminlib->remove_tag($_REQUEST['tagname']);
}

if (isset($_REQUEST['rmvunusedpic'])) {
	check_ticket('admin-inc-wiki');
	$adminlib->remove_unused_pictures();
}

if (isset($_REQUEST['wikidiscussprefs'])) {
	check_ticket('admin-inc-wiki');
	simple_set_toggle('feature_wiki_discuss');
	simple_set_value('wiki_forum_id');
}

if (isset($_REQUEST['wikifeatures'])) {
	check_ticket('admin-inc-wiki');
	if ((isset($_REQUEST['feature_backlinks']) && $_REQUEST['feature_backlinks'] == 'on' && $prefs['feature_backlinks'] == 'y')
			|| (empty($_REQUEST['feature_backlinks']) && $prefs['feature_backlinks'] == 'y')
	) {
		$backlinksChange = true;
	}

{'fraction_non_alphanumeric': 0.20039575463212808, 'fraction_numerical': 0.003597769382982551, 'mean_word_length': 6.64786795048143, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6921858', 'n_tokens_mistral': 2034, 'n_tokens_neox': 1959, 'n_words': 320}