<commit_before>package org.sakaiproject.user.tool;

import java.io.IOException;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.sakaiproject.component.cover.ServerConfigurationService;
import org.sakaiproject.jsf.util.JsfTool;

public class PreferenceServlet extends JsfTool {

	@Override
	public void init(ServletConfig config) throws ServletException {
		// TODO Auto-generated method stub
		super.init(config);
		//UserPrefsTool tool = (UserPrefsTool) config.getServletContext().getAttribute("UserPrefsTool");
		m_default= defaultValue();
	}

	protected String defaultValue()
	{
		String defaultPreference="prefs_tab_title, prefs_noti_title, prefs_timezone_title, prefs_lang_title";
		String Notification="prefs_noti_title", CustomTab="prefs_tab_title", Timezone="prefs_timezone_title", Language="prefs_lang_title";
		String tabOrder=ServerConfigurationService.getString("preference.pages",defaultPreference);
		String[] tablist=tabOrder.split(",");
		String defaultPage=null;

		if(tablist[0].equals(Notification)) defaultPage="noti";
		else if(tablist[0].equals(CustomTab)) defaultPage="tab";
		else if(tablist[0].equals(Timezone)) defaultPage="timezone";
		else if (tablist[0].equals(Language)) defaultPage="locale";

		return defaultPage;
	}



}	<commit_msg>Fix to SAK-14983: Incorrect initial view when My Active Sites is enabled<commit_after>package org.sakaiproject.user.tool;

import java.io.IOException;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.sakaiproject.component.cover.ServerConfigurationService;
import org.sakaiproject.jsf.util.JsfTool;

public class PreferenceServlet extends JsfTool {

	@Override
	public void init(ServletConfig config) throws ServletException {
		// TODO Auto-generated method stub
		super.init(config);
		//UserPrefsTool tool = (UserPrefsTool) config.getServletContext().getAttribute("UserPrefsTool");
		m_default= defaultValue();
	}

	protected String defaultValue()
	{
		String defaultPreference="prefs_tab_title, prefs_noti_title, prefs_timezone_title, prefs_lang_title";
		String Notification="prefs_noti_title", CustomTab="prefs_tab_title", Timezone="prefs_timezone_title", Language="prefs_lang_title";
		String tabOrder=ServerConfigurationService.getString("preference.pages",defaultPreference);
		String[] tablist=tabOrder.split(",");
		String defaultPage=null;

		if(tablist[0].equals(Notification)) defaultPage="noti";
		else if(tablist[0].equals(CustomTab)){			
			if (ServerConfigurationService.getBoolean ("portal.use.dhtml.more", false))
				defaultPage = "tab-dhtml-moresites";
			else
				defaultPage="tab";
		}
		else if(tablist[0].equals(Timezone)) defaultPage="timezone";
		else if (tablist[0].equals(Language)) defaultPage="locale";

		return defaultPage;
	}



}	
{'fraction_non_alphanumeric': 0.11311311311311312, 'fraction_numerical': 0.004337671004337671, 'mean_word_length': 7.037533512064343, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1377571', 'n_tokens_mistral': 965, 'n_tokens_neox': 919, 'n_words': 162}