<commit_before><?php

// $Id$
// Copyright (c) 2002-2007, <NAME>, <NAME>, <NAME>, et. al.
// 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.

//this script may only be included - so its better to die if called directly.
$access->check_script($_SERVER["SCRIPT_NAME"],basename(__FILE__));

// Handle the current user prefs in session
if ( ! isset($_SESSION['u_info']['login']) || $_SESSION['u_info']['login'] != $user || $_SESSION['need_reload_prefs'] ) {
	$_SESSION['need_reload_prefs'] = false;
	$_SESSION['u_info'] = array();
	$_SESSION['u_info']['prefs'] = array();
	$_SESSION['u_info']['login'] = $user;
	$_SESSION['u_info']['group'] = ( $user ) ? $userlib->get_user_default_group($user) : '';
}

// Define the globals $u_info array for use in php / smarty
$u_info =& $_SESSION['u_info'];
$smarty->assign_by_ref('u_info', $u_info);

if ( $user ) {

	// Initialize user prefs
	$user_preferences = array(); // Used for cache
	$user_preferences[$user] =& $_SESSION['u_info']['prefs'];

	$group =& $_SESSION['u_info']['group'];
	$smarty->assign_by_ref('group', $group);
	$smarty->assign_by_ref('user', $user);
	$smarty->assign_by_ref('default_group', $group);

	// Get all user prefs in one query
	$tikilib->get_user_preferences($user);

	// Prefs overriding
	$prefs = array_merge($prefs, $user_preferences[$user]);

	// Copy some user prefs that doesn't have the same name as the related site pref
	//   in order to symplify the overriding and the use 
	if ( isset($prefs['theme']) && $prefs['theme'] != '' ) {
		$prefs['style'] = $prefs['theme'];
	}
<commit_msg>[MOD] Re-added userPage and userPage_exists variables for scripts that need/use them.<commit_after><?php

// $Id$
// Copyright (c) 2002-2007, <NAME>, <NAME>, <NAME>, et. al.
// 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.

//this script may only be included - so its better to die if called directly.
$access->check_script($_SERVER["SCRIPT_NAME"],basename(__FILE__));

// Handle the current user prefs in session
if ( ! isset($_SESSION['u_info']['login']) || $_SESSION['u_info']['login'] != $user || $_SESSION['need_reload_prefs'] ) {
	$_SESSION['need_reload_prefs'] = false;
	$_SESSION['u_info'] = array();
	$_SESSION['u_info']['prefs'] = array();
	$_SESSION['u_info']['login'] = $user;
	$_SESSION['u_info']['group'] = ( $user ) ? $userlib->get_user_default_group($user) : '';
}

// Define the globals $u_info array for use in php / smarty
$u_info =& $_SESSION['u_info'];
$smarty->assign_by_ref('u_info', $u_info);

if ( $user ) {

	// Initialize user prefs
	$user_preferences = array(); // Used for cache
	$user_preferences[$user] =& $_SESSION['u_info']['prefs'];

	$group =& $_SESSION['u_info']['group'];
	$smarty->assign_by_ref('group', $group);
	$smarty->assign_by_ref('user', $user);
	$smarty->assign_by_ref('default_group', $group);

	// Get all user prefs in one query
	$tikilib->get_user_preferences($user);

	// Prefs overriding
	$prefs = array_merge($prefs, $user_preferences[$user]);

	// Copy some user prefs that doesn't have the same name as the related site pref
	//   in order to symplify the overriding and the use 
	if ( isset($prefs['theme']) && $prefs['theme'] != '' ) {
		$prefs['style'] = $prefs['theme'];
	}

	// Set the userPage name for this user since other scripts use this value.
	$userPage = $prefs['feature_wiki_userpage_prefix'].$user;
	$exist = $tikilib->page_exists($userPage);
	$smarty->assign("userPage", $userPage);
	$smarty->assign("userPage_exists", $exist);

{'fraction_non_alphanumeric': 0.18292025862068967, 'fraction_numerical': 0.004310344827586207, 'mean_word_length': 5.076923076923077, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 26, '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': '5968791', 'n_tokens_mistral': 1287, 'n_tokens_neox': 1234, 'n_words': 329}